How to Filter Incoming Emails by Country and Domain in WHM

Fast VPS Server and Dedicated Server administrators allow filtering of incoming email from specified countries, regions, and domains in WebHost Manager (WHM) to improve email security.

This is an important parameter in terms of protection as it blocks malicious emails before reaching any other spam filters in cPanel or the end user’s email client.

In this document, you will see two separate functionalities in WHM for filtering incoming emails: by country and by domain. Here’s how it works:

Filtering by Country:

  1. Log in to WHM as the root user.
  2. In the left-hand menu, navigate Home > Email > Filter Incoming Emails by Country.
  3. You’ll see a table with a list of countries and regions. Each country has a toggle for “Allowed.”
  4. To block emails from a specific country: Disable the “Allowed” toggle next to that country.
  5. To allow emails from a specific country: Enable the “Allowed” toggle next to that country.
  6. To block or allow all countries: Use the “Select All” checkbox and then click “Block Selected” or “Allow Selected.”

 

 

Filtering by Domain:

  1. Log in to WHM as the root user.
  2. In the left-hand menu, navigate Home > Email > Filter Incoming Emails by Domain.
  3. Enter the domains you want to block in the “Blocked Domains” text box. Use one line per domain.
  4. To block subdomains: Use an asterisk (*) before the domain name (e.g., *[invalid URL removed]).
  5. To add international domains (IDNs): Check the “Show domains as ASCII (relevant for IDNs)” box.
  6. Click “Save” to apply the changes.

 

 

Additional tips:

  • Remember, these filter rules are applied before any other filters or settings on your system.
  • Use these filters with caution, as blocking legitimate emails can be inconvenient.
  • Consider whitelisting specific email addresses from blocked domains if needed.
  • For more advanced filtering options, you can use custom Exim filters.

Leave a Reply