By default Plesk on Linux uses Postfix for outgoing email, and by default listens on port 25 for outgoing SMTP mail. Some service providers do not allow to send emails on that port, and tragedy occurs: clients can’t send email with their Plesk servers. Not good.
Other SMTP ports will usually work, such as the other favourite 587 – but by default, Postfix is not listening on this port for email submissions – at least not in Plesk 12.0.8 on CentOS 7.
Here’s how to enable port 587 for such ventures:
Open the Postfix configuration file at /etc/postfix/master.cf and find the following line. It’s commented out. All we have to do is to remove the hash in front of it, and email can be sent via port 587:
submission inet n - n - - smtpd
Restart Postfix for the changes to take effect. In CentOS 5 and 6:
This will also work in CentOS 7, but to be more precise:
systemctl restart postfix.service
Note that port 587 needs to be open in your firewall. If the Plesk Firewall Extension is enabled, it’ll take care of it for you automagically.
- a Plesk 11 alternative: http://kb.sp.parallels.com/en/114417
I recently had some trouble with my postfix mail service. Not knowing where to being looking for log files and restart commands, I thought this quick cheat sheet would come in handy in the future:
Starting and Stopping
On CentOS we can speak to postfix like this:
The this command re-reads the configuration files. Note that there is no restart command – you have to stop and then start the service again manually.
On CentOS 6.5 I could find the log files in /var/log/maillog (that’s a file not a directory). Other installations may have it in /var/log/mail. Refer to your own /etc/syslog.conf file for the exact location.
To display log events life we can make use of tail -f
Alternatively we can come through the entire log and display the tricky bits:
egrep '(warning|error|fatal|panic):' /var/log/maillog | more
Note that log files are rotated – what you’re looking for may be hiding in other log files (such as maillog-201xxxxx).
Postfix in Plesk
If you’re using Plesk then you can see the individual components of the service under Tools and Settings (or Server if you’re using Power User View) – Services Management. You can start/stop/restart each aspect from here.
Sometimes the SMTP service appears to be offline even though it’s running. This can happen on CentOS. It’s nothing to worry about – simply restart the service from the command line as explained above and it should show up fine in Plesk.
If you have any further ideas, please let me know in a comment below.