How to disable mail() function for a spamming domain?
Usage of sendmail utility can be disabled server-wide with the settings at:
Home > Tools & Settings > Mail Server Settings (option: Allow scripts and users to use Sendmail ).
To disable mail function for a domain follow the steps below:
Go to Plesk > Subscriptions > example.com > Customize > PHP settings > Additional configuration directives
disable_functions = mail
Also, make sure that the corresponding subscription is locked, otherwise the global definitions of that subscription plan will be synced and domain's specific configuration will be lost.
disable_functions = mail directive does not work and mails are still being sent, check if some additional PHP modules are installed on the server. Additional PHP modules can overwrite
settings for the domain.
In case Suhosin PHP module is installed, follow these steps:
disable_functionsdirective in Suhosin config in order not to override the same directives in domains
$ grep disable_function /etc/php.d/suhosin.ini
Add additional PHP directive for domain:
disable_functions = exec, system, mail