This cPanel Flash Tutorial will show you how to add or delete email filters. The ability to use Email Filters is a nice feature that will examine all your messages and sort them. This is an excellent user-controlled method and can save you hours of time spent otherwise in browsing through junk emails. Email filters can easily be setup so users can manage incoming email in a way very similar to Outlook. Filters are especially useful for website owners with large amounts of incoming spam.

If your account also has Spam Assassin installed, it is also possible to setup a filter that will automatically delete all email that Spam Assassin marks as spam. There is also a "Test Filter" option, to test filters that have been added. Just fill out the required information and hit "Test Filter". It will then show you how the new filters that have been added affect the message.

  • Login to cPanel and click on Mail. Then click on the "E-mail Filtering" link.
  • To create a new email filter, click on the "Add Filter" link.
  • Select the required header field in the first drop-down list. These are the various fields in any e-mail message like 'To', 'Body' etc. For example, if you want to block emails containing certain words in the "Subject" of the message then select "Subject" in the header field.
  • Click on the required parameter in the second drop-down list. This will act on the text entered in the third field later. The option used most often is "contains" and it tests if the Subject (or other selected header) "contains" the words to be blocked or not.

    Equals - will match the text exactly (complete words only) e.g. "Loan" will block "Loan". 

    Matches regex - will match the text based on regular expression rules. Regular expressions are a powerful but complex area and you do not need to use regular expression filters mostly. 

    Contains - will match the specified text in any occurrence. "Credit" will block both "Credit" and "Credit Cards".

    Begins with - will match the text only when it occurs at the beginning of a word. "Porn" will block "Porn" and "Pornography" but not "Free porn".
  • Type the text words to be filtered in the third box (case sensitive).
  • Now you must choose what action to take on the identified emails. Enter the destination for the identified email in the Destination field box.

    There are three types of destinations:
    To destroy the e-mail type Discard (default option).
    To send the marked email to another address type the full email address.
    To send the email to a script type the full path to the script.
  • Finally click on the Activate button.
  • Incase you want to delete an email filter later on, just login to cPanel, click on "Mail" and then on "Email Filtering". Now you can click on the "Delete" button next to the filter you want to remove.