-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alter postfix config to use public IPv6 address for outbound mails #2262
base: main
Are you sure you want to change the base?
Conversation
This change alters the Postfix configuration to use the public IPv6 address instead of the private IPv6 address when sending outbound mails over IPv6.
The purpose of the PRIVATE_IPV6 variable is to be the address of the ethernet interface that local services should bind to. This might differ from how the service is seen on the public Internet, which is why there are two variables, although my working knowledge of IPv6 is limited so I'm just assuming this aspect is similar to IPv4. To get postfix (and other local services) to bind on a particular address, the right thing to do would be to set that address to the PRIVATE_IPV6 variable. (It can be the same as PUBLIC_IPV6.) Would that solve the issue? |
I understand completely the utility and necessity for PRIVATE_IPV4 and PUBLIC_IPv4. Mandatory NAT -- even in 1-to-1 configurations -- is certainly a common setup in the IPv4 world. "Address independence" via translation like we see in IPv4 is strongly discouraged and extremely uncommon in IPv6. I've certainly never encountered it in the real world, although I'd be reluctant to say that it's not in use anywhere. It's technically possible, but it's discouraged by the IETF. They have this to say on the subject:
You're right that forcing my correct public IPv6 address to into the confusingly named "PRIVATE_IPv6" configuration setting would also "fix the glitch". That feels like an anti-pattern to me because it requires placing the user's correct public IPv6 address address into a I didn't pursue a solution along those lines because I also found that re-running setup If we go that direction I think we'll need to amend the setup process ( Just to add some clarity and a real world situation, here's what Linode shared-hosting Mail-in-a-Box users encounter. My boxes all provision with a public IPv6 address which is inside a shared subnet ( Again, I'm happy to head off in whatever direction you'd prefer. I'm mostly just interested in getting to a place where I can safely upgrade and re-run setup on my machines without having to make code changes each time. |
Breaking this off for clarity, I propose expanding the setup
I think this is the cleanest approach for now, although it would be great to re-visit how all this is handled in the future if/when ongoing development naturally leads to work on this code in a broader scope. How does that sound? |
Yeah think of it as the traditional "bind" setting with a name that was intended to make it more friendly for users who aren't familiar with socket terminology. |
Probably |
This change alters the Postfix configuration to use the public IPv6 address instead of the private IPv6 address when sending outbound mails over IPv6.
I'm not sure what the reasoning was for the current method. If there are use cases which require the private IPv6 to be used for outbound emails over IPv6 then this PR will need to be extended to allow this to be a configurable choice.
This PR will fix #1738 which is the exact scenario which led to me discovering the problem.
I'm happy to make this PR more involved/optionally configured if some users need to be able to retain the original behavior. I have a suspicion, though, that this is the desired behavior in all cases. What would the use-case be where the user wants Postfix to use the private IPv6 address which will not be covered by "spf -mx" and which (in the case of a hosted VPS provider like Linode) is much more likely to be un-avoidably listed in smtp blackholes like spamhaus XBL/CSS or equivalent which apply to the entire /64 which might be shared among multiple customers at the hosting provider.
I'm not aware of any hosting provider that does address translation with IPv6 the way NAT is employed with IPv4 and such a configuration would be at best strongly discouraged. The private/public distinction doesn't make sense with IPv6 to me at all.