Understanding Email Filters and Rules on the cPanel Mail Platform

Knowledgebase Articles and news

Views
631
Useful
1
By
Admin

Understanding Email Filters and Rules on the cPanel Mail Platform

Email filters is a feature of your Hostarina 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. 

Email Filters

Understanding Filter Rules

cpanel 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:

Option Description
From The message sender’s address
Subject The message’s subject line
To The address to which the sender sent the message
Reply The address at which the sender receives replies
Body The message’s content
Any Header Any part of the message’s header
Any Recipient Any recipient of the message
Has not been previously delivered The system only examines messages that remain in the queue for delivery
Is an Error Message The system only examples error messages that an auto-response system sends
List ID The 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.

cpanel filter operators

Here are the Operators options available:

ContainsThe message contains a string that you define

Option Description
Matches regex The message matches a regular expression that you define
Does not contain The message does not contain the defined string
Equals The message exactly matches a defined string
Begins with The message begins with the defined string
Ends with The message ends with a defined string
Does not begin The message does not begin with the defined string
Does not end with The message does not end with the defined string
Does not match The 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. user@example.com) as the criteria. The system will then use that filter rule to determine that any email from user@example.com 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 actions

You have the following Action options:

Action Description
Discard Message The system discards the incoming message with no failure notice
Redirect to Email The system forwards the message to another email address that you specify
Fail with Message The system discards the message and automatically sends a failure notice to the sender
Stop Processing Rules The system skips all filter rules
Deliver to Folder The 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.

cpanel filter examples

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:

cpanel filter email

Now Its Done and Completed