Question
How to check what Message Transfer Agent is used on the server with Plesk and how to switch it?
Answer
Starting from Plesk version 9 only two Message Transfer Agents (MTA) are supported – QMail and Postfix. Only one of them can be used at a time.
Check the installed MTA:
Click on a section to expand
Via Plesk GUI
-
Go to Tools & Settings > Services Management:
-
Find SMTP Server line. Depending on the installed MTA it will be:
SMTP Server (Postfix)
OR
SMTP Server (QMail)
Via CLI
-
Connect to the server via SSH
-
Execute the following command:
# plesk sbin mailmng-server –features | grep SMTP_Server
Depending on the installed MTA, the output will be:
# plesk sbin mailmng-server –features | grep SMTP_Server
$features[‘SMTP_Server’] = “Postfix”;
$features[‘SMTP_Server_package’] = “postfix”;OR
# plesk sbin mailmng-server –features | grep SMTP_Server
$features[‘SMTP_Server’] = “QMail”;
$features[‘SMTP_Server_package’] = “psa-qmail”;
Â
Change the installed MTA:
Click on a section to expand
Via Plesk GUI
Note: Before switching the MTA, it is recommended to wait until all queued emails are delivered.
-
Go to Tools & Settings > Services Management
-
Stop the service SMTP Server
-
Go to Tools & Settings > Updates and Upgrades > Add/Remove Components > Mail Hosting > SMTP servers.
-
Select the necessary SMTP server – QMail or Postfix.
-
Click Continue > Install
Via CLI
Note: Before switching the MTA, it is recommended to wait until all queued emails are delivered.
-
Connect to the server via SSH
-
Stop the Mail service:
# plesk sbin mailmng-service –stop-service
-
Make sure that there aren’t processes binding port 25:
# lsof -i :25
(Empty Output)In case any process is returned by the previous command, run the following command to kill running processes:
# lsof -i :25 | grep LISTEN | awk ‘{print $2}’ | sort | uniq | xargs kill
-
Install the necessary SMTP server:
-
Postfix
# plesk installer –select-release-current –install-component postfix
-
QMail
# plesk installer –select-release-current –install-component qmail
Also, it is possible to run Plesk installer and select the necessary SMTP server in Mail Hosting section:
# plesk installer
-
Additional Information
To flush the Mail queue:
Click on a section to expand
Via Plesk GUI
-
Go to Tools & Settings > Mail Server Settings > Mail Queue tab > Clear
Via CLI
-
Connect to the server via SSH
-
Clear the mail queue according to the installed MTA:
-
For QMail:
# kill -ALRM pidof qmail-send
-
For Postfix:
# postqueue -f
-