Block Accounts from Sending Emails from cPanel/WHM Print

  • 0

cPanel provides a feature to block particular domains from sending emails from our server. We can see an option in Exim configuration on our cPanel server to block domains from sending emails. This can be done by adding those particular domains which we want to block from sending emails to “/etc/blockeddomains” configuration file. The following steps will describe how to Block accounts from sending emails from cPanel/WHM.

 

1) Login to the server as root via SSH.

 

2) First, you need to check the file “/etc/blockeddomains” is existing on the server. If it is not there, create one.

 

3) Add the particular domains in “/etc/blockeddomains” configuration file to block the email sending privilege.

For example: –

# echo “domain.com” > /etc/blockeddomains

Or Open with vi editor and enter the domain name there.

# vi /etc/blockeddomains

You can replace the domain.com with your domain which you want to add to block list.

 

4) After creating the configuration file you should set the correct ownership to the configuration file “/etc/blockeddomains”.

# chown root.mail /etc/blockeddomains

 

5) Make sure that the configuration file /etc/blockeddomains have the correct permission.

# chmod 640 /etc/blockeddomains

 

6) Now log into the WHM panel.

 

7) Go to ‘Service Configuration’ tab.

8) Choose the option “EXIM Configuration Manager.”

9) Click on Option “Advanced Editor”.

10) Search for “Add additional configuration setting” and add the following.

domainlist blocked_domains = lsearch;/etc/blockeddomains

 

11) Search for “ROUTERSTART” and add the following codes.

reject_domains:

driver = redirect

domains = +blocked_domains

allow_fail

data = :fail: Connection rejected: SPAM source $domain is manually blacklisted.

 

12) Click on ‘Save’ button to update the changes.

 

If you need any further help please do reach our support department.


Was this answer helpful?

« Back