Applicable to:
- Plesk for Linux
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
-
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)
-
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
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
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
-
Go to Tools & Settings > Mail Server Settings > Mail Queue tab > Clear
-
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
-
Comments
6 comments
[Plesk Onyx 17.8.11] > Unknown Plesk command-line utility: "mailmng-server"
Hello @Arnaud, such behavior was not reproduced on a test server, the command worked without issues.
# plesk sbin mailmng-service --stop-service
# plesk -v
Product version: Plesk Onyx 17.8.11 Update #8
Update date: 2018/05/24 18:04
Build date: 2018/05/17 15:37
OS version: CentOS 7.4.1708
What OS do you use and what mail server do you have installed?
weird ...
here are the same commands,
no clue about the mail server installed (or maybe no mail server installed, I was trying to setup external smtp but realized a mail server might be mandatory for relaying .. ?)
@Arnaud, sorry for late response, have you tried this article to achieve the goal?
Hi, perfectly fine now, my postfix was disabled, and so was mailmng at the same time
thank you
- Arnaud
Hello, @Arnaud.
Thank you for the answer.
Please sign in to leave a comment.