How to Change Postfix SMTP Port on Ubuntu



Nowadays some Internet Service Provider block port 25 which is used by SMTP. We can change this in Postfix to point to another port, for example port 587.

  1. Edit /etc/postfix/

    $ sudo nano /etc/postfix/

  2. Add # in front of this line:

    smtp inet n - - - - smtpd

    and add new line:

    587 inet n - - - - smtpd

  3. Restart Postfix

    $ sudo /etc/init.d/postfix restart

  4. Check using telnet

    $ telnet localhost 587

  5. Done

2 thoughts on “How to Change Postfix SMTP Port on Ubuntu

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.