Global email filters in cPanel let Instant Access Internet Services customers apply one set of rules to every email account on your domain. Use them when the same rule should cover the whole company -- for example, blocking a sender who writes to all your staff, or sending every invoice email to your bookkeeper.
Global filters vs account filters
- Global Email Filters check mail coming in to any address on your domain.
- Email Filters (account filters) check mail for one mailbox only. Each person's own rules belong here -- see How to Create Email Filters for One Account in cPanel.
Because a global filter affects everyone, a mistake can hide or delete mail for your whole business. Keep global filters simple, and test them before relying on them.
How to create a global email filter
- In cPanel, go to Email > Global Email Filters.
- Click Create a New Filter.
- Type a clear name in Filter Name, for example
Block example.netorCopy invoices to bookkeeper. - Under Rules, choose what to check (such as From, Subject, To or Body), how to compare it (such as contains, equals or begins with) and the text to look for.
- To add another condition, click + next to the rule and choose and (both must match) or or (either can match).
- Under Actions, choose what should happen to matching messages. Click + next to an action to add a second one.
- Click Create.
The filter takes effect immediately for new mail. It doesn't change messages that are already in anyone's mailbox.
Filter actions explained
| Action | What it does |
|---|---|
| Discard Message | Deletes the message before delivery. It can't be recovered, so use with care. |
| Redirect to Email | Sends the message to another address you enter, instead of the original mailbox. |
| Fail with Message | Rejects the message and bounces your text back to the sender. Don't use this for spam -- the "sender" is often a forged address. |
| Stop Processing Rules | Stops any filters below this one from running on the message. |
| Deliver to Folder | Puts the message in a folder. For global filters, choose the folder carefully -- per-mailbox folders are usually better handled with account filters. |
| Pipe to a Program | Sends the message to a script. For developers only. |
Useful global filter examples
Block a sender for everyone
Rule: From contains @example.net. Action: Discard Message. More detail in How to Block an Email Sender with a Filter.
Send certain mail to another person
Rule: Subject contains Invoice. Action: Redirect to Email with bookkeeper@example.com. Be aware that a redirect sends the message instead of delivering it to the original mailbox. If you want both people to get it, a forwarder is a better fit (see How to Create an Email Forwarder in cPanel), or use an account filter with a second action of Deliver to Folder > INBOX (see How to Create Email Filters for One Account in cPanel). Test with a real message to confirm the result is what you want.
Tell senders an old address is no longer used
Rule: To contains oldname@example.com. Action: Fail with Message, with text such as This address is no longer in use. Please write to info@example.com. This is one of the few good uses for Fail with Message, because the people writing to that address are real contacts.
How to test a global filter
- On the Global Email Filters page, find the Filter Test box.
- Paste a sample message header and body, for example:
From: someone@example.net To: info@example.com Subject: Invoice 1234 Test message.
- Click Test Filter. The Filter Trace Results show which filters matched and what they would do.
How to edit, reorder or delete a global filter
- Edit: click Edit next to the filter, make your changes and save.
- Delete: click Delete, then Delete Filter to confirm.
- Reorder: filters run from top to bottom. Drag a filter up or down the list to change the order. This matters when you use Stop Processing Rules.
Troubleshooting
A global filter isn't catching messages
Check the spelling in the rule and whether you used and when you meant or. Run the Filter Test with a copy of a real message header. You can see a message's full headers in Roundcube by opening it and choosing More > View source.
Mail has gone missing for everyone
A global filter with Discard Message may be matching too much -- for example, a rule of Body contains free would delete many normal emails. Delete or edit the filter at once. Use Email > Track Delivery to see what happened to recent messages (see How to Find a Missing Email with Track Delivery).
Can I set up a catch-all address with a filter?
No. The default (catch-all) address isn't included on standard plans. Create the specific addresses you need, or use forwarders (see How to Create an Email Forwarder in cPanel).
Related guides
- How to Create Email Filters for One Account in cPanel
- How to Block an Email Sender with a Filter
- How to Create an Email Forwarder in cPanel
- How to Find a Missing Email with Track Delivery
Still stuck? Open a support ticket and the Instant Access Internet Services team will help.
