Change Postfix Port

PUBLISHED ON OCT 3, 2019 — HOW-TO, LINUX

I was trying to route emails from one MTA to postfix, so I needed to change the port that postfix was using, so this is what I did:

First, please backup the file in case you break something

cp /etc/postfix/master.cf /etc/postfix/master.cf.bak

Let’s edit the following file:

vim /etc/postfix/master.cf

Make it look like this:

==========================================================================
# service type  private unpriv  chroot wakeup  maxproc command + args
#               (yes)   (yes)   (yes)  (never) (100)
# ==========================================================================
#smtp      inet  n       -       n      -       -       smtpd
2525      inet  n       -       n      -       -       smtpd  ## This is the new port

Restart postfix and verify by running the following commands:

systemctl restart postfix
netstat -plutn | grep 2525

There you go!

P.S. Millennials are allowed to use nano

comments powered by Disqus