Skip to content

Updated iPv6 entry in docs and removed not working fix.#3061

Closed
AlperShal wants to merge 1 commit intodocker-mailserver:masterfrom
AlperShal:master
Closed

Updated iPv6 entry in docs and removed not working fix.#3061
AlperShal wants to merge 1 commit intodocker-mailserver:masterfrom
AlperShal:master

Conversation

@AlperShal
Copy link
Copy Markdown

Description

This fix no longer works as mentioned in #2927 and with my same experience. @vedranmiletic had the same experience too.

Fixes #2927

Type of change

  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • [No Need] I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (README.md or the documentation under docs/)
  • [] If necessary I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 5, 2023

Documentation preview for this PR is ready! 🎉

Built with commit: effff50


## Background
## Not Available
docker-mailserver doesn't currently support iPv6 networking! Trying to get mails using iPv6 will result with postfix not being able to find your hostname.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is 100% correct. It is probably not even a DMS issue, but a Docker issue. I could try setting up a Kubernetes dual-stack cluster which supports IPv6 just fine and DMS should work in this setup too. @casperklein @polarathene do you think this really is accurate?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is probably not even a DMS issue, but a Docker issue.
@polarathene do you think this really is accurate?

The previous content was more accurate about the "why" and should remain really (the gateway IP varies IIRC, dependent on what the docker network got assigned).

The #2927 referenced issue is the one I was intending to respond to, but got side-tracked with all the test refactoring in jan 😅 I recently shared details on how to get IPv6 working properly, although I haven't applied it for DMS myself yet to verify that resolves the issue.

Probably better to update the docs with information from there as the IPv6 NAT support wasn't available when these docs were written IIRC.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you think this really is accurate?

Afaik, none of us is using IPv6. So we can't properly test/reproduce any errors that are reported. Given the amount of IPv6 related issue, I am not sure if we should advertise it to be functional. So a warning seems reasonable to me. The wording however is a bit harsh and might be adjusted.

