Block Outgoing Emails of a Domain in cPanel
This tutorial will help you to block outgoing emails of a domain in cPanel server.You can use two methods to block the outgoing email of an account. Please see the two methods below:
Initially, we need to create a list of domains to block the outgoing emails in the server.
Add the domain names which you would like to block the outgoing email traffic one in a row.
Correct the permissions and ownership of the mentioned file.
chown root.mail /etc/blockeddomains chmod 640 /etc/blockeddomains
Then go into WHM > Service Configuration > Exim Configuration Manager > Advanced Editor
Find “Add additional configuration setting” button and click on it. A new box will appear above the button and add the following in it.
domainlist blocked_domains = lsearch;/etc/blockeddomains
Then, search for “Section: ROUTERSTART” and add the following:
reject_domains: driver = redirect domains = +blocked_domains allow_fail data = :fail: Connection rejected: SPAM source $domain is manually blacklisted.
Then save the configuration.
You can Block domains from sending email in cPanel server using WHM API Functions too. Please run the following command:
whmapi1 suspend_outgoing_email user=example
Replace “example” with the desired desired username. cPanel introduced this functionality in cPanel version 188.8.131.52.
Also, you can unsuspend the email fuctionality using the following command:
whmapi1 unsuspend_outgoing_email user=example
You can also hold the outgoing emails using the following command:
whmapi1 hold_outgoing_email user=example
To release outgoing emails:
whmapi1 release_outgoing_email user=example
Please note that the method 2 only works on cPanel versions higher than 184.108.40.206.
If you like this post and wish to receive more articles from us, please like our FB page: Grepitout
Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.
For more details on our services, please drop us an E-mail at firstname.lastname@example.org