Prevent a cpanel user from sending email entirely?

M001

Member
Aug 30, 2011
16
0
51
cPanel Access Level
Root Administrator
Hi guys,

I just want to stop a certain user from being able to use my exim server. Is there something simple I can add to config file or set this in WHM?
 

M001

Member
Aug 30, 2011
16
0
51
cPanel Access Level
Root Administrator
Sorry, I'm confused. How would I do it via their username? The reason I don't want to do it via domain is because i'm trying to limit a user who constantly has insecure wordpress files and his account is sending spam from "[email protected]" instead of his own domain. I would not want to block emails for my domain by adding my.server.name.com to that file, right?
 

stdout

Well-Known Member
Apr 10, 2003
189
6
168
Nelspruit, Mpumalanga, South Africa
cPanel Access Level
Root Administrator
Changing the domain's MX is Not going to prevent the account from sending Email.
Are you aware of the new Mail-features available under WHM > Modify Account? Use that.

Maximum Hourly Email by Domain Relayed unlimited (default)
Maximum percentage of failed or deferred messages a domain may send per hour unlimited (default)
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,234
363
cPanel Access Level
DataCenter Provider
Twitter
Hello :)

You could disable all PHP mail on the server or for specific accounts by using the php.ini file. You can do this globally by adding "mail" to "disable_functions =" in /usr/local/lib/php.ini or for a single account using the path directive at the bottom of the php.ini file.

Code:
[PATH=/home/username/public_html]
disable_functions = mail
The following threads may also be useful:

Methods to increase security with suPHP
PHP mail sending emails not related to domain name

Thank you.