Search Our Database

How to filter incoming emails by country in WHM

Last updated on |

Introduction

In today’s email environment, filtering unwanted or suspicious messages is essential for maintaining server security and preventing spam. One effective method is to filter incoming emails based on the sender’s geographic origin. WHM (Web Host Manager), combined with Exim configuration and geolocation tools like GeoIP, allows administrators to create country-based email filtering rules. This guide walks you through the process of setting up such a filter in WHM to block or redirect emails coming from specific countries.

 

Prerequisites

  • Root access to WHM
  • cPanel/WHM version is 86 or newer
  • Exim mail server enabled

 

Step-by-step guide

Step 1 : Login to WHM

  • First you need to login to WHM with root access

 

Step 2 : Navigate to filter incoming emails by country

  • As you land on the WHM homepage, use the search bar on the top right to search for How to filter incoming emails by country.

  • Click on How to filter incoming emails by country.

 

Step 3 : Filter the countries

  • Once you navigated to the page, you will be greeted with list of countries. You may select one or multiple countries and choose whether to block or allow the selected countries, depending on your desired setup.

  • Alternatively, you can use the slider on the right side to allow or block IP address originated from the countries.

 

Conclusion

Filtering incoming emails by country is an effective way to reduce spam and restrict unwanted messages from specific regions. With WHM and Exim’s advanced configuration capabilities, you can implement country-based filtering using the built-in GeoIP support provided in most cPanel installations. While manual GeoIP setup is typically unnecessary in recent versions, it’s important to test and monitor your filters to avoid blocking legitimate mail. Always review Exim logs after making changes to ensure that your filters are working as intended and not disrupting normal email delivery.

Should you have any technical inquiries, feel free to contact us at support@ipserverone.com