• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Disable php mail for spamer clients

Roland_R

New Pleskian
On my server I found a .png file that was really a PHP script causing spam. You may want to look into that. The alternative is that your remove 127.0.0.1 from the whitelist, but, this will stop your webmail from working server-wide from what I understand. I have looked into the same thing and that is what I seemed to run into.
 
Hi weelk, BoiseComputer and Roland_R,

the usage of sendmail can be denied serverwide with the settings at: "Home > Tools & Settings > Mail Server Settings" ( option: Allow scripts and users to use Sendmail )

Another solution could be to disable the PHP - function mail in the domain - specific PHP settings with the addition "disable_functions = mail" in the lower text - box at the very end of the domain or subdomain specific PHP settings. Be aware that PHP "safe mode" must be enabled in order to make this work properly and please make sure, that you lock the corresponding subscription, because otherwise the global definitions from your subscription plan will be synced and your domain specific configuration will be lost.
 
the usage of sendmail can be denied serverwide with the settings at: "Home > Tools & Settings > Mail Server Settings" ( option: Allow scripts and users to use Sendmail )
Hi, dissabling this, any script whatever it is won't be able to use php for sending mails?
specific PHP settings with the addition "disable_functions = mail" in the lower text
Also can you please tell me where do I need to introduce this? I am a bit lost
Thanks
 
Hi PedroN,

sendmail is configured in your php.ini (s) on your server. The configuration "disabled_functions = mail" will disabled this option. If you choose the way "Home > Tools & Settings > Mail Server Settings" ( option: Allow scripts and users to use Sendmail ) and disable this option by unchecking the box, Plesk will setup "disabled_functions = mail" at all php.ini (s), controlled over the found php - handlers on your server ( note: you are able to list and view/edit all php.ini (s) at Home > Tools & Settings > PHP Settings" over your Plesk Control Panel ).


The second option to disable sendmail ( which is rather recommended, because this will only be setup for a specific service plan, add-on plan, subscription, domain or subdomain ), is to modify the depending PHP settings. You are able to set unique PHP settings over your Plesk Control Panel:

For service plans: Home > Service Plans > YOUR SERVICE PLAN NAME" ( tab: PHP settings )

For domain/subdomain: Home > Subscriptions > YOUR SUBSCRIPTION NAME > Domain/Subdomain > PHP settings"

Pls. be informed about the following php.ini - schemata:

Server_wide_PHP-settings_schemata_001.gif

Each following configuration, will overwrite the previous configuration, while non-configured options are inherited from the previous one.​
 
Hi,

Thank you very much for helping me with this but I continue with some trouble
sendmail is configured in your php.ini (s) on your server. The configuration "disabled_functions = mail" will disabled this option. If you choose the way "Home > Tools & Settings > Mail Server Settings" ( option: Allow scripts and users to use Sendmail ) and disable this option by unchecking the box, Plesk will setup "disabled_functions = mail" at all php.ini (s), controlled over the found php - handlers on your server ( note: you are able to list and view/edit all php.ini (s) at Home > Tools & Settings > PHP Settings" over your Plesk Control Panel ).
I have unticked the box in mail server settings but once I go to php settings in tools & settings, I can not find anything like this: "disabled_functions = mail" taking into an account that I have unticked the box of using sendmail.

And the last thing:
For service plans: Home > Service Plans > YOUR SERVICE PLAN NAME" ( tab: PHP settings )
What do I need to configure in php settings, cause I do not have either any option with the name of: disabled_functions=

Thanks
 
Hi PedroN,

pls. DON'T MIX the PHP - setting, configured either manually or over the Plesk Control Panel ( which results in the setting "disabled_functions = mail" at your depending php.ini (s) ) and the Plesk Control option "Allow scripts and users to use Sendmail" ( check box ) at "Home > Tools & Settings > Mail Server Settings":

Plesk-Onyx_Allow_sendmail_mail-server_001.png
 
Hi PedroN,

pls. DON'T MIX the PHP - setting, configured either manually or over the Plesk Control Panel ( which results in the setting "disabled_functions = mail" at your depending php.ini (s) ) and the Plesk Control option "Allow scripts and users to use Sendmail" ( check box ) at "Home > Tools & Settings > Mail Server Settings":

View attachment 11593
Ah ok, sorry, and for the second question I asked you?
What do I need to configure in php settings, cause I do not have either any option with the name of: disabled_functions=

Thanks
 
Hi PedroN,

Ah ok, sorry, and for the second question I asked you?

As mentioned before:
Hi weelk, BoiseComputer and Roland_R,

the usage of sendmail can be denied serverwide with the settings at: "Home > Tools & Settings > Mail Server Settings" ( option: Allow scripts and users to use Sendmail )

Another solution could be to disable the PHP - function mail in the domain - specific PHP settings with the addition "disable_functions = mail" in the lower text - box at the very end of the domain or subdomain specific PHP settings. Be aware that PHP "safe mode" must be enabled in order to make this work properly and please make sure, that you lock the corresponding subscription, because otherwise the global definitions from your subscription plan will be synced and your domain specific configuration will be lost.

Pls. check as well, that you setup "safe_mode = on", because otherwise the setting for "disable_functions = mail" is incomplete!
 
Pls. check as well, that you setup "safe_mode = on", because otherwise the setting for "disable_functions = mail" is incomplete!
Oh really, yes sorry I am blind xDDD, I was searching an option and did not see the box to write in there xDDDD

Thanks again :p
 
Back
Top