Save 20% on all Cloud VPS plans — use code HAPPY20 at checkout
99.95% uptime SLA 24/7 support Since 2019 Tier IV · Noida
Client Area
BLOGVPS Hosting

How to create email filters in cPanel and Plesk, and what each filter can do

Creating email filters in cPanel and in Plesk step by step: account-level and user-level filters, the rules that work, forwarding and discarding, and the mistakes that lose mail.

By URLStart Engineering 3 min read
How to create email filters in cPanel and Plesk, and what each filter can do — URLStart blog cover
Fig. 01 — How to create email filters in cPanel and Plesk, and what each filter can do — URLStart blog cover
    TL;DR
  • cPanel has two filter levels: Global Email Filters for every mailbox on the account, and Email Filters per mailbox. Plesk has per-mailbox rules under Mail, the mailbox, Spam Filter and Auto-Reply, with Sieve rules on Linux.
  • A filter is a condition plus an action: match on From, Subject, Body or a header, then deliver to a folder, forward, discard or pipe to a script.
  • Test with a message to yourself before trusting a discard rule. A wrong discard rule throws away mail silently.
  • On a URLStart VPS with cPanel or Plesk the same screens apply; the panel is an add-on on any plan.

Email filters are the one mailbox feature people set up in a hurry and regret at leisure. A rule that files invoices into a folder is wonderful; a rule that discards anything with "invoice" in the subject is a bad month. This is how to create them in both panels we install, and the two habits that keep them safe.

What a filter is

Every filter is a condition and an action. The condition looks at the From address, the To address, the Subject, the body, or any header, and matches on contains, equals, begins with, or a regular expression. The action delivers the message to a folder, forwards it, discards it, or hands it to a script. Filters run in order, top to bottom, on each incoming message.

cPanel: two places to look

cPanel has filters at two levels. Global Email Filters apply to every mailbox on the cPanel account; use them for rules the whole domain shares, such as sending everything from a noisy monitoring address to a folder. Email Filters apply to one mailbox; use them for personal rules.

To create a per-mailbox filter:

  1. Log in to cPanel and open Email Filters under the Email section.
  2. Next to the mailbox, click Manage Filters, then Create a New Filter.
  3. Give it a name you will recognise in a year.
  4. Under Rules, pick the field (From, Subject, Body, Any Header, To) and the match (contains, matches regex, begins with). Add a second rule with "and" or "or" if you need it.
  5. Under Actions, choose Deliver to folder and pick the folder, or Redirect to email, or Discard Message. Add a second action if you want both to file and to forward.
  6. Activate, then use Filter Test on the same page: paste a sample message and see which filters fire.

Global filters are the same form, one level up, under Global Email Filters.

Plesk: per mailbox, and Sieve underneath

In Plesk, open Mail, click the mailbox, and use the Spam Filter tab for the junk threshold and the Auto-Reply tab for out-of-office replies. For true filters on a Linux server, Plesk uses Sieve through the webmail client: open Roundcube from the mailbox, go to Settings, Filters, and create a rule with the same condition-and-action shape. Plesk on Windows uses the mail server's own rules; ask us which mail server your Plesk runs if you are not sure.

Forwarding without conditions is simpler: Mail, the mailbox, Forwarding tab, add the address.

Rules that work

Send automated reports to a folder by matching the From address exactly. File client mail by matching the client's domain in the From field with "contains". Flag anything with "urgent" in the subject by delivering to a folder named Urgent, not by forwarding to your phone, which trains you to ignore it. Forward a shared mailbox to two colleagues by two Redirect actions on one filter.

Two habits

Never start with Discard. File the message to a folder called Review for a week. When the folder contains only what you expected, change the action to Discard.

Test with a real message. Send yourself an email that should match and one that should not. cPanel's Filter Test does this without sending; in Plesk, send the test messages.

Mistakes we see on support

A regex with an unescaped dot that matches far more than intended. A "contains" rule on Body that catches signatures. A discard rule that also catches bounce messages, so the sender never learns their mail failed. Two filters that both move the message, so it ends up in the second folder and nobody looks there. Keep the list short, name every rule, and review it when something goes missing.

Questions we get asked

Can I filter before the mail reaches the server? No; filters run on delivery. Spam scoring happens first, then your filters.

Do filters work with mail clients like Outlook? Yes. Server-side filters act before the client ever sees the message, which is the advantage over Outlook rules that only run when Outlook is open.

Can a filter forward to an external address? Yes, with Redirect in cPanel or Forwarding in Plesk. Check the destination accepts the forwarded mail; some providers reject forwarded spam.

Where do discarded messages go? Nowhere. That is why the Review-folder habit exists.

Is this the same on a VPS and on shared hosting? The same screens. On a URLStart VPS, cPanel or Plesk is an add-on and the mailboxes are yours alone.

Ready to deploy?

Root shell in about a minute. Talk to an engineer first if you'd rather size it together.

✓ 99.95% uptime SLA ✓ Cards · UPI · Net banking · PayPal · Crypto ✓ Cancel anytime