Block Account from Sending Mail in WHM/cPanel


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.


Was this answer helpful?

Still need help?

Our friendly support team are ready to offer assistance with any issues you may be encountering.
Click the button below to open a ticket:
Open Ticket

 WordPress Hosting

Fast hosting for WordPress
Experience the best in Australian WordPress hosting with lightning fast servers, built-in caching, and performance tools.

 Build Your Website

Sitejet Hosting
Build your site fast with a drag and drop editor with no coding required. 140+ quality, templates to get you started.

 Register Domains

It all starts with your domain name
Find the perfect domain and register now with our competitive pricing on all extensions.

 Web Hosting

Fast, local, secure hosting
Full featured hosting on cPanel with multiple server locations around the country.
« Back