Plesk

How to disable PHP mail() function for a spamming domain on Plesk for Linux server?

Question

Answer

Disable mail() function for a subscription via GUI

  1. Log into Plesk

  2. Go to Subscriptions > example.com > Customize > PHP settings

  3. Add disable_functions = mail string to the Additional configuration directives field:

  4. Click OK button to apply changes

Warning: Make sure that the corresponding subscription is Locked and does not sync with its Service Plan. Otherwise, the changes will be rewritten by the values defined in the Service Plan.

Disable mail() function for a subscription via CLI:

  1. Connect to the server via SSH

  2. Execute the following command:

    # plesk bin subscription_settings -u example.com -outgoing_messages_enable_sendmail false

 

Also, the Sendmail utility might be disabled completely to disable the functionality of sending such emails completely:

Disable Sendmail utility completely

Usage of Sendmail utility can be disabled server-wide with the settings at:

  • Log in to Plesk GUI > Tools & Settings > Mail Server Settings > Disable the option Allow scripts and users to use Sendmail

Or on the Service Plan level:

  • Log in to Plesk GUI > Service Plans > <service_plan_name> > Mail > Disable the option Allow scripts and users to use Sendmail

Or on the Subscription level:

  • Log in to Plesk GUI > Subscriptions > example.com > Outgoing mail control > Subscription > Change limits > Disable the option Allow scripts and users to use Sendmail