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
vi /etc/postfix/master.cf
smtp inet n – n – – smtpdchange smtp word to your desired port no. Here I am changing it to 9267
9267 inet n – n – – smtpd
Now restart the postfix
/etc/init.d/postfix restart
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
[root@localhost postfix]#
Thanks you
That part is OK thanks you again. But then I have other problem
Dec 12 14:36:43 localhost postfix/smtp[3596]: connect to mail.example.com[1.1.1.1]:25: Connection timed out
25: Connection timed out
How I can to do. What do you believe?
UDP and SMTP (port 25) may also be blocked. Maybe operating system is configured with firewalls which block traffic. Is possible to open port within my VPS’s firewall.
Hello Armando,
It is related to no connection blocked either by network firewall or iptables of client/server.
You have to allow mail port from firewall and iptables.
Regards
Sharad
Great blog. Cheers for Sharing
Thank you!
Regards
Sharad
That would render the system unable to receive any e-mails from outside. If this what you want to do!
keep the two:
smtp inet n – – – – smtpd
587 inet n – – – – smtpd
problem solved.
no resolvet,
this sentora is verrrrry stuopidddd program