Search Our Database

How to filter incoming emails by domain in WHM

Last updated on |

Introduction

In a shared hosting environment or mail server managed via WHM (Web Host Manager), it’s often necessary to control incoming email traffic to protect your server from spam, phishing attempts, or unwanted messages from specific domains. One effective way to do this is by setting up domain-based email filtering rules. This guide will walk you through the steps to filter incoming emails by domain using WHM and cPanel tools, helping you maintain a clean and secure mail environment.

 

Prerequisites

  • Have root access or reseller-level access to WHM
  • Basic familiarity with WHM interface and email filtering rules

 

Step-by-step guide

Step 1 : Login to WHM

  • Login to WHM as root

 

Step 2 : Navigate to filter incoming email by domains

  • Use the search bar on the top right to search for filter incoming email by domains

  • Click on filter incoming email by domains

 

Step 3 : List domains to reject

  • You can list out domain(s) you want to block for incoming emails. If you want to block multiple domains, ensure to list out domains in separate lines

  • You can block all of the subdomains of a domain by using asterisk (*). For example, listing *.example.com will block all subdomains of example.com (e.g. sub1.example.com, sub2.example.com)

 

Conclusion

Filtering incoming emails by domain in WHM is a practical way to block unwanted or malicious emails before they reach user inboxes. By configuring Exim rules or using cPanel account-level filters, you gain precise control over your mail traffic. Regularly reviewing and updating these filters can enhance email security and reduce spam load on your server. Always test new rules carefully to avoid blocking legitimate messages inadvertently.

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