Skip to Content
Shared hosting (cPanel)Using cPanelEmail

Email filters and spam protection

Spam filters

The server scans every incoming message and gives it a score; the higher the score, the more likely it is to be spam. Open Email → Spam Filters to view and change the settings:

The Spam Filters page in cPanel

SettingDefaultWhat it does
Process New Emails and Mark them as SpamEnabledAdds a spam marker to the message headers if its score is 5 or higher.
Move New Spam to a Separate Folder (Spam Box)EnabledMoves spam to a spam folder in your mailbox instead of the inbox.
Automatically Delete New Spam (Auto-Delete)DisabledPermanently deletes spam as soon as it arrives.
Don't enable auto-delete

Legitimate mail can be marked as spam by mistake. With the Spam Box you can find and recover it, but auto-delete can't be undone. Check your spam folder every few days.

Additional Configurations let you:

  • Spam Threshold Score: change the score at which a message counts as spam. Lower it (to 4, for example) if you receive a lot of spam, and raise it if legitimate mail is being marked as spam.
  • Whitelist senders whose messages should never be marked as spam, and Blacklist senders whose messages should always be marked as spam.

To deal with spam from inside your mailbox itself, see Fighting spam in Webmail.

Email filters

Filters are rules that check every incoming message and take an action on it: move it to a folder, forward it, or delete it.

  • Email Filters: for a single email account. Choose the account, then Manage Filters.
  • Global Email Filters: for all mail coming into your account, across all addresses.

Create a filter

Open Email Filters and choose the account, or open Global Email Filters, then click Create a New Filter.

Enter a Filter Name that's unique and describes the rule.

Under Rules, set the condition:

  • What to check: the sender (From), subject (Subject), recipient (To), body (Body), any header, or the spam status and score.
  • How to compare: contains, equals, begins with, ends with, matches regex, or is greater than / less than (for numbers).
  • Then the value.

Add more conditions with the + button and combine them with and or or.

Under Actions, choose what happens: deliver to a folder (Deliver to Folder), forward to an address (Redirect to Email), delete (Discard Message), reject with a message (Fail With Message), stop processing the remaining rules (Stop Processing Rules), or pipe it to a script.

Click Create.

The form for creating an email filter

In the example above, every message with the word Invoice in its subject is forwarded to the accounting department.

Useful examples
  • Delete confirmed spam: condition Spam Status begins with Yes, action Discard Message.
  • Spam with a score of 5 or more: condition Spam Bar contains +++++. Each + represents one point of the score.

Once you've created a filter, try it out with Filter Test on the same page: paste in the text of a message and see what happens to it before the filter is applied to your real mail.

How is this guide?

On this page