How to Filter Incoming Emails by Country and Domain in WHM

Managed VPS and Dedicated server hosting administrators can improve email security by blocking incoming email from specified countries, regions, and domains in Web Host Manager (WHM). This is a valuable feature for your defense in depth strategy as it can block malicious emails before reaching any other spam filters in cPanel or the end user’s desktop email client.

Below we cover how to:

Filter Incoming Emails by Country on WHM

To blacklist countries or regions from emailing your server:

This may also affect users emailing from a virtual private network (VPN).

  1. Log into WHM as root
  2. On the left, select Filter Incoming Emails by Country
  3. To block or allow a single country, select the toggle to the right

    Changes are saved immediately

  4. To block or allow multiple countries, select the select all check box at the top or check boxes beside multiple countries, then Block Selected or Allow Selected
  5. Select Allowed or Blocked at the top to review changes

Filter Incoming Emails by Domain on WHM

To blacklist domains from emailing your server:

  1. Log into WHM as root
  2. On the left, select Filter Incoming Emails by Domain
  3. Type domains to blacklist under Blocked Domains (1 per line)
  4. Include subdomains for domains to blacklist with an asterisk (*) (e.g. *.phishingsite.com)
  5. Select Show domains as ASCII (relevant for IDNs) to add international domain names (IDNs) if needed
  6. Save changes

Improve Email Filtering

After configuring these settings, set up filters for individual cPanel accounts and email accounts:

  • SpamExperts can be installed to filter emails from the 3rd party service
  • Spam Filters (formerly SpamAssassin) checks all emails that reach that cPanel account
  • Email Filters and Global Email Filters in cPanel help organize emails, making it easier it to identify suspicious email
  • Webmail and desktop email clients have filtering settings and plugins to aid filtering (e.g. Thunderbird junk settings)

Was this article helpful? Let us know!