I have a long running postfix setup dual stacked IPv4 and IPv6.  I've
specified the outbound bind addresses for smtp.

smtp      unix  -       -       -       -       -       smtp
  -o smtp_bind_address=[...]
  -o smtp_bind_address6=[...]

I use the host to receive mail to my domain as well as send outbound
mail from my accounts. I noticed recently that outgoing mail did not
appear to be using IPv6, even for destinations which should support
IPv6 MX.

Mail being received arrives fine over IPv6.

To experiment, I setup a transport_map for a known third party and
bound it only to IPv6.  When I then sent mail to that third party,
IPv6 was used, as expected.  So my smtp_bind_address6 *was* correct,
but for some reason postfix was preferring v4 without the map.

After some further testing it occurred to me to try modifying the
"relay" service with smtp_bind_address and smtp_bind_address6 as I did
with the "smtp" service.  In doing so, my mails suddenly started
exiting via IPv6.  Reverting the bind option went back to IPv4, and
restoring the options again enabled outbound IPv6.

So I'm left with a couple questions:

1- Why is my outbound mail using 'relay' instead of 'smtp'?  Based on
what I saw in the documentation
(http://www.postfix.org/postconf.5.html#relay_transport), relay sounds
like it's "for remote delivery to domains listed with $relay_domains".
 My $relay_domains is localhost and my hostname, so I wouldn't expect
an external domain (eg gmail.com) to use 'relay'.  I can't tell if
I've horribly misconfigured something, or if I'm just misunderstanding
the documentation on when relay is normally used.

2- Why does postfix stop using IPv6 just because I haven't bound it to
a specific IPv6 address?  Even if I had never realized that it was
using relay, the host still has inet_protocols = all, clearly receives
over IPv6, and clearly has functional IPv6 addresses for outbound
mail.  In absence of the transport being bound to either IPv4 or IPv6,
I would have expected it to opportunistically use IPv6, but it appears
to only ever use IPv4.


Thanks

Reply via email to