How to enable port 587 in Postfix

By default, Postfix listens for connections on port 25/tcp and in this article I will show what needs to be done so that it starts to happen port 587 (submission), since for example in many mail clients when setting up mail, port 587 is offered by default.

Open the configuration file /etc/postfix/master.cf in any text editor:

sudo nano /etc/postfix/master.cf

Find the line below and uncomment it:

submission inet n - n - - smtpd

Under this line, you can also specify some parameters (there must be a space before each line):

  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject

If a firewall is used, then do not forget to open incoming connections on port 587/tcp.

Check the configuration and restart Postfix to apply the changes:

sudo postfix check
sudo systemctl restart postfix
netstat -na | grep LISTEN | grep 25
netstat -na | grep LISTEN | grep 587

See also my article:
Installing and Configuring Postfix

Leave a comment

Leave a Reply