Email Notification Error

Dear Team,

Right now i am getting below error

Docker-compose file

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.gmail.com
OR_EMAIL_USER: koleyapurba007@gmail.com
OR_EMAIL_PASSWORD: ‘xxxxxxxxxxx’
#xlmu mzjd uooy vkvp
OR_EMAIL_PORT: ${OR_EMAIL_PORT:-587}
OR_EMAIL_TLS: ${OR_EMAIL_TLS:-true}
OR_EMAIL_X_HEADERS:
OR_EMAIL_FROM: koleyapurba007@gmail.com
OR_EMAIL_ADMIN: koleyapurba007@gmail.com
OR_HOSTNAME: 192.168.10.137
OR_ADDITIONAL_HOSTNAMES: ${OR_ADDITIONAL_HOSTNAMES:-}
OR_SSL_PORT: ${OR_SSL_PORT:–1}
OR_DEV_MODE: ${OR_DEV_MODE:-false}

Any help would be appreciated

Hello!

Just to confirm: Are you using an ‘app-password’ as described here?

hi,

yes , using app-password

Looks the same as this? Issue Sending Email Notifications with V1.5 - #2 by Clint

Dear,
thanks for the update …

@martin.peeters pls fixed this issue

Hi!

I can’t “magically solve” this problem without any context.
And I’m also a busy man within OpenRemote, so I don’t have a lot of time to spare. :sweat_smile:

We haven’t seen a lot of people using a custom mail configuration yet.
It should be simple, as all you need to do is setting up the environment variables.
Any problems should be logged during startup of the Manager container.

.
I think we should document this.
So, if someone succeeded to set up the mail server, (with Gmail or another service)
we could add a step-by-step guide to the OpenRemote documentation website.
That’s our best option.

Hi Martin,

The reason is a class incompatibility between the old JavaMail (com.sun.mail) and the new Jakarta Mail (jakarta.mail) libraries.

Thats why i told to fixed :sweat_smile:

I fixed it by removing “javax.mail” from manager container

Thanks

Hello @apurba,

Trying to reproduce the error you mentioned, where did you encountered this?

Hi @denniskuijs

If it helps - I encountered the problem when using a when/then rule to trigger an Alarm with high severity to send an email to an Assignee. The error below was displayed in the logs and removing ‘arm /opt/app/lib/javax.mail-1.5.0.jar’ inside the running Manager container and restarting the container seemed to provide a workaround:

Notification failed ‘16353146’: Target{type=CUSTOM, id=to:xxxxx@xxxxxx.net.au}, reason=NotificationProcessingException{reason=SEND_FAILURE, message=‘class com.sun.mail.handlers.text_html cannot be cast to class jakarta.activation.DataContentHandler (com.sun.mail.handlers.text_html and jakarta.activation.DataContentHandler are in unnamed module of loader ‘app’)’}

Hello @denniskuijs

While trying to set up a rule (when-then) for notification emails, but I noticed that the test email from Keycloak was sent successfully.

Thanks