How to change smtp port number 25 in postfix
Bydefault the SMTP protocol runs at port no. 25.
You can change the port no. to any port no. other than below 2048.
0 to 2048 are IANA authorized known port no.but we have some other port no. also which are bydefault used by manyapplication for. eg. port no. 8080 for tomcat.
To know more about port number click this wikipedia URL
Here we are using Postfix as our MTA.
To change the smtp port no. in postfix,edit the master.cf file and change the given below value
smtp inet n – n – – smtpd
change smtp word to your desired port no. Here I am changing it to 9267
9267 inet n – n – – smtpd
Now restart the postfix
Check the port no. status with netstat command
[root@localhost postfix]# netstat -tanp|grep 9267
tcp 0 0 0.0.0.0:9267 0.0.0.0:* LISTEN 9788/master