+ gateway: fd00:0123:4567::1
```
## Fix
To fix the issue, basicly remove the AAAA record for your mailserver. This will prevent email senders from using iPv6.
Copy link
Copy Markdown
Member

@georglauterbach georglauterbach Feb 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To fix the issue, basicly remove the AAAA record for your mailserver.

Haha, I'm all for that ❤️ This is probably not something someone who needs to use IPv6 wants to hear though..

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to hear this too but that was the only fix I was able to find. :)

Copy link
Copy Markdown
Member

@polarathene polarathene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Background info seems relevant still. I'd rather not drop that. The alternative fix and additional issue to reference is good though 👍

It should be possible to configure your Docker host to support IPv6 NAT and I think that will resolve the issue experienced. If anyone can confirm that I am happy to revise the docs here with that approach.

@AlperShal
Copy link
Copy Markdown
Author

It should be possible to configure your Docker host to support IPv6 NAT and I think that will resolve the issue experienced. If anyone can confirm that I am happy to revise the docs here with that approach.

If I hadn't started actively using my mail server I would definitely check it and validate but it's impossible for me to risk missing some mails right now.

@vedranmiletic
Copy link
Copy Markdown

Background info seems relevant still. I'd rather not drop that. The alternative fix and additional issue to reference is good though +1

It should be possible to configure your Docker host to support IPv6 NAT and I think that will resolve the issue experienced. If anyone can confirm that I am happy to revise the docs here with that approach.

It might be possible, but the current documentation will fail to give that. So it should at least carry a big warning "this IPv6 NAT approach is only theoretically interesting as it is practically useless for mail reception".

@polarathene
Copy link
Copy Markdown
Member

So it should at least carry a big warning "this IPv6 NAT approach is only theoretically interesting as it is practically useless for mail reception".

Docs state that IPv6 will connect, but mail will fail SPF check (which causes rejection, at least if not authenticated IIRC?):

If your container host supports IPv6, then docker-mailserver will automatically accept IPv6 connections by way of the docker host's IPv6.
However, incoming mail will fail SPF checks because they will appear to come from the IPv4 gateway that docker is using to proxy the IPv6 connection

Referenced issue #2927 shows:

Client host rejected: cannot find your hostname, [172.23.0.1]

And another related issue (with another user already configured with IPv6 advice I gave) had that same error (but with an IP that wasn't a private address). It's possible that this PR which made it to the v11.2.0 release is another failure point being experienced, and thus the current docs are outdated as they don't account for that?

I've assigned myself to look into it. I'm currently focused on overhauling the test suite so that we can improve test coverage for issues like this, especially with DNS and more real-world style mail delivery. After that I'll try to reproduce and go from there.

@vedranmiletic
Copy link
Copy Markdown

Docs state that IPv6 will connect, but mail will fail SPF check (which causes rejection, at least if not authenticated IIRC?):

Correct.

If your container host supports IPv6, then docker-mailserver will automatically accept IPv6 connections by way of the docker host's IPv6.
However, incoming mail will fail SPF checks because they will appear to come from the IPv4 gateway that docker is using to proxy the IPv6 connection

That is only correct if you use the stock configuration. If you enable robbertkl/ipv6nat per instructions, you will get the the address of the IPv6 gateway.

And another related issue (with another user already configured with IPv6 advice I gave) had that same error (but with an IP that wasn't a private address).

I haven't experienced the issue with the rejected public address, only private (both IPv4 as you wrote and IPv6 with robbertkl/ipv6nat). Hope this helps.

@polarathene
Copy link
Copy Markdown
Member

If you enable robbertkl/ipv6nat per instructions, you will get the the address of the IPv6 gateway.

Since Docker supports IPv6 NAT via /etc/docker/daemon.json with ip6tables: true and experimental: true, this should replace the need for that extra container. I have heard that there is some minor differences, but I don't think they'd affect DMS differently. If we can resolve the issue the docs can be updated to suggest official support by Docker instead.

The quoted docs may only apply to stock configuration but they do describe the reason IPv6 is problematic out of the box, so I still see value in keeping that in the docs.


I haven't experienced the issue with the rejected public address, only private (both IPv4 as you wrote and IPv6 with robbertkl/ipv6nat). Hope this helps.

So even with that container setup and providing proper IPv6 NAT, you don't receive mail? But no errors like others are seeing? Do you have any other logs that communicate failures?

@vedranmiletic
Copy link
Copy Markdown

So even with that container setup and providing proper IPv6 NAT, you don't receive mail? But no errors like others are seeing? Do you have any other logs that communicate failures?

I'm not sure what would proper IPv6 NAT mean in this case. Any configuration of IPv6 I found via web search and tried thus far, be it via daemon.json or via docker-compose.yml, resulted only in rejections. Either the rejected address was a private IPv4 address of the gateway or the private IPv6 address of the gateway. Therefore, I guess I haven't been able to get "proper NAT" working.

@polarathene
Copy link
Copy Markdown
Member

polarathene commented Feb 7, 2023

I'm not sure what would proper IPv6 NAT mean in this case.

I meant that it was supported instead of the container seeing an IPv4 address it should be an IPv6 one. I think it can be a bit more problematic if there are other containers routing the traffic though. With reverse-proxies for example, they handle this fine, but if a container they bridge needs the external IP, they need to provide it via a separate header IIRC, as otherwise they get the wrong IP (internal container IP).

It would be helpful if there's a simple config + steps that I can try reproduce with when I get the time to investigate.


Either the rejected address was a private IPv4 address of the gateway or the private IPv6 address of the gateway.

Oh, I misread your previous statement about public. Most reports are with the private address being rejected. I thought you were saying you weren't seeing that in your logs 😅

In that case, it's very much likely caused by this PR. I think if you revert that change, it may fix the problem. If you try this and it does fix it for you, please let us know.

@vedranmiletic
Copy link
Copy Markdown

It would be helpful if there's a simple config + steps that I can try reproduce with when I get the time to investigate.

Sure, reset Docker config to default (i.e. remove daemon.json and restart the service) and then follow the IPv6 instructions from Docker-Mailserver docs. That should be enough.

In that case, it's very much likely caused by this PR. I think if you revert that change, it may fix the problem. If you try this and it does fix it for you, please let us know.

I believe this is the case. However, that PR is correct in its thinking so I don't want to revert it.

The container receiving the connection via IPv6 should see the public IPv6 of the sending side and not the private IPv4/IPv6 address of the gateway. The problem is that it doesn't happen and I have no idea whether this is due to incorrect configuration of Docker or robbertkl/ipv6nat. Either way, the documentation should mention the issue exists.

@github-actions github-actions Bot added the meta/stale This issue / PR has become stale and will be closed if there is no further activity label Mar 3, 2023
@polarathene polarathene added stale-bot/ignore Indicates that this issue / PR shall not be closed by our stale-checking CI and removed meta/stale This issue / PR has become stale and will be closed if there is no further activity labels Mar 3, 2023
@docker-mailserver docker-mailserver deleted a comment from github-actions Bot Mar 3, 2023
@georglauterbach
Copy link
Copy Markdown
Member

As is, this PR can not be merged as maintainers decided it removes information still relevant. Since IPv6 is just an awfu.. complex protocol, this needs more work.

Moreover, this seems to have stalled, which I absolutely dislike, but I also understand it in this case.. so, @polarathene, what would you do now? I would like to do something about this PR - otherwise it will continue to rot.

@polarathene
Copy link
Copy Markdown
Member

@polarathene, what would you do now? I would like to do something about this PR - otherwise it will continue to rot.

  • I've been swamped, and need to prioritize other tasks in DMS backlog atm. If I can look into it this month I will.
  • Still relevant to keep open as a reminder / todo. Alternatively an issue can be opened and reference this PR if you want to close it instead. So long as the concern is visible to be aware that it needs attention is all I care about right now.

georglauterbach added a commit that referenced this pull request Apr 10, 2023
see #1438 and #3057 (with
#3057 (comment))
for reference.

Superseeds #3061
@georglauterbach georglauterbach mentioned this pull request Apr 10, 2023
3 tasks
@georglauterbach
Copy link
Copy Markdown
Member

Closing in favor if #3244 which superseeds this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale-bot/ignore Indicates that this issue / PR shall not be closed by our stale-checking CI

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

IPv4 address must be set in docker-compose.yml explicitly

5 participants