How to Change Postfix SMTP Port on Ubuntu

postfix

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/master.cf

    $ sudo nano /etc/postfix/master.cf

  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

Leave a Reply

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