Question
- How to disable mail() function for a spamming domain on the Plesk server?
Answer
Disable mail() function for a subscription via GUI
-
Go to Subscriptions > example.com > Customize > PHP settings
-
Add
disable_functions = mail
string to the Additional configuration directives field: -
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:
-
Connect to the server via SSH
-
Execute the following command:
# plesk bin subscription_settings -u example.com -outgoing_messages_enable_sendmail false
Also, the Sendmail utility might be disabled completely by following these steps depending on the required level (server-wide, service plan or subscription):
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