IP addresses are part of every email that is sent to you.  These addresses indicate the location from where the email has been sent.  They can be used to effectively block emails from coming from that address by making a simple filter within your Cpanel.  The following tutorial explains the email IP address, how to find it, and how to create the account filter used to block emails from hitting your email account.

Creating Account Filtering Rules to Block Emails by IP Address


Understanding and Finding the Email IP Address

Sample header from a spam emailAll emails that are delivered come with header information that includes the IP address of their originating server.  This information can be used to create a rule that blocks emails from arriving in your mailbox.  The header information of an email is not always apparent when you read your emails because it is often hidden from view.  You can view email headers by looking at the email source.  You can view the email source by using your email client (e.g. Outlook, Thunderbird, Apple Mail, etc.), or by simply saving the email to your desktop and then opening the resulting file with a text editor such as Notepad. 

 

When you are viewing the message source, you can determine the IP by simply looking "receive" and "from".  The IP addresses (also called IPv4 addresses) will be in this format:  xxx.xxx.xxx.xxx  (e.g. 256.256.256.256).  In the future, you may see addresses in a new format IPv6, but for now, emails are still using the older format.  For information on IPv6, go to Internet Protocol version 6.


Adding the Account-level Filter in Cpanel

The following steps explain how to add the account-level filter using the IP address information that you obtained from the email header:

  1. Login to the Cpanel.
  2. Account Level Filtering icon at rightScroll down to the Mail section and click on the icon labeled Account-Level Filtering.
     
  3. Create a New FilterClick on CREATE A NEW FILTER.
     
  4. Creating the new ruleName the filter something appropriate such as "Block Emails using IP addresses", then under the RULES section click on the drop-header next to the word FROM.  Select ANY HEADER from the list that appears.
  5. Click on the next drop-down arrow next to the word EQUALS and change it to CONTAINS in the drop-down list.
  6. Click in the blank white space immediately below the two drop-down menus.  Here you will be able to type in the IP address that you obtained from the email header.
     
  7. Scroll down to the ACTIONS section and leave it set to DISCARD MESSAGE.
  8. Click on CREATE to save the new account-level email filtering rule.

 

Using multiple rulesIf you wanted to add a range of IP addresses, you could do this in Step 6.  You can also add further conditions by simply clicking on the "+" sign to the right of the RULE.  Bear in mind though that you would need to make sure that the connecting article says "OR" in order for any ONE rule to apply to the email you're trying to block.  If you set it to "AND" (which can be selected as per the screenshot at right), then BOTH rules must be true before the ACTION (set to Discard Message) will take place. If you're unsure of how to use multiple rules, then keep it simple and leave it at one rule. 

 
This completes the tutorial for creating an account-level filter for blocking emails using an email address.  Remember that this is an ACCOUNT level filter and applies to all emails on the account and not to a specific USER.  If you want to create specific USER filters, then select USER-LEVEL FILTERING in the Mail section of your cPanel.
Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Did you find this article helpful?

Comments

n/a Points
2014-09-17 1:20 pm

How do you "write" the rule for "add a range of IP addresses"

Staff
2,055 Points
2014-09-17 1:32 pm
You can indeed do so using regular expressions. I have located a 3rd party blog post that describes adding IP address ranges using regular expressions.

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.