This is one of the most simple tasks, yet I had to Google around for hours: change the incoming port of postfix's SMTP, without iptables prerouting.
Open /etc/postfix/master.cf
, and search for the
following line (usually the first uncommented line):
smtp inet n - - - - smtpd
To change the port, simply write the number instead of smtp in the begining.
For example:
2525 inet n - - - - smtpd
Restart postfix
/etc/init.d/postfix restart
and the system can not accept messages on the port you added. Don't forget to enable the port on your firewall, if you have one!
(Oh, by the way: this entry was written by Peter Molnar, and originally posted on petermolnar dot net.)