Email Configuration Error

yes

Screenshot_20230327_210348

Hi PCR,
any solution regarding this ,

without port no and Tls , i configured it before and also get email notification .but after changes in yml regarding storage issue ,its not working

I didn’t actually update to the latest version, so it’s better if we wait for a comment by someone from the team

Hi,
Thanks for your support , i tried many options and deploy in new machine also (old yml file)
, Getting same error .

Actually need to show in presentation this feature.

If you guess anything pls share

Thanks

Tried few more things:
-apparently i’m able to make it work only with another smtp, with Google it’s not working. Tried a few combinations with/without STARTTLS or SSL but nothing happens. Other SMTP with exact same configuration works

Hi @pcr,
unfortunately I do not get it to work either. Which SMTP did you use? Can you maybe give me some example values to fill in my docker-compose.yml, which you see in the following?

  manager:
#    privileged: true
    restart: always
    image: openremote/manager:${MANAGER_VERSION:-latest}
    depends_on:
      keycloak:
        condition: service_healthy
    environment:
      OR_SETUP_TYPE:
      OR_ADMIN_PASSWORD:
      OR_SETUP_RUN_ON_RESTART:
      OR_EMAIL_HOST:
      OR_EMAIL_USER:
      OR_EMAIL_PASSWORD:
      OR_EMAIL_X_HEADERS:
      OR_EMAIL_FROM:
      OR_EMAIL_ADMIN:
      OR_HOSTNAME: ${OR_HOSTNAME:-localhost}
      OR_ADDITIONAL_HOSTNAMES: ${OR_ADDITIONAL_HOSTNAMES:-}
      OR_SSL_PORT: ${OR_SSL_PORT:-}
      OR_DEV_MODE: ${OR_DEV_MODE:-false}
      OR_DB_HOST: ${DATABASE_URL}
      OR_DB_PORT: ${DATABASE_PORT}
      OR_DB_USER: ${DATABASE_USERNAME}
      OR_DB_PASSWORD: ${DATABASE_PASSWORD}

I made it work with this
The smtp is provided by a local national hosting site
If I try with my Google Workspace account, same configuration, it doesn’t work

One thing I noticed, but not sure if it’s useful, is that I get the “must issue STARTTLS command” if I write the variables like this
OR_EMAIL_USER: my@email.com
Instead if I write it as
OR_EMAIL_USER: ${OR_EMAIL_USER:-my@email.com}
I get the error
Error processing from REALM_RULESET - NOTIFICATION_HANDLER_CONFIG_ERROR (Handler is not valid: email): Notification{name=‘null’, message=org.openremote.model.notification.EmailNotificationMessage@1e26a3b7, repeatFrequency=null, repeatInterval=‘null’, targets=[Target{type=USER, id=xxxx}]}
I’m wondering if he’s getting some values from somewhere else that bugs it? From what I understood the parenthesis should mean "use the variable, otherwise by default value is the one following :- "

yeah same thing is happening with me

hi @Don any missing configuration here

Thanks for your answer, but unfortunately it still does not work.

I used:

  manager:
#    privileged: true
    restart: always
    image: openremote/manager:${MANAGER_VERSION:-latest}
    depends_on:
      keycloak:
        condition: service_healthy
    environment:
      OR_SETUP_TYPE:
      OR_ADMIN_PASSWORD:
      OR_SETUP_RUN_ON_RESTART:
      OR_EMAIL_HOST: smtp.web.de
      OR_EMAIL_USER: leoxxx@web.de
      OR_EMAIL_PASSWORD: xxx
      OR_EMAIL_PORT: ${OR_EMAIL_PORT:-587}
      OR_EMAIL_TLS: ${OR_EMAIL_TLS:-STARTTLS}
      OR_EMAIL_X_HEADERS:
      OR_EMAIL_FROM: leoxxx@web.de
      OR_EMAIL_ADMIN:
      OR_HOSTNAME: ${OR_HOSTNAME:-xxx.de}
      OR_ADDITIONAL_HOSTNAMES: ${OR_ADDITIONAL_HOSTNAMES:-}
      OR_SSL_PORT: ${OR_SSL_PORT:-}
      OR_DEV_MODE: ${OR_DEV_MODE:-false}
      OR_DB_HOST: ${DATABASE_URL}
      OR_DB_PORT: ${DATABASE_PORT}
      OR_DB_USER: ${DATABASE_USERNAME}
      OR_DB_PASSWORD: ${DATABASE_PASSWORD}

and get the following error:

Error processing from REALM_RULESET - NOTIFICATION_HANDLER_CONFIG_ERROR (Handler is not valid: email): Notification{name='null', message=org.openremote.model.notification.EmailNotificationMessage@606ab39a, repeatFrequency=null, repeatInterval='null', targets=[Target{type=USER, id=91d45952-e957-44e0-89b0-d72b3ec71abb}]}

Did I do something wrong?

@Don any idea about this? Have you ever configured an SMTP on Google?

I’ve done something with gmail in a different application and I needed a specific key. Something like this I guess: Sign in with App Passwords - Google Account Help

Edit: Oh, you posted that already. That didn’t work?

Yep, it didn’t work
It was the first thing I thought since Google expect those passwords for anything that doesn’t use OAuth2
I suspect there is something wrong with the combination of ports/protocols, but 587 STARTTLS is the standard for Gmail. Maybe someone else in the staff has an instance with gmail or can give it a try?

Hi ,
i am able to send a test mail through keycloak-email test from a non google mail id but from same mail id i cant get alert/notification from rulestate.

But i am unable to send mail from google id , kindly fix this issue .

Thanks

Hi @pcr,
with “Other SMTP with exact same configuration works” you mean that you only changed the SMTP or did you also used another mail address? Cheers

Hi @dimpfelmoser
other mail, other smtp server

ok cool, thank you for the quick answer, try my best.

Apologies for the delayed response.

We had made a change to the mail library used internally and this broke the STARTTLS config option but this was fixed in the past few weeks so make sure you have the latest manager version and STARTTLS will work again.

Hi Apurba,

I am trying with keycloak to test, as in below image but getting error: any suggestion

Hello,
Gmail problem is fixed so you can try with Gmail.

from picture,
give your mail id as a username id and mail password .

Thanks

Yes, this is working thanks a lot.