E-Mail Notification failed

Hi @deputy-chief-hardy,

this is strange, how do you start the docker?

Grüße nach Karlsruhe.

No idea how this is working, I’m always getting the same error (and my hostname is an fqdn so is not localhost)

did you tried it without expressions?
just:

OR_EMAIL_HOST: smtp.web.de
OR_EMAL_USER: test@test.de
OR_EMAIL_PASSWORD: xxxxxxxx

Same thing

manager_1     | 2023-04-17 11:07:45.569  WARNING [Messaging-NotificationQu..e-26] manager.notification.NotificationService : Error processing from REALM_RULESET - NOTIFICATION_HANDLER_CONFIG_ERROR (Handler is not valid: email): Notification{name='null', message=org.openremote.model.notification.EmailNotificationMessage@1e7e85fc, repeatFrequency=null, repeatInterval='null', targets=[Target{type=CUSTOM, id=my@email.com}]}

this is only with Google Workspace, on another mail domain I could send without problems

show your docker-compose.yml pls :slight_smile:

This is from the other post where we discussed this issue
Let me know if you want the full yml

you sure you tested it this way too?

`   environment:
      OR_SETUP_TYPE:
      OR_ADMIN_PASSWORD:
      OR_SETUP_RUN_ON_RESTART:
      OR_EMAIL_HOST: my.smtp.com
      OR_EMAIL_USER: my@username.com
      OR_EMAIL_PASSWORD: mypassword
      OR_EMAIL_PORT: ${OR_EMAIL_PORT:--1}
      #OR_EMAIL_TLS: ${OR_EMAIL_TLS:-STARTTLS}
      OR_EMAIL_X_HEADERS:
      OR_EMAIL_FROM: my@username.com
      OR_EMAIL_ADMIN: 

I just tried it when you asked me few minutes ago (except for port 1, you can’t really send on port 1?)
I need to try to comment TLS option, but i’m pretty sure Google will refuse it, give me a min

Google doesn’t allow it.


 environment:
      OR_SETUP_TYPE:
      OR_ADMIN_PASSWORD:
      OR_SETUP_RUN_ON_RESTART:
      OR_EMAIL_HOST: my.smtp.com
      OR_EMAIL_USER: my@username.com
      OR_EMAIL_PASSWORD: mypassword
      OR_EMAIL_PORT: ${OR_EMAIL_PORT:-587}
      OR_EMAIL_TLS: ${OR_EMAIL_TLS:-true}
      OR_EMAIL_X_HEADERS:
      OR_EMAIL_FROM: my@username.com
      OR_EMAIL_ADMIN:

could also try 465 instead of 587

yes but i’m using app-specific password

So I tried this configuration with 587, 465 and even regenerating the password, nothing works.
Fun fact: Google doesn’t even show the password as used

I am using GoDaddy mail, and it worked .

Try another domain , i also face same problem from gmail.

I already make it work with another domain, but that’s not the point of course. We are trying to make it work with Google

Hi @Denis , I started Docker via docker-compose -p openremote up -d

Grüße zurück :smiley:

Apologies, please see this thread:

Hi Rich
did another pull, but still no luck with Google

tried with this

      OR_EMAIL_HOST: gmail.smtp.com
      OR_EMAIL_USER: myemail@domain.com
      OR_EMAIL_PASSWORD: xxxxxxxxxxxx
      OR_EMAIL_PORT: ${OR_EMAIL_PORT:-587}
      OR_EMAIL_TLS: ${OR_EMAIL_TLS:-true}
      OR_EMAIL_X_HEADERS:
      OR_EMAIL_FROM: myemail@domain.com
#      OR_EMAIL_ADMIN: ${OR_EMAIL_ADMIN:-myemail@domain.com}

and this

      OR_EMAIL_HOST: gmail.smtp.com
      OR_EMAIL_USER: myemail@domain.com
      OR_EMAIL_PASSWORD: xxxxxxxxxxxx
      OR_EMAIL_PORT: ${OR_EMAIL_PORT:-587}
      OR_EMAIL_TLS: ${OR_EMAIL_TLS:-STARTTLS}
      OR_EMAIL_X_HEADERS:
      OR_EMAIL_FROM: myemail@domain.com
#      OR_EMAIL_ADMIN: ${OR_EMAIL_ADMIN:-myemail@domain.com}

The error is always the same
manager_1 | 2023-04-26 09:50:21.456 WARNING [Messaging-NotificationQu…e-26] manager.notification.NotificationService : Error processing from REALM_RULESET - NOTIFICATION_HANDLER_CONFIG_ERROR (Handler is not valid: email): Notification{name=‘null’, message=org.openremote.model.notification.EmailNotificationMessage@1d9e8e96, repeatFrequency=null, repeatInterval=‘null’, targets=[Target{type=CUSTOM, id=myemail@mydomain.com}]}

edit: app-specific password still shows as never used on Google side

You need to look at the startup section of the logs, when the EmailNotificationHandler is initialised it tries to connect to the SMTP server and there you should see more information about the failure.

Seems like he doesn’t like my credentials, but I tried with two different passwords
I’ll try to investigate more, I really don’t understand what’s wrong

manager_1     | 2023-04-26 10:36:42.026  SEVERE  [main                          ] er.notification.EmailNotificationHandler : Failed to connect to SMTP server so disabling email notifications
manager_1     | org.eclipse.angus.mail.util.MailConnectException: Couldn't connect to host, port: gmail.smtp.com, 587; timeout -1;
manager_1     |   nested exception is:
manager_1     |         java.net.UnknownHostException: gmail.smtp.com
manager_1     |         at org.eclipse.angus.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2258)
manager_1     |         at org.eclipse.angus.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:753)
manager_1     |         at jakarta.mail.Service.connect(Service.java:364)
manager_1     |         at jakarta.mail.Service.connect(Service.java:222)
manager_1     |         at jakarta.mail.Service.connect(Service.java:171)
manager_1     |         at org.openremote.manager.notification.EmailNotificationHandler.init(EmailNotificationHandler.java:106)
manager_1     |         at org.openremote.container.Container.start(Container.java:162)
manager_1     |         at org.openremote.container.Container.startBackground(Container.java:207)
manager_1     |         at org.openremote.manager.Main.main(Main.java:31)
manager_1     | Caused by: java.net.UnknownHostException: gmail.smtp.com
manager_1     |         at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567)
manager_1     |         at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
manager_1     |         at java.base/java.net.Socket.connect(Socket.java:633)
manager_1     |         at java.base/java.net.Socket.connect(Socket.java:583)
manager_1     |         at org.eclipse.angus.mail.util.SocketFetcher.createSocket(SocketFetcher.java:361)
manager_1     |         at org.eclipse.angus.mail.util.SocketFetcher.getSocket(SocketFetcher.java:236)
manager_1     |         at org.eclipse.angus.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2208)
manager_1     |         ... 8 more
manager_1     | 2023-04-26 10:36:42.028  INFO    [main                          ] er.notification.EmailNotificationHandler : SMTP credentials are not valid so email notifications will not function

Looks like you’ve got your host the wrong way around should be smtp.gmail.com

1 Like

I can’t believe myself right now, gonna cry in a corner