Email filters in cPanel let you manage incoming messages. You can create, edit and delete rules for selected mailboxes. Rules match specified parts of a message. For example, a rule can match a sender address and then apply an action such as moving or discarding the message.

Several simple filters are generally easier to review than one complex filter. cPanel also recommends small, simple rules for efficient processing by Exim.

How to configure email filters in cPanel

  • Sign in to your cPanel.

  • Open the EMAIL and click Email Filters.

Email Filters tool in cPanel

Note: These steps configure filters for a particular mailbox. For account-wide filters, use Global Email Filters.

  • Click Manage Filters next to the email address you want to configure

Manage Filters button for an email address in cPanel
  • Click Create a New Filter to open the filter settings.

Create a New Filter button for a mailbox

Enter a filter name, select the message field and comparison, enter the matching value, and choose an action. You can add further rules or actions when needed. After configuring the filter, click Create.

Email filter form with name, rule, condition and action

Filter rules

The first option selects the part of the message to inspect. Available fields include: -From — The message sender address. - Subject — The message subject line. - To— The address shown as the message recipient.

Note: Recipients generally do not receive a Bcc header, so it cannot normally be used as a filter field.

- Reply Address — The address designated for replies. - Body — The message content. - Any Header— Any message header, including To, From, Envelope-To and Content-Type. - Any Recipient — Any recipient of the message. - Has not been previously delivered— Matches messages that have not yet been delivered. - Is an Error Message — Matches error messages generated by a mail system. - List ID— The mailing-list identifier. - Spam Status— Whether Apache SpamAssassin marked the message as spam; the status starts with Yes or No. - Spam Bar— The SpamAssassin spam-bar header. More plus signs (+) indicate a higher spam assessment. - Spam Score — The numeric spam assessment used by the filtering interface. Check the tool’s documentation when configuring score comparisons.

Comparison operators

After selecting the message field, choose how it should be compared with your criterion. Options include: - equals — Matches the specified string exactly. - matches regex — Matches a regular expression that you specify.

Note: With this option, the filter interprets the criterion as a Perl-compatible regular expression (PCRE), rather than a literal string. Characters such as * and ? have regex meanings. Exim also handles backslashes as escape characters, so extra escaping may be needed. For details, see the Exim documentation.

- contains — Contains the specified string. - does not contain — Does not contain the specified string. - begins with — Starts with the specified string. - ends with — Ends with the specified string. - does not begin — Does not start with the specified string. - does not end with — Does not end with the specified string. - does not equal — Does not exactly match the specified string. Enter the word or phrase to match in the criterion field below the operator.

Actions

When a message matches, cPanel applies the configured action or actions: - Discard Message — Deletes the incoming message without a delivery-failure notice. - Redirect to Email — Forwards the message to another specified address.

Note: Redirect to Email does not itself keep a copy in the inbox. Add a Deliver to Folder action targeting INBOX if you also need local delivery.

- Fail with Message — Rejects delivery with the specified failure response. - Stop Processing Rules — Stops further filter processing for the message. - Deliver to Folder — Places the message in the specified folder. - Pipe to a Program — Sends the message to a specified program. Review the tool’s Pipe to a Program documentation before enabling this action. After clickingCreateyour filter is saved and applies to new incoming messages for the selected mailbox.

Share

Check the result and troubleshoot

Test the rule with a representative message before using deletion. Check filter order and avoid overly broad conditions. Several simple rules are easier to control than a filter combining many cases.

Reference documentation:

Sources accessed on October 11, 2026. Available features depend on your hosting version and options.