How to Filter Emails for an IP Range Updated on June 12, 2023 by Christopher Maiorana 0 Minutes, 59 Seconds to Read If you need to filter or block multiple IP addresses, it can sometimes be much quicker and more efficient to block an IP range. In this article, we will show you how you can block an entire range of IPs from sending mail to your email addresses using cPanel and regular expressions. What is an IP range? An IP range is exactly that. It is simply a group of IP addresses between one address and another. For example, many consumer routers will assign IP addresses between 192.168.1.101 and 192.168.1.150. The group of IP addresses between, and including these two addresses, would be an IP range. Log into cPanel Under Email choose Email Filters For the example email account choose Manage Filters Click Create a New Filter Fill in the dropdown fields. For the From field, choose Any header. For the second dropdown, choose Matches regex Here you will add your rule, which will look similar to this: ^192\.168\.1\.[0-9]{1,3}$ Choose an action for this filter. (You will most likely want to Discard the message, but you can also filter it to a folder.) Click Create Well done on completion of this tutorial. You now know how to filter an IP range. Share this Article CM Christopher Maiorana Content Writer II Christopher Maiorana joined the InMotion community team in 2015 and regularly dispenses tips and tricks in the Support Center, Community Q&A, and the InMotion Hosting Blog. More Articles by Christopher Related Articles How to Import Email Accounts and Forwarders into cPanel How to Configure Mailbox Quota Notifications How to Login to SquirrelMail SpamAssassin: Fighting Spam How to Fix the “550 No Such User Here” Email Error How to Setup an Email AutoResponder in cPanel Logging into Horde How to Change an Email Password in cPanel and Webmail How to Purchase InMotion Hosting Professional Email in AMP What is MailChannels and How it Benefits You
Hello John, Sorry to hear about your troubles with this guide. What specific issues are you having? The cPanel email log is a good way to track an email once it gets to your server. Any incoming or outgoing transmission will be marked by username (email address), action (such as accepted by recipient server), and include a specific timestamp. If you are using a CMS such as WordPress, a plugin or addon can be used to view your Mail logs. For example, you can use WP Mail logging in WordPress. Our live support team will be happy to help you review the email log if you are trying to narrow down an email location or issue. Thank you, John-Paul
If you have issues, I recommend checking your mail log for troubleshooting. You can also contact our Live Support directly.