Questions? Feedback? powered by Olark live chat software
Author Avatar

Block Account from Sending Mail in WHM/cPanel

Written by: on 21 October 2014 10:47 AM 21 October 2014 10:47 AM

Block an account on WHM or cPanel to prevent spamming activity. Learn how to block an account from Sending Mail.

In case of SPAM suspecting or confirmed SPAM activity on aprticular cPanel account (domain in cPanel terms) one can do following actions:


The whole idea is to use "block domain" list which EXIM will take into account when processing the mail.


1. SSH to the server

2. Edit or created (if non existing) the file /etc/blockeddomains:

echo "" > /etc/blockeddomains

or, if the file existing, then:

echo "" >> /etc/blockeddomains


3. Check with "cat" command:

cat /etc/blockeddomains


4. Set the permissions and ownership:

chown root.mail /etc/blockeddomains

chmod 640 /etc/blockeddomains


5. Now logon to WHM, and go to WHM -> Service Configuration -> EXIM Configuration Manager -> Advanced Editor

6. Scroll down ~ 1/4 of the page and check if something similar to picture below is visible:



7. Click on "Add additional configuration settings" and fill with data s below:

domainlist blocked_domains = lsearch;/etc/blockeddomains


8. Search for the string "ROUTERSTART" as below:



9. Add the following into it:


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


10. And save.

11. Done.

12. In future you can just add unwanted domains to send from to the /etc/blockeddomains.


Article based on:

(1 vote(s))
Not helpful