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

Block Account from Sending Mail in WHM/cPanel

Written by: on 27 May 2016 04:12 PM 27 May 2016 04:12 PM

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 "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 check if something similar to picture below is visible:

exim_editor

 

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:

exim_editor2

 

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.

 

Article based on: http://www.linuxbrigade.com/block-account-sending-mail-whmcpanel/

(1 vote(s))
Helpful
Not helpful