Skip to main content

Creating Email Filters

email, filters, rules, spam 0 Was this answer helpful?

Email filters let you automatically sort, redirect, discard, or respond to incoming messages based on criteria you define. Filters are applied on the server before the email reaches your inbox, so they work regardless of which device or client you use.

Please note: Screens and options may vary slightly depending on your cPanel version and hosting plan.

When You Would Use This

Use filters when you want to automatically organise email into folders, forward messages matching certain criteria, or discard unwanted messages that get past the spam filter.

Creating a User-Level Filter

User-level filters apply to a specific email account.

  1. Log in to your cPanel account.
  2. In the Email section, click Email Filters.
  3. Click Manage Filters next to the email account you want to configure.
  4. Click Create a New Filter.
  5. Enter a Filter Name (e.g. "Move newsletters to folder").
  6. Set the Rules (conditions):

- Choose the header to examine (e.g. From, Subject, To, Body). - Choose the comparison (e.g. contains, equals, matches regex, begins with). - Enter the value to match. - Click the + button to add additional rules. Choose and (all rules must match) or or (any rule can match).

  1. Set the Actions — what to do when the rules match:

- Deliver to folder — Move the message to a specific IMAP folder. - Redirect to email — Forward to another address. - Discard Message — Silently delete the message (use with caution). - Fail with message — Reject the message and send a bounce reply. - Pipe to a program — Pass the message to a script for processing.

  1. Click Create.

Creating a Global (Account-Level) Filter

Global filters apply to all email accounts on your cPanel account and are processed before user-level filters.

  1. In the Email section, click Global Email Filters.
  2. Click Create a New Filter.
  3. Configure the rules and actions as described above.
  4. Click Create.

Common Filter Examples

Move newsletters to a folder:

  • Rule: Subject contains "newsletter"
  • Action: Deliver to folder "Newsletters"

Auto-delete emails from a specific sender:

Forward emails containing a keyword:

Tips

  • Test your filters by sending a test email that matches the criteria.
  • Be careful with "Discard Message" — there is no way to recover discarded mail.
  • Filters are processed in order from top to bottom. You can reorder them on the filters page.
  • Use the "Pipe to a program" action to integrate with custom scripts or automation workflows.

What Next?

Related Articles

knowledgebasedidyoufindanswer