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
69.68k stars 28.84k forks source link

unable to configure IMAP integration #118552

Open fcrozat opened 1 month ago

fcrozat commented 1 month ago

The problem

I'm trying to configure IMAP integration with my email provider but I'm getting an SSL error in the logs.

Mail server mail.infomaniak.com

What version of Home Assistant Core has the issue?

2024.5.5

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

https://www.home-assistant.io/integrations/imap

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-05-31 14:04:12.422 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1147, in create_connection
    transport, protocol = await self._create_connection_transport(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1180, in _create_connection_transport
    await waiter
  File "/usr/local/lib/python3.12/asyncio/sslproto.py", line 578, in _on_handshake_complete
    raise handshake_exc
  File "/usr/local/lib/python3.12/asyncio/sslproto.py", line 560, in _do_handshake
    self._sslobj.do_handshake()
  File "/usr/local/lib/python3.12/ssl.py", line 917, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL] unknown error (_ssl.c:1000)

Additional information

Somebody else reported a similar issue on the forum (I can't confirm it was working with older HA version, this is the first time I'm configuring this integration) with SMTP : https://community.home-assistant.io/t/smtp-ssl-unknown-error-since-2024-5-x/732773

home-assistant[bot] commented 1 month 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 1 month ago

Can you share the server details from your service provider, (no need for credentials.)?

fcrozat commented 1 month ago

Everything is listed at https://www.infomaniak.com/en/support/faq/468/ports-protocols-for-messaging

jbouwh commented 1 month ago

Thanks I'll come back later after done some tests

jbouwh commented 4 weeks ago

If have done some testing at port 993 of mail.infomaniak.com. Conclusion is that I cannot reproduce your issue. The connection certificates and the validation works as expected. It might be an issue with your OS though. How did you install Home Assistant?

fcrozat commented 4 weeks ago

Home assistant is running in container (upstream HA container: ghcr.io/home-assistant/home-assistant:stable ) on openSUSE MicroOS with podman (see https://github.com/fcrozat/home-assistant-on-MicroOS/blob/main/home-assistant.container ). There might be a problem in the python or openssl stack used in the container.

fcrozat commented 2 weeks ago

Confirming the issue is still present with HA container 2024.6.2

jbouwh commented 2 days ago

I think is is an issue with OS. Did you try the override the cipher settings?: https://www.home-assistant.io/integrations/imap/#selecting-an-alternate-ssl-cipher-list-or-disabling-ssl-verification-advanced-mode

fcrozat commented 2 days ago

Crypto libraries are provided by Home Assistant container, not the underlying OS.

Switching cipher settings is giving a different error "invalid authentication"

jbouwh commented 2 days ago

Switching cipher settings is giving a different error "invalid authentication"

Then it looks TLS settings work well now. I think you should check your account. Is there any logging?

fcrozat commented 2 days ago

There is no logs available for logins attempts, since it is a hosted solution. The same credentials are working fine with GNOME Evolution (Linux) or Samsung Email (Android) as an example.

A free account can be created using https://www.infomaniak.com/en/free-email to test btw.

jbouwh commented 2 days ago

A free account can be created using https://www.infomaniak.com/en/free-email to test btw.

Not available NL unfortunately