Table of Contents

Understanding Email Filters and Rules on the cPanel Mail Platform

Email filters is a feature of your Doteasy web hosting account which can help you manage your email delivery.

In this article, we will go over the email filter tool on your cPanel dashboard. We will also show you how to configure two of the more common filters and rules for your email address. You can also use this article as a guide on creating global email filters for your domain name.

How email filters work?

Email filters use the criteria that you specify to determine how to handle email messages. Emails can be discarded, redirected to another email address, or filed to a folder, or more.

On the Create a New Filter page, you will see that you can add multiple rules and action to a single filter. 

create a new filter page

Understanding Filter Rules

email filter rules

When creating a new email filter, the first set of options lets you specify which part of the email message your email system examines to determine whether the message matches your filter criteria.

Here are the Rule options available:

FromThe message sender’s address
SubjectThe message’s subject line
ToThe address to which the sender sent the message
ReplyThe address at which the sender receives replies
BodyThe message’s content
Any HeaderAny part of the message’s header
Any RecipientAny recipient of the message
Has not been previously deliveredThe system only examines messages that remain in the queue for delivery
Is an Error MessageThe system only examples error messages that an auto-response system sends
List IDThe account’s mailing lists

Once you have selected the portion of the email message that the system will examine, you can select the type of comparison between that portion of the email and the criteria that you enter.

email filter

Here are the Operators options available:

ContainsThe message contains a string that you define

Matches regexThe message matches a regular expression that you define
Does not containThe message does not contain the defined string
EqualsThe message exactly matches a defined string
Begins withThe message begins with the defined string
Ends withThe message ends with a defined string
Does not beginThe message does not begin with the defined string
Does not end withThe message does not end with the defined string
Does not matchThe message does not exactly match the defined string

Understanding Criteria Rules

Now that you have defined the filter rule, you can enter the criteria to use in the text box. This completes the filter rule that will be used by the system to compare incoming messages.

For example, if you have selected the From and Equals filters, enter an email address (ie. as the criteria. The system will then use that filter rule to determine that any email from matches the filter.

Understanding Actions

When the system determines that an email message matches your filter, it handles that message with the action that you have specified.

cPanel filter email actions

You have the following Action options:

Discard MessageThe system discards the incoming message with no failure notice
Redirect to EmailThe system forwards the message to another email address that you specify
Fail with MessageThe system discards the message and automatically sends a failure notice to the sender
Stop Processing RulesThe system skips all filter rules
Deliver to FolderThe system delivers the message to a specified folder

Example 1: how to configure an email filter based on email subjects

If you want to block all emails with a certain subject, say “Fast Approval”, you would select Subject and contains and then the text “Fast Approval” in the text box. You can select Discard Message or Fail with Message as the action.

email filter based on email subjects

Example 2: how to configure an email filter to trash unwanted emails automatically

Sometimes you get emails that you just don’t want to read, but at the same time, you don’t want to discard or block the sender just yet. There is an email filter configuration for that – a filter that will file all emails from a specific sender into a separate folder so you can read them at a later time.

The first thing you do is to create a folder in your email account to hold these emails. For this example, let’s just throw all these emails into the Junk folder.

Your email filter configuration would look something like this:

email filter trash unwanted emails