Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED Delete incoming emails everyday using a Cron

Discussion in 'E-mail Discussion' started by Ruzeen, Dec 11, 2016.

  1. Ruzeen

    Ruzeen Registered

    Joined:
    Dec 11, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Vancouver, BC
    cPanel Access Level:
    Website Owner
    Hi everyone,

    I have forwarded mails to my Gmail account but I don't want any emails to be retained on the server. And I can't delete the mail account and just use the forwarder because I need the SMTP info to reply from Gmail.

    Is it possible to delete all incoming emails from a particular mail account everyday, using a cron job? Does anyone know how I can achieve this?

    Or is there a better way to go about this?

    Much thanks!
     
  2. Eric

    Eric Administrator
    Staff Member

    Joined:
    Nov 25, 2007
    Messages:
    751
    Likes Received:
    11
    Trophy Points:
    143
    Location:
    Texas
    cPanel Access Level:
    Root Administrator
    Howdy,

    You've got 2 options I can think of in this insomnia:

    1. Make the output of the crontab go away. Add the > /dev/null to the end of the command and it should shut its trap. An example:
    Code:
    * * * * *        /usr/local/sbin/mycommand.sh > /dev/null
    2. Remove the mail address it's pointing to. Delete or set a dev/null account for the MAILTO= line in the crontab.

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Ruzeen

    Ruzeen Registered

    Joined:
    Dec 11, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Vancouver, BC
    cPanel Access Level:
    Website Owner
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice