How to disable email service for particular domain in cPanel

If you are a server admin that uses cPanel, you may find that there isn’t a way to disable the email service for particular domain in cPanel and this might causes you problem if your users are hosting their email in other servers.

To solve this problem, you can remove the ability from Cpanel that allows the domain to send email directly. All you need to do is to edit the the localdomains and remotedomains file. In the localdomains, it includes every domain that has been setup in cpanel. What you need to do is access to that file and remove the domain entry from it. And to do so, you will have to access to the server shell and perform this. The commands are as below:-

# nano /etc/localdomains

You should see a list similar to the below:


For example, you would like to disable the email functions for, just remove and save the file.

Then, proceed to edit the remotedomains file:

# nano /etc/remotedomains

Then you will have to add the domain you removed from the localdomain to here for example Save the file and restart the mail services.

That’s it. Now the domain should not be able to send and receive from your cPanel server.