Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 20
  1. #1
    Member
    Join Date
    Nov 2006
    Posts
    8

    Default How to Discard after forwarding email?

    We have about 60 email accounts, nearly 15 of them being forwarded to various other domains (forwarding works fine as expected). This leaves copies on the server, so I've been having to log in to each accounts to delete and purge them one by one, every month and it's getting annoying.

    So is there a safe way we can automatically discard them from the server after they are forwarded, instead of keeping a copy?

    I know I can increasing quota and do this less often, but I'd prefer a more automated option.

    Thanks in advance.
    Last edited by jbastan; 03-01-2008 at 05:00 AM.

  2. #2
    Member
    Join Date
    Jan 2008
    Posts
    43

    Default

    If you only need to forward emails, you probably already have added the forwarder.

    Your forwarder will work even if you do not have an pop account, that is to say, you can safely delete the pop account in your mail account section. So long the forwarder is there, all emails will continue to forward without leaving a copy in your mailbox.

  3. #3
    Member
    Join Date
    Nov 2006
    Posts
    8

    Default

    Good point, but some of these 15 accounts are actually being used to send as themselves. So they need to exist.

    I guess we could also setup the mail client to do this correctly (reply as: original account name).

  4. #4
    Member
    Join Date
    Jan 2008
    Posts
    43

    Default

    You may also want to consider running a cron job to empty the email folder of the 15 accounts so there you don't need to change what you already been doing.

    rm -f /home/username/mail/domain.com/user/new/*

  5. #5
    Member
    Join Date
    Sep 2004
    Posts
    64

    Default

    Instead of setting up a forward, you could use a mail filter that when the mail coming in matches the header To address, it will deliver the mail to a different e-mail address, therefore not putting the message into the original mailbox.

  6. #6
    Member
    Join Date
    Nov 2006
    Posts
    8

    Red face

    Hergy and John, both great solutions. I will split the accounts and try them both, and eventually pick one.


    [This is a week or two later]
    I've decided that John's idea to set up a cron tool is better, but adding my own twist. I'll be making a perl script that will access all these accounts and remove the old emails if they are older than XX days for "just-in-case" situations.
    Last edited by jbastan; 03-27-2008 at 06:12 PM. Reason: Update

  7. #7
    Registered User
    Join Date
    Oct 2006
    Posts
    1

    Default How do I delete the mail for the main account

    Your cron job is great but how do I do this for the main account. Is it the account name?

    Please help.

    Thanks Todd

  8. #8
    Member
    Join Date
    Jan 2008
    Posts
    43

    Default

    For your main account

    rm -f /home/username/mail/new/*

  9. #9
    Member SageBrian's Avatar
    Join Date
    Jun 2002
    Location
    NY/CT (US)
    Posts
    386

    Default

    Would not the proper way to do this is to just use forwards?

    Forwarder goes to their ISP/other mailbox.
    Then, setup their mail client at their ISP/other to send as the forward? Unless, of course, we are dealing with AOLer's.

    example:
    sales@companycom ----> happy456@gmail
    info@companycom ----> happy456@gmail

    On gmail, setup aliases so they can send out with an address of 'sales@companycom' or 'info@companycom'


    One thing to keep in mind with the forwards to another ISP, especially AOL, is that the other ISP may view you as a spammer or spam relay.

    Brian

  10. #10
    Member
    Join Date
    Nov 2004
    Posts
    135

    Default

    This is a trick. No need to setup forward mail account.

    Setup account filtering in cpanel page:

    Any header contain your@yourdomain.com redirect to email your@gmail.com

    Don't forget to add your@yourdomain.com in Gmail contact list to avoid spam or blacklist.


    Last edited by taotoon; 04-22-2008 at 12:08 AM.

  11. #11
    Registered User
    Join Date
    Apr 2008
    Posts
    1

    Default

    Quote Originally Posted by taotoon View Post
    This is a trick too. No need to setup forward mail account.

    This is exactly what I was looking for, thanks. I saw the FAQ about forwarding email to gmail (exactly what I want to do for one of four accounts at my domain) but the FAQ lacked (enough) detail (for me) in the answer.

    Thanks again!

  12. #12
    Member
    Join Date
    Nov 2001
    Posts
    93

    Default

    Quote Originally Posted by jbastan View Post
    Hergy and John, both great solutions. I will split the accounts and try them both, and eventually pick one.


    [This is a week or two later]
    I've decided that John's idea to set up a cron tool is better, but adding my own twist. I'll be making a perl script that will access all these accounts and remove the old emails if they are older than XX days for "just-in-case" situations.
    Is there any chance you could share the script, its exactly what I'm trying to do.

    Thanks
    Pete

  13. #13
    Member
    Join Date
    Oct 2008
    Posts
    6

    Default

    Quote Originally Posted by johnmigen View Post
    If you only need to forward emails, you probably already have added the forwarder.

    Your forwarder will work even if you do not have an pop account, that is to say, you can safely delete the pop account in your mail account section. So long the forwarder is there, all emails will continue to forward without leaving a copy in your mailbox.
    Why is "Discard" not recommended?

    And why can't cPanel do something as simple as email aliases, instead of forwarders and deleting the POP and all this other stuff?

    Matt

  14. #14
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by mfwills View Post
    And why can't cPanel do something as simple as email aliases, instead of forwarders and deleting the POP and all this other stuff?
    Can you elaborate? I ask because cPanel's Email Forwarders offers the functionality of what is known as "Email Aliases" in other hosting environments.

    Note, a mail account for a specific email address does not need to exist before you set up a forwarder for that specific email address.

  15. #15
    Member
    Join Date
    Oct 2008
    Posts
    6

    Default

    Quote Originally Posted by cPanelDavidG View Post
    Can you elaborate? I ask because cPanel's Email Forwarders offers the functionality of what is known as "Email Aliases" in other hosting environments.

    Note, a mail account for a specific email address does not need to exist before you set up a forwarder for that specific email address.
    Other messages indicated that I had to set up a POP account, then a forwarder, then delete the POP account, but not if I want to be able to use the forwarded address to send mail.

    Matt

Similar Threads & Tags
Similar threads

  1. Email forwarding problem - Not forwarding emails
    By fattwam in forum E-mail Discussions
    Replies: 1
    Last Post: 08-19-2011, 06:10 PM
  2. discard email containing attached password protected ZIP
    By boatdesign in forum E-mail Discussions
    Replies: 1
    Last Post: 09-29-2008, 10:48 AM
  3. How do you discard emails sent to other email address's please ?
    By _Chris_ in forum cPanel and WHM Discussions
    Replies: 12
    Last Post: 04-24-2008, 03:47 PM
  4. New Cpanel 11 mail forwarding options - discard without bounce
    By ncrossland in forum E-mail Discussions
    Replies: 2
    Last Post: 08-01-2007, 11:35 AM
  5. How to add filter to discard email that no Date: header ?
    By taotoon in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-03-2005, 11:09 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube