I have a rule that sends mails using OH 2.x using mail actions. This is done via smtp and google mail and used to work fine in the past.
Recently, this has stopped working. Mails are not sent anymore and everytime a mail shall be sent the following entry appears in the log:
2021-07-12 23:26:37.178 [WARN ] [ab.binding.mail.internal.SMTPHandler] - Sending the email to the following server failed : smtp.gmail.com:587
2021-07-12 23:26:37.180 [WARN ] [ab.binding.mail.internal.SMTPHandler] - javax.mail.AuthenticationFailedException: 535-5.7.8 Username and Password not accepted. Learn more at
(The “learn more” link does not help here).
I wonder what has changed and what can I do about it. I also don’t think that I am the only one using gmail with Mail Actions so this problem has probably also appeared for other users?
Thanks a lot,
One additional comment: The “access for less secure apps” in Gmail is already active. This does not help.
G**gle requires you to use app passwords/tokens to relay mail. Not an OH issue. Search over at gmail.
This happened to me in OH3 and might be the same for you.
If I have to re-install the binding again after removing I will have to remember to make the new binding the same as the old binding UUID. E.G mail:smtp:a514b96247 and if I do that then I won’t have to go and change all my rules.
Did you try to set a new application password ? Could be that google does not accept it to be a valid one. The other problem could be outdated encryption methods but then I would expect to see an other error message. Sending mails via OH via gmail still works although I must say that my test was done with OH3.
I tried setting an application password via google but it does not help. OpenHAB keeps showing the same error message as above.
Does OpenHAB read the new mail.cfg file as configuration at all? I also tried restarting OpenHAB but also no effect.
Depends what you are using. There’s a Mail Action v1 and Mail binding v1 that read file mail.cfg. There’s a Mail binding v2, with Things. channels, and included Actions, that does not use mail.cfg
I’m using the Mail action. The mail.cfg is used, but I cannot tell when the configuration is reread. However, as restarting OpenHAB does not help, it must be a different root cause…