home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
74.01k stars 31.05k forks source link

IPv6 causes IMAP component to timeout #123760

Closed raccettura closed 3 months ago

raccettura commented 3 months ago

The problem

I have a mailserver with a A record as well as AAAA record. When home assistant is on an IPv4 network there is no connectivity issue.

When I enable IPv6 on the network, the connection times out. ping/traceroute to the server is fine, I can telnet to the server just fine. I can connect to other IPv6 services just fine from within the docker container. This seems specific to this component.

There's no other information in the logs other than a timeout it seems. It would be better to just support IPv4 than the current behavior of allowing an unsupported network stack.

What version of Home Assistant Core has the issue?

core-2024.8.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

IMAP

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 3 months ago

Hey there @jbouwh, mind taking a look at this issue as it has been labeled with an integration (imap) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `imap` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign imap` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


imap documentation imap source (message by IssueLinks)

jbouwh commented 3 months ago

How is your IMAP server configured, by FQDN or IPv6 static address notation?

raccettura commented 3 months ago

FQDN

jbouwh commented 3 months ago

Did some testing with both a native and a mixed set up with an invalid IPv4 and a valid IPv6. All seems working well in my test cases.

raccettura commented 3 months ago

In my case they're both valid if that makes a difference.

My solution at least for now is to get rid of host networking on that container which seems to force docker to IPv4, though at the expense of making HomeKit more complicated to get working.

jbouwh commented 3 months ago

It also works fine with both IPv4 and IPv6 in my case, that is actually what I have set up in base. Does IPv6 not work at all? May be you can test with an IPv6 only FQDN? May be you an have another issue in your local network?

jbouwh commented 3 months ago

My solution at least for now is to get rid of host networking on that container which seems to force docker to IPv4, though at the expense of making HomeKit more complicated to get working.

I think that might cause the issues. I have tested with a Home Assistant OS set up. IP routing is up to the OS and Docker and should be correctly configured. But I think it is not an issue with IMAP or Home Assistant.

jbouwh commented 3 months ago

I am closing this as it not an issue with HA Core or the IMAP integration. Also I do not see issues with this on Home Assistant OS.