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.
- Log in to your cPanel account.
- In the Email section, click Email Filters.
- Click Manage Filters next to the email account you want to configure.
- Click Create a New Filter.
- Enter a Filter Name (e.g. "Move newsletters to folder").
- 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).
- 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.
- 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.
- In the Email section, click Global Email Filters.
- Click Create a New Filter.
- Configure the rules and actions as described above.
- 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:
- Rule: From contains "[email protected]"
- Action: Discard Message
Forward emails containing a keyword:
- Rule: Body contains "urgent order"
- Action: Redirect to email "[email protected]"
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?
- Managing Spam Filters (Apache SpamAssassin) — Automatic spam detection and filtering.
- Setting Up Email Forwarders — Redirect mail without filters.