How to enable port 587 (submission) in postfix

Some internet access providers have port 25 disabled in their routers to prevent spam. If you run your own email server in a data center, you might have to enable the submission port (587) in postfix to be able to send emails from your local email client to your own mail server.

Enable Submission Port 587 in Postfix

To enable port 587, edit the file /etc/postfix/

nano /etc/postfix/

and remove the # in front of the line:

# submission inet n - y - - smtpd

so that it looks like this:

submission inet n - y - - smtpd

and restart postfix:

systemctl restart postfix

15 thoughts on “How to enable port 587 (submission) in postfix”

  1. Great post. I have been trying to get my postfix server to accept email from external authenticated clients on both port 25 and 587 for days, and haven’t been able to get it to work. I uncommented the submission line in, and opened up port 587 on my amazon server, and it worked! If only I had found this earlier. Thanks.

  2. You guys are all missing something very important here. “Submission” isn’t meant to be a straight copy of the plain auth port 25. Its meant to be encrypted. This is a ‘correct’ “Submission” entry in

    submission inet n – n – – smtpd
    -o smtpd_tls_security_level=encrypt
    -o smtpd_sasl_auth_enable=yes
    -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    -o milter_macro_daemon_name=ORIGINATING

    The milter macro line isn’t needed in all configs, you should know what you’re doing before you rock and roll.

    IMO you should probably not be using port 25 OR port 587. You should be using SSL (465), which is properly configured like this:

    smtps inet n – n – – smtpd
    -o smtpd_tls_wrappermode=yes
    -o smtpd_sasl_auth_enable=yes
    -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    -o milter_macro_daemon_name=ORIGINATING

    And is what I actually am using on my production server.

    • Dylan,

      TLS is not actually required for the use of port 587 as submission mechanism.
      RFC 6409 (which defines the use of port 587 for use for mail submission from local users) specifically states that the mail server MAY use STARTTLS. So it is not required. Often it is used that way but you do not have to, and what the OP states is 100% correct.

  3. Dear Dylan,

    nice note about the TLS. However not only the milter line depends on the specific configuration, but all lines, and they also should exist in the version of postifx that is used. For example, another possible option is “-o smtpd_enforce_tls=yes”, but it may be deprecated (haven’t checked so far).

    As for the SSL and port, please note that port 465 is deprecated for SMTPS and is no longer RFC-compliant. This port is already assigned for different purposes. Wiki provides more info, you can also check the RFC. Hope this helps.

  4. Just wondering if its possible to restrict all out-going mails to port 587 and NOT allow any sending out of emails on port 25.

    Port 25 should only be used to receive mail and NOT send out …How can I do this?

  5. Hello

    i want to change iredmail postfix port ,at this time port 465 but i want to change port 578 so
    please help me .



Leave a Comment