During the pass few days my home assistant setup in no longer sending emails using my gmail account. I have not changed my setup at all it just stop working for some reason. My automation is not sending emails out and the service notify.home_assistant_email is no longer available.
I have been trying for the pass few days to fix it but with no success. My configuration for gmail is the following:
Does anyone knows if this is a bug or if something has change that made this integration to stop working? Do you see any problem with my configuration above?
If you are using an smtp server with normal authentication mechanisms (effectively bypassing 2 factor authentication) you need to have (the less secure) app passwords set up. The app passwords are reset when you change your Google password, or something else may have changes security to be stricter. https://support.google.com/mail/answer/185833?hl=en
I do not have 2-factor authentication enabled I only use the normal username and password authentication method.
I believe you must be correct on your assumption since also on my iphone now I am getting authentication errors when trying to connect throughout caldev calendar on google so probably google must have changed something.
through google? Is the code above correct and I should simply enable 2-factor authentication on my google account and then instead of password use an app password instead?
Google is making 2 factor authentication required (for my family it already is) and forcing apps to use secure methods too, such as OAuth2. I would not expect them to be this strict for smtp to this soon, so hopelully you can still create an app password for that.
I was able to create and app password and enable email capabilities in home assistant.
For now I can confirm that the above code with a app password (instead of the actual gmail password) works fine.
You just have to make sure you enable 2-factor authentication in gmail before you can create an app password for an app.
So how did you get the smtp service to initialize Home Assistant with Gmail after turning on 2FA?
Iām unable to do it and get it initialized getting a Failed to initialize notification service smtp error in the logger and email notifications are of course still broken
Source: components/notify/legacy.py:77
Integration: Notifications (documentation, issues)
First occurred: 12:17:34 PM (1 occurrences)
Last logged: 12:17:34 PM
FWIW, I encountered the same issue and mitigated it by switching the email account from using gmail to outlook (which still permits authentication via username and password).