How to Block an Email Sender with a Filter

If someone keeps sending you unwanted email, you can block the sender from your Instant Access Internet Services cPanel with an email filter. This guide shows you how to block an email address or a whole domain, either for a single mailbox or for every mailbox on your domain.

Choose where to block the sender

  • One mailbox only -- use Email Filters. Only that account is affected.
  • Every mailbox on your domain -- use Global Email Filters. Good for a spammer or a pushy salesperson who writes to everyone at your company.

The steps are almost the same for both.

How to block an email address

  1. In cPanel, go to Email > Email Filters and click Manage Filters next to the mailbox. (For all mailboxes, go to Email > Global Email Filters instead.)
  2. Click Create a New Filter.
  3. In Filter Name, type something you'll recognize later, for example Block spammer@example.net.
  4. Under Rules, set the first drop-down to From, the second to contains, and type the sender's address in the box, for example spammer@example.net.
  5. Under Actions, choose what should happen (see the next section). For most people, Deliver to Folder and the Junk folder is the safest choice. To delete the messages instead, choose Discard Message.
  6. Click Create.

The filter works on new messages from that moment on. Messages already in your inbox aren't touched.

How to block a whole domain

Follow the same steps, but in the rule box type just the domain with the @ sign in front, for example @example.net. With contains, this matches every address at that domain.

To block several senders in one filter, click the + button next to the rule to add another line, and set the joining drop-down to or. If you leave it on and, a message would have to match every line at once, so the filter would never trigger. Keeping one simple filter per sender is also fine and easier to manage.

Which action should you pick?

ActionWhat happensWhen to use it
Deliver to FolderThe message is quietly moved to a folder you choose (click Browse to pick one, such as Junk).Best choice for most people. Nothing is lost if you blocked the wrong sender by mistake.
Discard MessageThe message is deleted before it reaches the mailbox. The sender isn't told.When you are sure you never want to see these messages. They can't be recovered.
Fail with MessageThe message is rejected and a bounce with your text is sent back.Rarely. Spammers usually fake the sender address, so the bounce goes to an innocent person. Avoid this for spam.

Test the filter

For a per-mailbox filter, go back to the Manage Filters page and use the Filter Test box. Paste a sample header such as:

From: spammer@example.net
To: you@example.com
Subject: Test

Click Test Filter. The results show whether your filter matched and which action it would take. Global Email Filters have the same test box.

How to unblock a sender

Go back to Email Filters (or Global Email Filters), find the filter and click Delete, then confirm with Delete Filter. To change the address instead, click Edit, make your change and save.

Common questions

The spam comes from a different address every time

Blocking by address won't help if the sender keeps changing. Block by a word that is always in the subject instead (Subject + contains), or see Why Your Emails Go to Spam (and How to Fix It) for broader spam advice.

Can I block by IP address?

Not from cPanel on standard plans -- and most senders change IP addresses often anyway. Use a filter as shown above. If you're under a flood of junk mail, open a ticket and we'll take a look.

Is there a block option in webmail?

Marking a message as junk in Roundcube or your mail app helps that app learn, but it doesn't stop the message reaching the server. A cPanel filter stops it for every device at once.

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.
  • block email sender cpanel, block email address, block domain email, stop unwanted email, cpanel email filter block, blacklist sender cpanel
  • 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...