Working solution to disallow emails per account on 11.42

iso99

Well-Known Member
Jan 5, 2011
112
7
68
cPanel Access Level
Root Administrator
Hello,

I need to disable sending emails from a single account. I'm using 11.42, is there a working solution for this?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello :)

There are no native features in cPanel/WHM that will disable the ability of an account to send email. You can find a useful response from one of our developers in the comments section of the following feature request that helps explain why it's not likely such a feature is implemented.

disable the default E-Mail address from sending out E-Mail | cPanel Feature Requests

While a bit dated, you may also find this forum post helpful:

Disable email sending for a single domain name

Thank you.
 

iso99

Well-Known Member
Jan 5, 2011
112
7
68
cPanel Access Level
Root Administrator
Hey Michael,

Thanks very much, it worked! However, PHP can still send emails via the blocked domains. How do I disable it with PHP scripts?
 

cPanelPeter

Senior Technical Analyst
Staff member
Sep 23, 2013
585
25
153
cPanel Access Level
Root Administrator
Hello,

Have you already enabled this option in Tweak Settings?

Prevent the user “nobody” from sending out mail to remote addresses (PHP and CGI scripts generally run as nobody if you are not using PHPSuexec and Suexec respectively.

If so, then that should prevent most scripts from sending emails. You should also review (if you haven't yet), the following:

How To Prevent Email Abuse.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hey Michael,

Thanks very much, it worked! However, PHP can still send emails via the blocked domains. How do I disable it with PHP scripts?
The option that Peter referenced is helpful is you are using a handler such as DSO. Otherwise, you would have to disable the PHP Mail function completely and require PHP scripts to use SMTP authentication. That type of change would be global, rather than targeted to particular domain names.

Thank you.