Email filtering in cPanel gives you precise control over how incoming messages are handled — automatically sorting, forwarding, deleting, or redirecting emails based on criteria you define. Combined with catch-all addresses (which capture messages sent to any address at your domain, even if a specific mailbox does not exist), email filters let you build a smart, automated email workflow without any third-party tools.
This guide covers the complete process of setting up catch-all email addresses and custom email filters in cPanel, with practical examples for common business scenarios. Whether you are managing a single domain or multiple email accounts on MassiveGRID's high-availability cPanel hosting, these features help you stay organized and responsive.
Understanding Catch-All Email Addresses
A catch-all (also called a default address) is a rule that captures all emails sent to your domain that do not match an existing mailbox or forwarder. For example, if someone sends an email to randomname@yourdomain.com and you do not have a mailbox or forwarder for "randomname," the catch-all determines what happens to that message.
Why Use a Catch-All?
- Capture misspelled addresses — If a client accidentally emails jhon@yourdomain.com instead of john@yourdomain.com, a catch-all ensures you still receive the message
- Receive mail from old addresses — If you previously used addresses that no longer have mailboxes, a catch-all keeps those messages from bouncing
- Business cards and print materials — If you have printed materials with email addresses that do not have dedicated mailboxes, a catch-all captures those messages
- Testing — During development or testing, a catch-all lets you receive mail at any address without creating individual accounts
Setting Up a Catch-All in cPanel
- Log into cPanel and navigate to Email > Default Address (or Catch-All)
- Select your domain from the dropdown
- Choose how to handle unrouted messages:
- Forward to Email Address — Delivers catch-all messages to a specific mailbox (most common)
- Discard with error to sender (at SMTP time) — Bounces the message with an error. This is the default and recommended setting if you do not need a catch-all.
- Pipe to a Program — Passes the message to a script for custom processing
- Click Change to save your settings
Catch-All Best Practices
Warning: Catch-all addresses attract significant spam. Spammers routinely send messages to random addresses at known domains (dictionary attacks), and a catch-all captures all of these. This can fill your mailbox with junk and potentially cause storage issues.
To mitigate spam when using a catch-all:
- Forward catch-all messages to a dedicated monitoring mailbox, not your primary inbox
- Set up email filters (covered below) to automatically discard obvious spam from the catch-all
- Regularly review the catch-all mailbox and create proper email accounts for addresses that receive legitimate mail
- Consider using catch-all temporarily to discover which addresses people use, then disable it and create specific accounts or forwarders for those addresses
- Monitor your email storage usage to prevent the catch-all from consuming your disk allocation
Understanding Email Filters in cPanel
cPanel provides two levels of email filtering:
1. Account-Level Filters (User Filters)
These filters apply to a specific email account. Each email account can have its own set of filters that process incoming messages in order. Access these through Email > Email Filters.
2. Global Filters
These filters apply to all email accounts on your cPanel account, processing messages before account-level filters. Access these through Email > Global Email Filters. Global filters are useful for domain-wide rules, like blocking messages from known spam domains.
Creating Email Filters: Step by Step
Step 1: Access the Filter Interface
Navigate to Email > Email Filters. Select the email account you want to create filters for and click Manage Filters.
Step 2: Create a New Filter
Click Create a New Filter. You will see three sections:
- Filter Name — Give your filter a descriptive name (e.g., "Sort invoices to billing folder")
- Rules — Define the conditions that trigger the filter
- Actions — Define what happens when the conditions are met
Step 3: Define Rules
Each rule consists of three parts: a header field, a comparison operator, and a value.
Header fields you can filter on:
From— The sender's email addressSubject— The message subject lineTo— The recipient addressReply-To— The reply-to addressBody— The message body contentAny Header— Match against any email headerHas Not Been Previously Delivered— Only match if this is the first delivery attemptIs an Error Message— Match bounce notificationsList-Id— Match mailing list identifiersSpam Status— Filter based on SpamAssassin resultsSpam Bar— Filter by SpamAssassin score level
Comparison operators include: equals, matches regex, contains, does not contain, begins with, ends with, does not begin with, does not end with, does not match, is above (for numeric), is not above, is below, is not below.
You can add multiple rules and specify whether all rules must match (AND logic) or any rule can match (OR logic).
Step 4: Define Actions
Available actions when rules match:
| Action | Description |
|---|---|
| Discard Message | Silently delete the message (no bounce to sender) |
| Redirect to Email | Forward the message to another address |
| Fail with Message | Bounce the message with a custom error |
| Stop Processing Rules | Prevent subsequent filters from acting on this message |
| Deliver to Folder | Move the message to a specific IMAP folder |
| Pipe to a Program | Pass the message to a script for processing |
Practical Filter Examples
Example 1: Sort Invoices into a Billing Folder
Filter name: "Sort invoices"
- Rule: Subject — contains — "invoice"
- Action: Deliver to folder — .Billing
Example 2: Forward Messages from a Specific Client
Filter name: "Forward VIP client"
- Rule: From — contains — "@importantclient.com"
- Action: Redirect to email — manager@yourdomain.com
Example 3: Auto-Delete Specific Spam Patterns
Filter name: "Block known spam"
- Rule 1: Subject — contains — "You have won"
- Rule 2: Subject — contains — "Act now" (set to match ANY rule)
- Action: Discard Message
Example 4: Filter Mailing List Messages
Filter name: "Mailing list folder"
- Rule: List-Id — contains — "devops-weekly"
- Action: Deliver to folder — .Newsletters
Example 5: High Spam Score Auto-Delete
Filter name: "Delete high spam"
- Rule: Spam Bar — contains — "+++++" (5 or more pluses)
- Action: Discard Message
Combining Filters with Forwarding and Autoresponders
Email filters work in combination with forwarders and autoresponders to create powerful email automation. The processing order is:
- Global email filters process first
- Account-level email filters process second
- Forwarders execute
- Autoresponders trigger
This means you can use filters to prevent certain messages from being forwarded or triggering autoresponders. For example, create a filter that discards messages from mailing lists before they reach the autoresponder — preventing your vacation message from replying to every list email.
Advanced Filtering with Apache SpamAssassin
cPanel includes Apache SpamAssassin, which scores every incoming message based on hundreds of rules. Each message receives a numeric spam score — the higher the score, the more likely it is spam. You can enable SpamAssassin in Email > Spam Filters and set a threshold score (default is 5.0).
Once SpamAssassin is enabled, you can use the Spam Status and Spam Bar header fields in email filters for more granular control than SpamAssassin's default behavior provides. For example, you might let SpamAssassin tag messages with a score of 5+ as spam (delivered to spam folder) but use a filter to silently discard messages with a score of 10+ (almost certainly junk).
Filter Management Tips
- Order matters — Filters process in the order they appear. Use the up/down arrows to reorder them. Put your most important filters (like discarding known spam) at the top.
- Use "Stop Processing Rules" — When a filter matches and you do not want subsequent filters to also act on the message, add "Stop Processing Rules" as an additional action.
- Test before going live — Create the filter and monitor its behavior for a few days before relying on it for automated actions like deletion or forwarding.
- Document your filters — Use descriptive filter names. When you have 20+ filters, you will thank yourself for clear naming.
- Periodic review — Review your filters quarterly to remove outdated rules and add new ones as your email patterns change.
Properly configured email filters, combined with catch-all addresses and DNS authentication, give you enterprise-grade email management on MassiveGRID's high-availability cPanel hosting. For a foundational overview of email management in cPanel, see our cPanel email accounts setup guide.
Frequently Asked Questions
What is the difference between account-level and global email filters?
Global filters apply to all email accounts on your cPanel hosting and process before account-level filters. Account-level filters apply only to a specific email account. Use global filters for domain-wide rules (like blocking spam from a specific domain) and account-level filters for individual mailbox organization (like sorting messages into folders).
Can I use regular expressions (regex) in email filters?
Yes. cPanel email filters support the "matches regex" comparison operator, which lets you use regular expressions for complex pattern matching. For example, you can match email addresses from multiple subdomains of the same company or match subject lines that follow a specific pattern. Regex filters are powerful but can be tricky to debug — test them carefully.
Will a catch-all address increase the spam I receive?
Yes, significantly. Spammers regularly send messages to random addresses at known domains, and a catch-all captures all of these. If you enable a catch-all, pair it with email filters to automatically discard obvious spam, and forward the remaining messages to a dedicated monitoring mailbox rather than your primary inbox.
How many email filters can I create per account?
cPanel does not impose a hard limit on the number of filters per account. However, each filter adds processing time to incoming messages. For most business use cases, 20–50 filters per account is practical without noticeable performance impact. If you need hundreds of rules, consider using SpamAssassin's custom rules or server-side Sieve scripts for better performance.
Can I export or import email filters between cPanel accounts?
cPanel does not provide a built-in export/import feature for email filters. However, filters are stored as Exim filter rules or Sieve scripts in your account's home directory. An experienced administrator can copy these files between accounts. If you are migrating to a new cPanel host, a full cPanel backup and restore will preserve your email filters along with everything else.