How to disable mail function for a spamming domain


2016-11-16 12:46:59 UTC


2017-08-15 12:53:09 UTC


Was this article helpful?

Have more questions?

Submit a request

How to disable mail function for a spamming domain

Applicable to:

  • Plesk


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:

  1. Go to Plesk > Subscriptions > > Customize > PHP settings > Additional configuration directives

  2. Add 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.

If 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 php.ini settings for the domain.

In case Suhosin PHP module is installed, follow these steps:

  1. Comment out disable_functions directive in Suhosin config in order not to override the same directives in domains php.ini .

    $ grep disable_function  /etc/php.d/suhosin.ini
    ;disable_functions =
  2. Add additional PHP directive for domain:

    disable_functions = exec, system, mail
Have more questions? Submit a request
Please sign in to leave a comment.