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 a particular 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 "domain.com" > /etc/blockeddomains
or, if the file existing, then:
echo "domain.com" >> /etc/blockeddomains
3. Check with "cat" command:
cat /etc/blockeddomains
domain.com
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 click on "Add additional configuration settings" and fill with data s below:
domainlist blocked_domains = lsearch;/etc/blockeddomains
8. Search for the string "ROUTERSTART"
9. Add the following into it:
reject_domains:
driver = redirect
domains = +blocked_domains
allow_fail
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.