ljmerza / ha-email-sensor

Email Sensor for collecting tracking numbers from over 40 providers.
MIT License
87 stars 22 forks source link

Self signed certificates are not accepted #51

Open NODeeJay opened 1 year ago

NODeeJay commented 1 year ago

When I try to connect to my MS Exchange with self signed certificate it fails with

email: Error on device update!
[...]
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:997)

Config:

- platform: email
  email: alex@<beep>.net
  password: <beep>
  imap_server: mail.<beep>.net
  imap_port: 993
  folder: ebay
  days_old: 5
  ssl: true

I tried without SSL, but then it seems TLS is epected. Is there an option to ignore a self signed certificate?

CaptainKarma commented 1 year ago

Have you tried imap_port: 587 ?

NODeeJay commented 1 year ago

It's my own mailserver and running a self signed certificate as I use IMAP only internally. I did not enable port 587.

NODeeJay commented 1 year ago

I took the opportunity to reconfigure the acme script to install the letsencrypt certificate also for the internal IMAP service, which fixed the symptom but not the issue. For me it's resolved but you may want to consider a setting to allow untrusted certs in future?