3

Question: When specifying 2 or more address for the inet_interfaces directive, will postfix still bind outgoing mail to one of them?

The postfix docs state:

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.

Due to the need for a loopback address I need to be able to bind to either 127.0.0.1 or my WAN address depending on mail destination. My current setting is:

inet_interfaces = 23.45.67.89, [2600:1234::1234:5678:abcd:abcd], 127.0.0.1

Previously I had used smtp_bind_address and smtp_bind_address6 but was causing problems since postfix needs to access loopback for local mail delivery.

Also, I do in fact have 5 static IPv4 addresses for this server, hence the desire to only use one of them. Since the docs state just one IPv4 and/or IPv6 I'm unsure whether specifying all three will ensure that outgoing mail is bound to anything at all.

3

Question: When specifying 2 or more address for the inet_interfaces directive, will postfix still bind outgoing mail to one of them?

No

Parameter inet_interfaces is consulted if inet_interfaces specifies just one IPv4 and/or IPv6 address that is not a loopback address. When inet_interfaces doesn't satisfy that, postfix will use treat smtp_bind_address as default. There are no docs mentioned that smtp_bind_address will use one of address specify in inet_interfaces

Source: Postfix source code, especially in smtp_connect.c and postfix documentation.

  • thanks, and if smtp_bind_address is not specified? Is it just a coin toss at this point or will the addresses specified in inet_interfaces have any effect on which one is used? – billynoah May 6 '15 at 4:13
  • 1
    The socket will use the first IP it finds that has an available route to the server IP being connected to. See postfix configuration and Received from – masegaloeh May 6 '15 at 4:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.