Graham Leggett wrote:
Hi all,
I have a machine that is both a postfix mailserver, and a NAT router for
a number of machines behind the box.
Because traffic from machines behind the box can cause the mailserver's
IP to be blacklisted, the mailserver machine has two IP addresses, one
for the mailserver, and one for NAT.
There is a problem: postfix seems to be hell bent on choosing the NAT IP
address as a source IP for outgoing connections, instead of the IP
address specified by inet_interfaces:
inet_interfaces = $myhostname
That parameter sets the ips for LISTENING to SMTP connections.
According to the docs at http://www.postfix.org/postconf.5.html, "When
inet_interfaces specifies just one IPv4 and/or IPv6 address that is not
a loopback address, the Postfix SMTP client will use this address as the
IP source address for outbound mail"
This doesn't seem to be happening. Instead, postfix wants to choose the
other IP address (which happens to be the NAT address) on the interface,
rather than IP address @myhostname, which is the first IP on the interface.
Can anyone confirm whether setting the source address in postfix is even
possible, and how to force postfix to use a specific IP as a source
address?
Use smtp_bind_address in master.cf:
http://www.postfix.org/postconf.5.html#smtp_bind_address
Please be aware that a content_filter on localhost might be unreachable if you
don't use a separate transport for that purpose.
You would probably have received much more helpful answers if you had asked
about a soure ip address instead of the source port.
--
Sandy
List replies only please!
Please address PMs to: news-reply2 (@) japantest (.) homelinux (.) com