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
All 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:
- Login to the Cpanel.
- Scroll down to the Mail section and click on the icon labeled Account-Level Filtering.
- Click on CREATE A NEW FILTER.
- Name 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.
- Click on the next drop-down arrow next to the word EQUALS and change it to CONTAINS in the drop-down list.
- 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.
- Scroll down to the ACTIONS section and leave it set to DISCARD MESSAGE.
- Click on CREATE to save the new account-level email filtering rule.
If 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.