How to setup email filters in cPanel?

  1. Home
  2. Knowledge Base
  3. Hosting
  4. cPanel
  5. Email
  6. How to setup email filters in cPanel?

How to setup email filters in cPanel?

1. Login to your cPanel control panel. See how to do it here.

2. In the “Email” section press “Email filters“.

cPanel Email Filter

Here you can manage the filters of your specific already created email account. This is the user level filter, that will be applied only for this one email.

Just press the link “Manage Filters” on the left of your email.

cPanel Email Filter


3. Here press on the button “Create new filter“:

cPanel create Email Filter


4. In the line “Filter Name” enter a name for the new filter.

5. Select your filter rule:
cPanel create Email Filter

The first set of options specifies which part of the email message the system examines to determine whether the message matches your filter parameters.

FromThe message sender’s address
SubjectThe message’s subject line.
ToThe address to which the sender sent the message.
Reply AddressThe 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 examines error messages that an auto-response system sends
List IDThe account’s mailing lists
Spam StatusWhether Apache SpamAssassin™ marked the message as spam. The Spam Status line begins with Yes or No.
Spam BarThe content of the Spam Bar header that Apache SpamAssassin generated for this message.

The more plus signs (+) that Apache SpamAssassin assigns to a message, the greater the likelihood that the system marks the message as spam.

Spam ScoreThe total number of plus signs (+) in the Spam Bar value, expressed as an integer.


6. Select the operators of the rule:

After you select the portion of the email message that the system will examine, select the type of comparison between that portion of the email and the criteria that you enter.

equalsThe message exactly matches a defined string.
matches regexThe message matches a regular expression that you define.
containsThe message a string that you define.
does not containThe message does not contain the defined string.
begins withThe message begins with the defined string.
ends withThe message ends with the 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.


7. Additional options, available only when “Spam Score” is selected:

is above (#s only)The message’s Spam Score is greater than the number that you define.
is not above (#s only)The message’s Spam Score is equal to or less than the number that you define.
is below (#s only)The message’s Spam Score is less than the number that you define.
is not below (#s only)The message’s Spam Score is greater than or equal to the number that you define.

Spam Score can be selected in the SpamAssasin section in your cPanel.

8. After selecting the Rules, in the text box write the criteria needed for the rule to work.

9. Select the Actions which you want to do when the rule applies:

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 send 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.
Pipe to a programThe system sends the incoming message to a specified program.


10. After filling everything in, press the button “Create” and you will see that it is successfully created:

cPanel create Email Filter

Please take a note, that some of the filter options may not be available for selection because SpamAssasin is not enabled. You can enable it by pressing on the “Apache Spam Assasin” in the “Email” section. There press “Enable SpamAssasin”.

Was this article helpful?

Related Articles