On Instant Access Internet Services hosting, email filters in cPanel sort incoming mail automatically for one mailbox. You can move messages into folders, send them to another address or delete them, based on who sent them, the subject or other details. Because the filter runs on the server, it works on every device -- phone, computer and webmail -- even when they're all turned off.
This guide covers filters for a single email account. To apply a rule to every mailbox on your domain, see How to Create Global Email Filters in cPanel.
How to create an email filter
- In cPanel, go to Email > Email Filters.
- Find the email account and click Manage Filters.
- Click Create a New Filter.
- Enter a Filter Name you'll recognize, for example
Newsletters to Reading folder. - Build the rule under Rules:
- First drop-down: what to check, such as From, Subject, To, Reply Address, Body or Any Header.
- Second drop-down: how to compare, such as contains, does not contain, equals, begins with, ends with or matches regex.
- Text box: the word, phrase or address to look for.
- To add more conditions, click + beside the rule and choose and (all must match) or or (any can match).
- Choose one or more Actions (explained below). For Deliver to Folder, click Browse and pick the folder.
- Click Create.
The filter works on new mail straight away. It doesn't sort messages already in the mailbox.
What each action does
| Action | Result |
|---|---|
| Deliver to Folder | Puts the message into the folder you choose instead of the Inbox. |
| Redirect to Email | Sends the message to another address instead of this mailbox. Add a second action of Deliver to Folder > INBOX if you also want to keep a copy here. |
| Discard Message | Deletes the message. It can't be recovered. |
| Fail with Message | Bounces the message back to the sender with your text. Don't use it for spam, because spam senders are usually forged. |
| Stop Processing Rules | Skips any filters listed below this one. |
| Pipe to a Program | Passes the message to a script (for developers). |
Examples you can copy
- Sort mail from a client into its own folder: From contains
@clientcompany.com-- Deliver to FolderClients. - File website form messages: Subject begins with
New contact form-- Deliver to FolderWebsite. - Delete mail from one sender: From equals
offers@example.net-- Discard Message. There is a full guide in How to Block an Email Sender with a Filter.
Create the folder first if it doesn't exist yet. The easiest place is Roundcube webmail: go to Settings > Folders and click Create (see How to Log In to Webmail (Roundcube)).
How to test a filter
- On the Manage Filters page for the account, find the Filter Test box.
- Type or paste a sample message, starting with headers:
From: someone@clientcompany.com To: you@example.com Subject: Project update Hello.
- Click Test Filter. The Filter Trace Results show which rule matched and where the message would go.
Nothing is actually delivered during the test, so it's safe to try.
How to change the order, edit or delete filters
- Filters run from the top of the Current Filters list down. New filters are added at the bottom. Drag a filter to move it.
- Click Edit next to a filter to change it, then save.
- Click Delete and confirm with Delete Filter to remove it.
Troubleshooting
My filter doesn't catch anything
Check that you used or, not and, when listing alternatives, and that the text matches what's actually in the message. Copy a real message's headers into Filter Test -- in Roundcube, open the message and choose More > View source to see them. Keep in mind that the To field may show a mailing list address rather than yours, and that filters can't check the BCC field.
Messages went into a folder I can't see on my phone
Your mail app may hide folders it isn't subscribed to. In Roundcube, go to Settings > Folders and make sure the folder is subscribed. On the phone, refresh the folder list or remove and re-add the account.
Should I use cPanel filters or rules in Outlook?
Rules in Outlook or Apple Mail only run while that app is open, and only on that computer. cPanel filters run on the server for every device. For anything important, use cPanel.
Related guides
- How to Create Global Email Filters in cPanel
- How to Block an Email Sender with a Filter
- Why Your Emails Go to Spam (and How to Fix It)
- How to Log In to Webmail (Roundcube)
Still stuck? Open a support ticket and the Instant Access Internet Services team will help.
