Change Postfix Port
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
Related Articles
How to Start OpenVPN Automatically at Boot on CentOS & RHEL (systemd & SysVinit)
How to configure OpenVPN client and server profiles to start automatically on boot in RHEL, Rocky Linux, and CentOS using systemd or legacy chkconfig.
Create and Tune a Linux Swap File on CentOS, RHEL & Rocky Linux
How to allocate, secure, persist, and tune a swap file on CentOS, RHEL, Rocky Linux, and small AWS EC2 instances to prevent OOM crashes.
Custom Apache Handler for Running Multiple PHP Versions Per VirtualHost
How to run multiple PHP versions side-by-side in Apache VirtualHosts using PHP-FPM Unix sockets (Apache 2.4+) or CGI ScriptAlias handlers.