How to block outgoing emails of an account in cPanel

Outgoing Emails
Block Outgoing Emails

Block Outgoing Emails of a Domain in cPanel

This tutorial will help you to block outgoing emails of a domain in cPanel server.You can use two methods to block the outgoing email of an account. Please see the two methods below:

Method 1

Initially, we need to create a list of domains to block the outgoing emails in the server.

vim /etc/blockeddomains

Add the domain names which you would like to block the outgoing email traffic one in a row.

Correct the permissions and ownership of the mentioned file.

chown root.mail /etc/blockeddomains 
chmod 640 /etc/blockeddomains

Then go into WHM > Service Configuration > Exim Configuration Manager > Advanced Editor

Find “Add additional configuration setting” button and click on it. A new box will appear above the button and add the following in it.

domainlist blocked_domains = lsearch;/etc/blockeddomains

Block domains from sending email

Then, search for “Section: ROUTERSTART” and add the following:

driver = redirect
domains = +blocked_domains

Then save the configuration.

Method 2

You can Block domains from sending email in cPanel server using WHM API Functions too. Please run the following command:

whmapi1 suspend_outgoing_email user=example

Replace “example” with the desired desired username. cPanel introduced this functionality in cPanel version

Also, you can unsuspend the email fuctionality using the following command:

whmapi1 unsuspend_outgoing_email user=example

You can also hold the outgoing emails using the following command:

whmapi1 hold_outgoing_email user=example

To release outgoing emails:

whmapi1 release_outgoing_email user=example

Please note that the method 2 only works on cPanel versions higher than

That’s it!

Also Read: Block outgoing email of a domain in Plesk


