Discussion:
Changing remote MTA port
(too old to reply)
q***@gmail.com
2018-01-04 21:33:24 UTC
Permalink
Postfix appears to be using either the port it is bound to, or the port definition in /etc/services for smtp to connect to remove MTAs.

Specifically, my local /etc/services maps smtp to 3131, so Postfix is receiving connections on 3131. When Postfix attempts to relay a mail message destined for a domain it doesn't know about, it attempts to connect to the remote MTA on 3131, not on 25.

Does anyone have any thoughts on how to fix this?
a***@gmail.com
2018-01-10 06:43:40 UTC
Permalink
Post by q***@gmail.com
Postfix appears to be using either the port it is bound to, or the port definition in /etc/services for smtp to connect to remove MTAs.
Specifically, my local /etc/services maps smtp to 3131, so Postfix is receiving connections on 3131. When Postfix attempts to relay a mail message destined for a domain it doesn't know about, it attempts to connect to the remote MTA on 3131, not on 25.
Does anyone have any thoughts on how to fix this?
Try this

Change back /etc/services maps smtp to 25.

edit /etc/postfix/master.cf
replace
smtp inet n - n - - smtpd

to
3131 inet n - n - - smtpd

restart postfix service.


postfix port will now listen to 3131.

and hopefully delivered mail to 25 port on remote MTA.
q***@gmail.com
2018-01-10 15:34:05 UTC
Permalink
This is what i ended up doing, which does work.

The slight gotchya is that this is part of Plesk installation which appears to do something snarky with the master.cf file when [re]starting the mail system via its /usr/local/psa/admin/sbin/mailmng -- it ensures that there are "smtp inet n - n - - smtpd" and similar smtps lines in the file and, if there are not, slaps them on at the end. Not the end of the world, but something i need remember to check.

Thanks for the reply!
Post by a***@gmail.com
Post by q***@gmail.com
Postfix appears to be using either the port it is bound to, or the port definition in /etc/services for smtp to connect to remove MTAs.
Specifically, my local /etc/services maps smtp to 3131, so Postfix is receiving connections on 3131. When Postfix attempts to relay a mail message destined for a domain it doesn't know about, it attempts to connect to the remote MTA on 3131, not on 25.
Does anyone have any thoughts on how to fix this?
Try this
Change back /etc/services maps smtp to 25.
edit /etc/postfix/master.cf
replace
smtp inet n - n - - smtpd
to
3131 inet n - n - - smtpd
restart postfix service.
postfix port will now listen to 3131.
and hopefully delivered mail to 25 port on remote MTA.
Loading...