Tayyem

Member
Oct 28, 2017
6
2
3
Jordan
cPanel Access Level
Root Administrator
Hello

I have tried to disable PHP mail from my server because there are some websites that abuse it
,but with no luck because the scripts are using their own libraries , Most of today's CMS have created their own libraries for sending emails so mentioning ( sendmail , mail ) functions will not help.

I'm searching for a solution that its not in cPanel forum, mentioning any documentation link will also not help especially "How to Prevent Email Abuse" because I have tried them all.

Thank you
 

24x7server

Well-Known Member
Apr 17, 2013
1,896
91
78
India
cPanel Access Level
Root Administrator
Hi,

If you are using suPHP, then you can restrict the users from using their custom php.ini and force them to use your one in which you added the mail in the disable functions list..
What version of EasyApache do you currently have on the server?
 

Tayyem

Member
Oct 28, 2017
6
2
3
Jordan
cPanel Access Level
Root Administrator
Thanks for the replay
I'm using EasyApache 4 but you didn't get the point my friend , no need for the abusers to edit php.ini because they are not using the main php mail functions they are using their own mailers that connects to the smtp port and send mails without touching php mail functions
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,241
363
no need for the abusers to edit php.ini because they are not using the main php mail functions they are using their own mailers that connects to the smtp port and send mails without touching php mail functions
Hello,

The following option is useful if the scripts are attempting to send mail via SMTP via a remote mail server:

"WHM Home » Security Center » SMTP Restrictions"

As for local SMTP senders, have you considered setting up email sending limits? We document how to do this at:

How to Set Email Send Limits - cPanel Knowledge Base - cPanel Documentation

Additionally, in cPanel version 68, we added a new notification in "WHM >> Contact Manager" that you can configure to alert you if an email account is abusing the system:

  • Maximum Hourly Emails Exceeded A domain exceeded the threshold for the maximum number of sent emails in an hour.
Thank you.
 

Tayyem

Member
Oct 28, 2017
6
2
3
Jordan
cPanel Access Level
Root Administrator
Hello,

The following option is useful if the scripts are attempting to send mail via SMTP via a remote mail server:

"WHM Home » Security Center » SMTP Restrictions"

As for local SMTP senders, have you consider setting up email sending limits? We document how to do this at:

How to Set Email Send Limits - cPanel Knowledge Base - cPanel Documentation

Additionally, in cPanel version 68, we added a new notification in "WHM >> Contact Manager" that you can configure to alert you if an email account is abusing the system:



Thank you.
Thank you I did that but I cannot set it to zero , only one email per hour. Can I set that to zero without being unlimited
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,241
363
Thank you I did that but I cannot set it to zero , only one email per hour. Can I set that to zero without being unlimited
You can't set the max hourly email limit to zero. Note the maximum hourly email limit applies to all email, not just email from PHP scripts. Is your goal to disable email completely for an account, even outside of PHP?

Thank you.
 

Tayyem

Member
Oct 28, 2017
6
2
3
Jordan
cPanel Access Level
Root Administrator
You can't set the max hourly email limit to zero. Note the maximum hourly email limit applies to all email, not just email from PHP scripts. Is your goal to disable email completely for an account, even outside of PHP?

Thank you.
Yes because it’s sending emails from months and I cannot stop it, I have disabled the php mail and send mail functions but it’s still sending, I have tried most of things here in the fourm and nothing worked.
 

Tayyem

Member
Oct 28, 2017
6
2
3
Jordan
cPanel Access Level
Root Administrator
Hello,

You can use the following WHM API 1 function to suspend outgoing email for an account:

WHM API 1 Functions - suspend_outgoing_email - Software Development Kit - cPanel Documentation

Thank you.
Amazing Its blocked now

I've done two thing's I don't know who was the effective

1- enabled ModSecurity and COMODO and OWASP vendors
2- blocked the domains using suspend_outgoing_email

Thank you very much Michael for your big support in the forum and for helping us, hope you have a good day.
 
  • Like
Reactions: cPanelMichael