Account Level Filtering  Print this Article

cPanel lets you filter all email that is sent to all of your domain's email accounts. This account is simply a byproduct of account creation, and consists of your cPanel username and the server's hostname, in the format user@server.example.com. You cannot use this account to send mail.

Best practices

We strongly recommend that you use multiple, simple filters instead of a single, monolithic filter. Exim, your server's mail transfer agent, handles many small rules much more efficiently than it handles a single large rule.

Exim has an implicit limit on how large an error message can be. Excessively large filters can exceed that limit whenever an error is encountered, which will make attempt to debug the problem impossible.

Add an Account Level Filter

It is important to give the filter an appropriate name, as it will make the task of managing existing filters easier in the future.

To create a new filter, perform the following steps:

  1. Click Create a new Filter.
  2. Enter a name for the filter in the Filter Name box.
  3. Select a message characteristic from the first menu.
  4. Select an operator from the next menu.
  5. Enter the characters or words that you wish to use as a filter.

    Note: This field will accept regular expressions (when you select the matches regex operator), rather than more commonly used wildcard characters (such as * or ?).

  6. To add and subtract rules, click the + and - buttons.
  7. Select an action from the menu under the Actions heading. To add and subtract actions, click the + and - buttons.
  8. Click Activate to initialize the filter.

You can also read more about the comprehensive list of options to help you configure your filter.

Important

When you create a filter that uses several operators, it may be useful to note that cPanel will always process the "and" operator before the "or" operator. As a result, email filters will be processed as follows:
  • A or B and C will be processed as A or (B and C).
  • A and B or C will be processed as (A and B) or C.

If you wish to create a filter such as (A or B) and (C or D), you would have to create it like so:

  • (A and C) or (A and D) or (B and C) or (B and D).

Test a filter

Once a filter has been created, it can be tested.

To test your filter, perform the following steps:

  1. Enter a test email message in the text box below the Filter Test heading.
    • Be sure to include the characters or words that you have set up your filter to catch.
  2. Click Test Filter.

Edit a Custom Filter

You can also modify an existing filter.

To edit an existing filter, perform the following steps:

  1. Click Edit next to the appropriate filter name.
  2. You can adjust any of the fields displayed: the message characteristic, operator, term to filter, or resulting action.
  3. Click Activate to initialize the filter.

Delete an Existing Filter

To delete a filter, perform the following steps:

  1. Click Delete.
  2. Confirm that the filter should be deleted on the following page.

Was this answer helpful?

Also Read

How To Add Email Accounts
Add an Email Address To add a new email address: Enter the email address that you wish to...
How to Access Webmail
Webmail allows you to access your email accounts through your web browser. When you check email...
Forwarders
This feature allows a copy of any email sent to one address to be forwarded to another address....
Auto Responders
This feature can be configured to automatically send response messages. This can be useful when...
Default Address In Mail
This feature allows you to set up a default address that receives any mail sent to an invalid...