Tag Archives: Postfix

How to open SMTP port 587 to send emails in Plesk

Plesk-LogoBy 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:

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:

Happiness!

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.

 

  • http://blog.mailgun.com/25-465-587-what-port-should-i-use/
  • http://www.faqforge.com/linux/how-to-enable-port-587-submission-in-postfix/
  • http://know.mailsbestfriend.com/how_to_enable_port_587_submission_in_postfix-1932675618.shtml
  • a Plesk 11 alternative: http://kb.sp.parallels.com/en/114417

The Postfix Cheat Sheet

mail-iconI 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.

Log Files

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:

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.

Screen Shot 2014-03-10 at 14.51.03

Further Reading

  • http://www.postfix.org/DEBUG_README.html
  • http://www.cyberciti.biz/faq/linux-unix-start-stop-restart-postfix/
  • http://kb.parallels.com/en/111283

If you have any further ideas, please let me know in a comment below.