Blocking an account from sending mail in WHM
By Mr.Seiko on Oct 14, 2016 | In Uncategorized
I had a customer today that wanted to block an account from being able to send email because they were dealing with a hacked website that was spamming.
There is no specific feature in WHM/cPanel to just block a complete domain from being able to send mail, so I used the following process:
Created a new file called blockeddomains with the domain that I wanted to block
echo "domain.com" > /etc/blockeddomains
Now setting the proper permissions / ownership for the file:
chown root.mail /etc/blockeddomains && chmod 640 /etc/blockeddomains
Now I have to tell EXIM to look at this file, and use it to deny email from the domains listed in it.
Open WHM, and Browse to WHM >> Service Configuration >> EXIM Configuration Manager >> Advanced Editor
Scroll down to the Add additional configuration setting button, and click on it, and add the following:
domainlist blocked_domains = lsearch;/etc/blockeddomains
Scroll down further to the ROUTERSTART section and add the following:
reject_domains:
driver = redirect
domains = +blocked_domains
allow_fail
data = :fail: SPAM Source rejected: $domain is manually blacklisted.
Now you can block/unblock any domains simply by editing the /etc/blockeddomains file.
No feedback yet
| « Locating Spammers | Making WordPress more secure » |