Email filters act on messages as they arrive on the server, before any email app sees them. Use them to move newsletters into a folder, forward invoices to your accountant, or delete mail that matches a pattern. Because they run on the server, they work the same in webmail, Outlook and on your phone.
Before you start
- At least one email account. See create email accounts in cPanel.
- Decide the scope:
- Email Filters apply to one mailbox.
- Global Email Filters apply to every address on your cPanel account, including forwarders.
Create a filter for one mailbox
- Open cPanel → Email → Email Filters.
- Click Manage Filters next to the account, then Create a New Filter.
- Enter a Filter Name, for example
Invoices. - Under Rules, build the condition, e.g. Subject contains
invoice. Use the + button to add more rules joined with and or or. - Under Actions, choose what happens:
- Deliver to Folder: click Browse and pick an IMAP folder such as
INBOX.Invoices. - Redirect to Email: forward a copy to another address.
- Discard Message: delete silently.
- Fail with Message: bounce back to the sender with your text.
- Stop Processing Rules: no later filter runs.
- Pipe to a Program: send the message to a script (advanced).
- Deliver to Folder: click Browse and pick an IMAP folder such as
- Click Create.
Tip: Create the destination folder in webmail first. In Roundcube go to Settings → Folders. See use Roundcube webmail.
Useful rule ideas
| Goal | Rule | Action |
|---|---|---|
| Hide newsletters | Any Header contains List-Unsubscribe | Deliver to Folder INBOX.Newsletters |
| Delete obvious spam | Spam Score is greater than 8 | Discard Message |
| Copy invoices | From contains billing@supplier.com | Redirect to Email accountant address |
| Block a sender | From equals pest@example.net | Fail with Message |
For most spam, the Spam Filters tool is easier; use filters for edge cases.
Test the filter
Back on the Manage Filters page, scroll to Filter Test. Paste a sample message with headers, for example:
From: billing@supplier.com
Subject: Invoice 1024
Please find attached.Click Test Filter. cPanel shows which rule matched and what would happen, without touching real mail.
Global filters
Open cPanel → Email → Global Email Filters and click Create a New Filter. The form is the same, but the rule runs for all mail delivered to your account. Typical use: discard messages with a very high spam score for every mailbox. Global filters run before per-account filters.
Edit, reorder or delete
Each list shows Edit and Delete links. Drag filters by the handle to change their order; they run from top to bottom.
Troubleshooting
- Filter does nothing: rules are case sensitive in some fields; try matches regex with
(?i)invoice, and test with Filter Test. - Mail disappeared: a Discard rule matched more than expected. Use Track Delivery to see what happened.
- Folder not found: the folder must already exist and be written as
INBOX.Name.
