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

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

Fix provided here :

1 Like

Fix just got meged and will be part of the next SNAPSHOT and upcoming Milestone…

2 Likes

thanks how do I know when its available or check what version this fix is in…
I have version 3.2.0 and bug is still there so I assume that fix isn’t here yet?

No, it is available beginning openHAB 3.3.M5
That‘s what i posted earlier.

Seems like the issue is still here - noticed this on 3.3.0 (Release).

javax.mail.MessagingException: IOException while sending message;
  nested exception is:
	javax.activation.UnsupportedDataTypeException: text/plain; charset=UTF-8

Funny thing is, I didn’t notice mail to be failing because it works normal on my startup scripts which are sending out emails at start level 80. So it seems something is broken later on…

Can you please post the rule you are using ?

That’s simply a script triggered when start level has reached 80

val mailActions = getActions("mail", "mail:smtp:SMTP_PMTECH")
logInfo("notifications", "Initialisierung: Sending notification via mail.")
mailActions.sendHtmlMail("juchee@daham.at", "openHAB started", "<h1>Restart</h1>openHAB DAHAM has just restarted.")

It’s working fine but once the system is finished starting up this fails with the error mentioned.

Edit: Note this is only happening with Html - sendMail is fine.

UPDATE:
Did some testing around and found that it got nothing to do with the system state.

The error occurs ONLY when you test-run a rule or a script manually (Ctrl-R or Play Button).
If the script is triggered by the rule itself, everything works fine.

So that’s how it can be reproduced.