How To Automatically Delete Forwarded Mails in CPanel

Tue, Jun 22, 2010

Tutorials & Tips


CPanel’s a great software that’s been powering the web hosting industry for years. It has powerful functionality and a straightforward Graphical User Interface (GUI) that can allow a beginner to easily manage a web hosting account. However, some functionality can be tricky, such as the default forwarding function.

cpanel logo

If you create an email forwarder in CPanel that forwards email to test@anotherdomain.com, and create a POP email account of the same name – let’s call this test@testdomain.com – then you’ll receive 2 emails. 1 will be at test@anotherdomain.com, and 1 will be at test@testdomain.com. This isn’t ideal though, because sometimes you’ll need a POP account to reply mails with, and so you can’t just use a pure forwarder. Some email service providers such as Gmail has a “forward and delete” functionality, and this is a behavior we can replicate in CPanel. However, we can’t use the normal email forwarders. For this, we’ll need the account-level filtering function.

Go to account-level filtering in Cpanel, and then create a new filter. In the “Rules” section”, choose “Any header”, and put in your email address (e.g. test@testdomain.com). Now for the “Actions” section, choose “Redirect to email”, and put in the email address that you want all these mail to go to (e.g. test@anotherdomain.com).

Viola! You now have a “forward and delete” behavior in CPanel.

Similar Posts:

Tags: , , , , , , , , , , , , , , , , , , , , ,
, , , , , , , , , , , , , , , , , , , , ,

This post was written by:

- Alvin is a Singaporean who's interested in marketing, techy stuff and likes to just figure out how the two can work with each other. On top of his blog, you can also follow him on Twitter.

Get Alvin's Report On How To Blog Successfully - Free!

1 Comments For This Post

  1. Visuex Says:

    actually this isn't the best way to do this function.

    creating a filter doesn't always forward every email. I used to think the same as you but I've had filters for a couple years on many domains and checked the server recently to find 250 emails that it didnt send to me…they were all emails I didnt actually want but they were still not sent…maybe it was a spam issue that Gmail had rejected or something. I'm not sure why it didn't send them.

    The best option seems to be using a real forwarder for the redirecting of emails and then a cronjob to delete the original copies of the emails on the server. I'll make a tutorial for this later and post back with a link.

1 Trackbacks For This Post

  1. Mailbox with Fowarder to Blackhole and External Address - cPanel Forums Says:

    [...] Ryan, This seems to do what I am after, hopefully it will help you out too!! How To Automatically Delete Forwarded Mails in CPanel | Alvin Poh's Blog [...]

Leave a Reply

*