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 mailserver in a datacenter, 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 mailserver.

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

vi /etc/postfix/

and remove the # in front of the line:

#submission inet n - n - - smtpd

so that it looks like this:

submission inet n - n - - smtpd

and restart postfix:

/etc/init.d/postfix restart


13 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.

  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?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>