How to Create Global Email Filters in cPanel

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

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

  1. In cPanel, go to Email > Global Email Filters.
  2. Click Create a New Filter.
  3. Type a clear name in Filter Name, for example Block example.net or Copy invoices to bookkeeper.
  4. 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.
  5. To add another condition, click + next to the rule and choose and (both must match) or or (either can match).
  6. Under Actions, choose what should happen to matching messages. Click + next to an action to add a second one.
  7. 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

ActionWhat it does
Discard MessageDeletes the message before delivery. It can't be recovered, so use with care.
Redirect to EmailSends the message to another address you enter, instead of the original mailbox.
Fail with MessageRejects 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 RulesStops any filters below this one from running on the message.
Deliver to FolderPuts 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 ProgramSends 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

  1. On the Global Email Filters page, find the Filter Test box.
  2. Paste a sample message header and body, for example:
    From: someone@example.net
    To: info@example.com
    Subject: Invoice 1234
    
    Test message.
  3. 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

Still stuck? Open a support ticket and the Instant Access Internet Services team will help.

Ultrafast LiteSpeed hosting from InstantAccess.net: free SSL, free backups, cPanel included, no contracts. Check out our $10/month hosting.
  • cpanel global email filters, filter all email accounts, domain wide email filter, global filter cpanel, email rules all mailboxes, block email for whole domain
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Why Is My Email Slow? Causes of Delayed Email and How to Fix Them

Most email arrives within a minute or two, so when a message takes ten minutes, an hour or half a...

What Mailing List Service Should I Use? Our Recommendation and the Alternatives

A mailing list is simply a list of people who have asked to hear from you -- customers, members,...

How to fix blocked email.

How to fix an email deliverability issue due to RBL false-positive with Comcast or some other...

How to Free Up Mailbox Space with Email Disk Usage

When a mailbox gets close to its storage limit, cPanel's Email Disk Usage tool is the quickest...

How to Fix "Mailbox Full" Errors

If people tell you their messages bounced with "mailbox full" or "quota exceeded", your mailbox...