Home > Help Center > Shared Hosting > Email > Manage Email Filters in cPanel

Manage Email Filters in cPanel

An email filter uses a set of rules to determine whether the system will trigger a set of actions.

You can add multiple rules to match subjects, addresses, or other parts of the message. You can then add multiple actions to take on a message such as to deliver the message to a different address and then discard it.

There are two kinds of email filters in cPanel - Global Email Filters for all email accounts on the site and Email Filters for each email account.

In this article we will show you how to manage the Email Filters for individual email accounts.

The system will run these rules in the exim mail server so you won't be able to access them in your remote mail client such as Outlook or Thunderbird but you can get to these filters through cPanel or webmail interface.

Access email filters through cPanel

Login cPanel > Email and click Email Filters link:

cpanel email filters

In the Email Filters interface are listed all email accounts. If you have multiple accounts use search form to find the desired account.

To create or edit the email filters for a particular account click the corresponding Manage Filters link next to email account name:

cpanel email filters

On the next screen you can create or manage email filters for your main email account:

cpanel email filters

Access email filters through webmail

You can log in webmail using direct URL http://hostpulse-demo.com:2096 and you'll be redirectred to https://mailserver.com:2096.

Enter your username and password (for particular mail box) in the webmail login interface and click log in. Then click your username in the upper right corner of the webmail interface, select and click email filters:

cpanel email filters

The same email filters interface will appear within the webmail frame:

cpanel email filters

Create a New Email Filter

In the Filters by Users table, click Manage Filters next to the appropriate email account.

Click Create a New Filter.

Enter a name for the filter in the Filter Name text box.

Configure your filter's rules and actions by selecting an option and entering a spam word in the text box:

cpanel email filters

cpanel email filters

Using logical operators or / and you can add new or remove an existing rule or action:

cpanel email filters

Note: For detailed information on how to configure your filter, read our How to Configure Mail Filters article.

cpanel email filters

Click Create.

Current Filters

To list an email account's filters, click Manage Filters in the row of the appropriate email account. The Current Filters table lists all of the filters for the selected email account.

cpanel email filters

Reorder a filter

You can change the priority of those filters using the arrow buttons or you can drag and drop the rules at a new position in the table:

cpanel email filters

cpanel email filters

Edit a filter

Click Edit next to the appropriate filter name to enter the Create / Edit interface.

Make the desired changes to the filter and click Save.

Delete a filter

Click Delete next to the appropriate filter name.

Click Delete Filter to confirm:

cpanel email filters

A confirmation message will appear:

cpanel email filters

Test a filter

In the Filters by Users table, click Manage Filters next to the desired email account.

Enter a test email message in the Filter Test text box. We have included our spam words that should trigger the action:

cpanel email filters

Click Test Filter.

Filter Trace Results:

The Filter has matched the following condition(s):
$header_subject: contains shopping or $message_body matches offers
$header_subject: contains shopping
Return-path copied from sender
Sender      = hproot@hostpulse-demo.net
Recipient   = hproot@hostpulse-demo.net
Testing Exim filter file "/home/username/etc/hostpulse-demo.com/default/filter"
Deliver message to: spam-collector@hostpulse-demo.com
Filtering set up at least one significant delivery or other action.
No other deliveries will occur.

This report means that if someone sends an email to default@hostpulse-demo.com and the subject contains the word shopping or the body contains the word offers this email will be delivered to spam-collector@hostpulse-demo.com because of the email filter settings.

Let's check if that is true.

We send an email that contains the spam words. Now we open the receiving mail box default@hostpulse-demo.com but the email is not there:

cpanel email filters

Next we are checking spam-collector@hostpulse-demo.com - the email was delivered there following the filter actions (the mail source proves the delivery):

Return-Path: <hostpulse@hostpulse-demo.net>
Delivered-To: spam-collector@hostpulse-demo.com
Envelope-to: default@hostpulse-demo.com

Conclusion

Sending spam messages is completely unethical and unacceptable practice. cPanel provides various tools for limiting spam and email filters are one of those very successful tools.

Be careful when choosing spam words as it is possible for the filters to catch not spam emails also. Always choose the email forwarding action where you can check for incorrectly filtered emails and edit the filters accordingly.

#cpanel #email #security

Still not finding what you're looking for?

Contact our support team with any additional questions or concerns.

Contact support