Email filters let you decide automatically what happens to certain messages for one email account. For example, you can file newsletters in a folder, send invoices to a colleague, or discard mail containing a particular phrase. To set rules for every address on your hosting account, use global email filters instead.
Create a filter
- Log in to cPanel and go to Email › Email Filters.
- Find the email account and click Manage Filters.
- Click Create a New Filter and give it a name you'll recognise later.
- Set up the Rules. Choose what to check (such as From, Subject, To or Body), how to compare it (such as contains, equals or begins with), and the text to look for. Click + to add more rules and choose whether all of them (and) or any of them (or) must match.
- Choose the Action:
- Deliver to Folder: files the message in a folder of your choice.
- Redirect to Email: sends it on to another address.
- Discard Message: deletes it silently. It can't be recovered, so use this with care.
- Fail with Message: bounces it back to the sender with your message.
- Stop Processing Rules: stops any later filters running on the message.
- Click Create.
Example: to file supplier invoices, set Subject contains Invoice with the action Deliver to Folder and choose an Invoices folder.
Test, edit or delete a filter
- Test: on the account's Manage Filters page, use the Filter Test box. Paste in a sample message (with a
From:andSubject:line) and click Test Filter to see what would happen, without affecting real mail. - Edit: click Edit next to the filter under Current Filters, make your changes and click Save.
- Delete: click Delete next to the filter, then confirm.
Filters in webmail
You can also create filters without cPanel. Log in to webmail, open Roundcube, and go to Settings › Filters. This is useful if you have access to a mailbox but not to the cPanel account.
Good to know
Filters are best for sorting mail you want. For general spam, adjust the spam filtering instead. See how spam filtering works and how to adjust it. If mail goes missing after you add a filter, check the rule isn't wider than you meant it to be. A Body contains rule with a common word can catch far more than expected.