Mail binding errors sending mail UnsupportedDataTypeException: text/plaijn; charset=UTF=8

Happy new year 2022!

I also have the issues with the binding. No E-Mail is going out.
I am getting this:

==> /var/log/openhab/openhab.log <==

2022-01-02 13:25:17.041 [WARN ] [rnal.service.RemoteControllerService] - Cannot open remote interface (Connection failed)

2022-01-02 13:27:26.597 [WARN ] [rnal.service.RemoteControllerService] - Cannot open remote interface (Unknown response received for access query)

2022-01-02 17:52:42.571 [INFO ] [rnal.service.RemoteControllerService] - Using Legacy interface

2022-01-02 17:59:39.679 [WARN ] [ab.binding.mail.internal.SMTPHandler] - Sending the email to the following server failed : smtp.strato.de:465

2022-01-02 17:59:39.682 [WARN ] [ab.binding.mail.internal.SMTPHandler] - java.util.ServiceConfigurationError: javax.mail.Provider: com.sun.mail.imap.IMAPProvider not a subtype

2022-01-03 07:07:00.905 [WARN ] [ab.binding.mail.internal.SMTPHandler] - Sending the email to the following server failed : smtp.strato.de:465

2022-01-03 07:07:00.930 [WARN ] [ab.binding.mail.internal.SMTPHandler] - java.util.ServiceConfigurationError: javax.mail.Provider: com.sun.mail.imap.IMAPProvider not a subtype

when triggered

==> /var/log/openhab/openhab.log <==
2022-01-03 09:49:22.096 [WARN ] [ab.binding.mail.internal.SMTPHandler] - Sending the email to the following server failed : smtp.strato.de:465

2022-01-03 09:49:22.107 [WARN ] [ab.binding.mail.internal.SMTPHandler] - javax.mail.MessagingException: IOException while sending message;
nested exception is:
javax.activation.UnsupportedDataTypeException: multipart/alternative;
boundary="----=_Part_44_9220965.1641199761607"

Getting the same error with new javascript rules as the one in the post by rikoshak at the top. Strangely it seems to be an intermittent problem for me.

Maybe I found the reason for the mail issue. I’ve reported it to @rlkoshak issue on github. It looks like a class loading issue.

The milestone release 3.3.0-M1 doesn’t seem to have fixed this issue?

It wasn’t in the release notes and the issue is still open so no, it’s not fixed yet.

maybe the mail binding is not the problem?

I have the same problem after a jave update and some strange behavior because some rules are sending mails and some not:

As I already said a month ago: this is an issue with classloading. There is nothing a user can do to fix it. It either requires changes in core or in the binding.

or maybe a java engine problem because i didn’t change anything in openhab.

The only thing i did was after a restart of the server:
apt update
apt upgrade
service openhab start

MiSy, that’s interesting. You might want to post that info in the bug tracker:

Does anyone know the status or even what will be required to resolve this bug? 2 months now. Without emails to get alerts we can’t move forward with OH3 which we really want to do for other reasons.

1 Like

Emails started working last night. I have 3 systems running openHABian OH3. I had a test email rule set to send an email on a time trigger (which wasn’t sending any) on one of these systems. I rebooted that system last night and woke up to a bunch of emails. I paused & unpaused the rule & it continues working. So I copied the rule to the other two systems. One started working, the other did not. I rebooted the one that wasn’t sending emails & it’s now working.

Hello all,

I’m running two different OH3.2 system, with the latest upgrade, which were I have now the same error.
Mail which should send out triggered by a rule will not more send to SMTP.WEB.DE mail server.
The error which I can see in the logfile from OH3 is the following:

No changes on the binding, no changes in the rule, no changes in the password etc…

Any idea what could be the problem?

PS: I tryed with a other public Mailserver (1und1.de). The same error here.

Hey,

i just set up my new openhab (openHAB 3.2.0, Release Build) and installed the mail binding (Mail - Bindings | openHAB). I get the same error like is it decribed in that posting - it does not matter if I use HTML oder plain mail or other smtp-servers / settings.

2022-03-29 13:41:02.104 [WARN ] [ab.binding.mail.internal.SMTPHandler] - javax.mail.MessagingException: IOException while sending message;
nested exception is:
javax.activation.UnsupportedDataTypeException: multipart/alternative;
boundary=“----=_Part_0_525284277.1648554060618”

The Bug reported on github is still open ([Mail] sendMail and sendHtmlFail errors for UI rules · Issue #11838 · openhab/openhab-addons · GitHub)

Are there any news on it?
Does anybody have a solution for that bug jet?

best wishes
Thomas

1 Like

I think the what is wrong is known. How to fix it is still unknown. How to fix it is known but no one has submitted a PR to fix it.

I’ve moved to using other alerting mechanism in the mean time.

I send days ago a mail to one if the maintainer here, Kai Kreuzer.
No feedback, about how it could happen to release a 3.2.0 main release,
which contain such showstopper that sendmail is not working out of the box.
Total unhappy about the status.

which alerting mechanism do you use now?

The openHAB Cloud Connector actions. If I decide I need mail again for some reason and the problem isn’t fixed I’ll use msmtp and the executeCommandLine Action.

There are lots of other options like Telegram also available.

You should demand your money back.
Or perhaps more usefully, volunteer to test new releases?
I doubt that sending emails to developers not responsible for the problem binding will help much.

1 Like

Sorry will not come down on this level of communication, as I deliver all the time all Information
I can share if an error on a stable version comes up.

Just for completeness, sendMail is working in textual rules like

sendmail.rules

val mailActions = getactions("mail", "mail:smtp:domain")

rule "sendMail Test"
       when
               Item MyTestItem changed
       then
               var testmessage = " State of testitem:" + MyTestItem.state
               mailActions.sendMail("sender@domain", "subject", testmessage)
end