In some cases, you might want to block all emails from a specific domain to your server.
Procedure: through WHM
One way to accomplish this through WHM is by using the Filter Incoming Emails by Domain interface. Simply add the domain you would like to block into the input box and click the Save button.
The screenshot below shows that every email from domain.com will be blocked:
You can reference additional information regarding this from our docs: Filter Incoming Emails by Domain.
Procedure: over the command line
If you prefer to update this list over the command line, you can use the following API call to add a domain to the block list:
whmapi1 block_incoming_email_from_domain domain=example1.com
And to add several domains to the block list, you can run the command below:
whmapi1 block_incoming_email_from_domain domain=example1.com domain=example2.com domain=example3.com
Additional information regarding the API call may be found here: WHM API 1 Functions - block_incoming_email_from_domain.