How to Disable a Domain From Sending Email

You can easily disable inbound email for a single domain simply by switching off the MX records and/or removing the domain from /etc/localdomains.  However, disabling a domain from sending email off of your server is slightly more complicated.  Even if you manage to disable the domain of an account from sending out, you still have to deal with the fact that the cPanel user itself can send email.  This user has the address of user@serverhostname, and is the default sender for scripts that utilize sendmail.  In other words, any PHP or Perl script that sends email off of your server without using proper SMTP authentication will send mail as the cPanel user.

Disable Email from Specific Domains

First, create a file called /etc/blockedsenderdomains, and add the list of domains to block email from to this file, one line at a time.
Then go into WHM > Exim Configuration Manager > Advanced Editor, and add the following to “Section: CONFIG” part:

domainlist blocked_domains = lsearch;/etc/blockedsenderdomains

In the ROUTERSTART section, add:

 driver = redirect
 domains = +blocked_domains
 data = :fail: Connection rejected: SPAM source $domain is manually blacklisted.

Then save the file.