How to create email filters in cPanel

Email filters in cPanel give you another level of control over email – especially over spam email you may receive. This article describes how to set up email filters in cPanel, and provides some tips and tricks for reducing spam.

How to set up email filters in cPanel

cPanel offers two levels of email filtering: Individual and Global. Settings are the same in each, except that Global filters apply to all email addresses associated with your domain.

  1. Log in to your cPanel.
  2. Scroll down to the Email section.Email Filters in cPanel
  3. Click the Email Filters icon.Email Filters in cPanel
  4. The Email Filters screen appears.
  5. In the Filters by Users section, find the email address you want to filter and click the Manage Filters link.Email Filters in cPanel
  6. The Edit Filters for email address screen appears. Click Create a New Filter.Email Filters in cPanel
  7. The Create a New Filter screen appears.
  8. Type a unique name for your filter in the Filter Name field.Email Filters in cPanel
  9. Set up the rules you wish to use to filter emails in the Rules field. Each rule has criteria and an operator describing how to compare them to a message.

The following criteria are available:

  • From — The message sender’s address.
  • Subject — The message’s subject line.
  • To — The address to which the sender sent the message.
  • Reply Address — 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 examines error messages that an auto-response system sends.
  • List ID —  The account’s mailing lists.
  • Spam Status — Whether Apache SpamAssassin™ marked the message as spam. The Spam Status line begins with Yes or No.
  • Spam Bar — The 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 Score — The total number of plus signs (+) in the Spam Bar value, expressed as an integer.

The following comparison operators are available:

  • equals — The message exactly matches a defined string.
  • matches regex — The message matches a regular expression that you define.
  • contains — The message contains a string that you define.
  • does not contain — The message does not contain the defined string.
  • begins with — The message begins with the defined string.
  • ends with — The message ends with the 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.
  1. Type the word or phrase you wish to filter on below the operator and criteria fields.
  2. Select the Action you wish to happen when an incoming email matches your new rule.Email Filters in cPanel

The following actions are available:

  • Discard Message: Discard the message with no failure notice to the sender.
  • Redirect to Email: Forward message to a specific email address.
  • Fail With Message: Discard the message and send a failure notice to the sender.
  • Stop Processing rules: Proceed and ignore all other filter rules. (Useful when you have more than one filter set up.)
  • Deliver to Folder: Deliver the message to a specific email folder.
  • Pipe to a Program: Send the message to a specific program for further processing.
  1. Click Create.Email Filters in cPanel
  2. Your new email filter is created. All new incoming emails for the email address you specified will be filtered according to this new rule.

You can do amazing things with email filter rules. For details on how to set up rules in cPanel, visit the cPanel knowledgebase or contact HostPapa Support.

Examples

Example 1 – Sending email from a specific address to a folder

If you want to send all emails from a specific address to a special folder, here’s how:

  1. Create and name your filter.
  2. Create the email folder you wish to send emails to.
  3. Select From in the Criteria menu.
  4. Select contains in the Operators menu.
  5. Enter the email address you wish to filter in the text field below the Criteria and Operators menus.
  6. Select Deliver to folder as the action.Filter an Email Address to a Folder
  7. Click the Browse button to select an email folder.
  8. Click Create to create your filter.

Example 2 – Filter out a word or phrase in a subject Line

To send any email with the words “100% Free” to your spam folder automatically:

  1. Create and name your filter.
  2. Create the email folder you wish to send emails to.
  3. Select Subject in the Criteria menu.
  4. Select contains in the Operators menu.
  5. Enter 100% Free in the text field below the Criteria and Operators menus.
  6. Select Deliver to folder as the action.
  7. Click the Browse button to select your Junk or Spam folder.
  8. Click Create to create your filter.

Tips and tricks for reducing spam with email filters

  • The quickest way to reduce spam is to filter all mail that the built-in SpamAssassin tool has marked as spam. In the Rules list, select Spam Status and begins with, then enter Yes in the box.
  • To block all emails with a specific subject line, select Subject as the criteria, contains as the operator, and type the subject line you wish to block. Select either Discard Message or Fail with Message as the action.
  • SpamAssassin puts + marks in the email header to indicate the spam score. If you want to filter all mails SpamAssassin marks with a spam score of 4 or greater, choose Spam Bar as the criteria, contains as the operator, and type ++++ in the word or phrase box.
  • To block a specific email address, select From as the criteria, equals as the operator, and type the email address you wish to block. Select Discard Message as the action.

Common spam words and phrases

Here are the most common spam words and phrases used in email messages:

$$$
100% free
Act Now
Ad
Affordable
Amazing stuff
Apply now
Auto email removal
Billion
Cash bonus
Cheap
Collect child support
Compare rates
Compete for your business
Credit
Credit bureaus
Dig up dirt on friends
Double your income
Earn $
Earn extra cash
Eliminate debt
Email marketing
Explode your business
Extra income
F r e e (note the space between each character)
Fast cash
Financial freedom
Financially independent
Free
Free gift
Free grant money
Free info
Free installation
Free investment
Free leads
Free membership
Free offer
Free preview Guarantee
‘Hidden’ assets
Home based
Homebased business
Income from home
Increase sales
Increase traffic
Increase your sales
Incredible deal
Info you requested
Information you requested
Internet market
Leave
Limited time offer
Make $
Mortgage Rates
Multi level marketing
No investment
Obligation
Online marketing
Opportunity
Order Now
Prices
Promise you
Refinance
Remove
Reverses aging
Save $
Search engine listings
Serious cash
Stock disclaimer statement
Stop snoring
Thousands
Unsubscribe
Web traffic
Weight loss

A note of caution

You can do a lot with email filters – including accidentally creating a filter that deletes emails you didn’t want to delete. Take care when you create a filter, and use the cPanel filter tester to verify it does exactly what you want.

As always, when you need help you can always contact HostPapa Support for assistance.

Related Articles

Get online with our affordable web hosting

Get online with our affordable web hosting

Learn more now
HostPapa Mustache