Email

Email filters in cPanel: move, forward or delete emails automatically

Reviewed on 4 min read email filters

cPanel email filters apply automatic actions to the emails you receive. For example:

  • Create your own spam filter and send emails containing certain words to a folder.
  • Forward emails from a specific sender, or with a word in the subject, to another mailbox.
  • Move emails from a customer, a supplier or an online shop to a folder.

How a filter works

Each filter has rules and actions:

  • The rules decide which emails it applies to: the subject contains a word, the sender is from a domain, the recipient is a specific address…
  • The actions say what to do with them: deliver them to a folder, redirect them to another address, discard them…

You can chain several rules with and or or:

  • With or, it is enough for one of the rules to match.
  • With and, all of them have to match.

If you mix the two, cPanel evaluates the and rules first and then the or rules. To avoid surprises, create several simple filters instead of one very complex filter.

Create a filter for an account

  1. In cPanel, go to Email > Email Filters.
  2. Click Manage Filters next to the email account.
  3. Click Create a New Filter and give it a name.
  4. Define the rules and actions, and click Create.

This is a filter called ejemplo that applies if the subject contains Hola or the recipient is ejemplo@dominio.com. In that case, it redirects the email to paco@tudominio.com and discards it from the original account:

Email filter with two rules and two actions in cPanel

The most useful actions are:

  • Deliver to Folder: moves the email to a folder in the account. The folder has to exist; create it in webmail first.
  • Redirect to Email: sends the email to another address. If you also want to keep it in the original account, add a second Deliver to Folder action pointing to INBOX.
  • Discard Message: deletes the email without notifying the sender. Use it only once you have tested that the rule catches what you want: discarded emails cannot be recovered.
  • Stop Processing Rules: stops the following filters from acting on that email.

Filters are applied in the order they appear. If an email matches several, they all run unless one uses Stop Processing Rules.

Global filters: for all accounts

In Email > Global Email Filters, filters apply to all emails the hosting receives, across every account and every domain. You create them in the same way as account filters.

Global Email Filters in cPanel

If you want a global filter to affect only one domain or one address, add a rule on the recipient, for example To contains @dominio.com.

Test the filter

Below the list of filters you have Filter Test. Paste a sample email, with its headers (From:, To:, Subject:…), and click Test Filter: cPanel tells you which rules match and which actions would be applied, without touching any email.

Test with one email that should match and another that should not. Then send a real email from another account and check that it ends up where you expect.

If emails go missing after you create a filter, first check the filters that use Discard Message or Redirect to Email, both in the account and in the global ones.

You may also find useful

Something wrong or out of date? Tell us and we will review it.