How to Create Email Filters for One Account in cPanel

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

  1. In cPanel, go to Email > Email Filters.
  2. Find the email account and click Manage Filters.
  3. Click Create a New Filter.
  4. Enter a Filter Name you'll recognize, for example Newsletters to Reading folder.
  5. 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.
  6. To add more conditions, click + beside the rule and choose and (all must match) or or (any can match).
  7. Choose one or more Actions (explained below). For Deliver to Folder, click Browse and pick the folder.
  8. Click Create.

The filter works on new mail straight away. It doesn't sort messages already in the mailbox.

What each action does

ActionResult
Deliver to FolderPuts the message into the folder you choose instead of the Inbox.
Redirect to EmailSends 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 MessageDeletes the message. It can't be recovered.
Fail with MessageBounces the message back to the sender with your text. Don't use it for spam, because spam senders are usually forged.
Stop Processing RulesSkips any filters listed below this one.
Pipe to a ProgramPasses 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 Folder Clients.
  • File website form messages: Subject begins with New contact form -- Deliver to Folder Website.
  • 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

  1. On the Manage Filters page for the account, find the Filter Test box.
  2. Type or paste a sample message, starting with headers:
    From: someone@clientcompany.com
    To: you@example.com
    Subject: Project update
    
    Hello.
  3. 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

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 email filters, email filter rules, sort email into folders, filter email by subject, cpanel manage filters, email rules one mailbox
  • 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...