[SOLVED] Trouble configuring SMTP in mail binding

I have just upgraded from 2.4 to 2.5 on my very fresh OpenHAB installation, as I’m a newbie with respect to OpenHAB. I am trying to configure an SMTP server in the mail binding. If I try this via PaperUI, the security protocol parameter does not list any alternatives at all. Note that I am running this in a UI switched to German, so this may be something like a missing translation or similar.
Therefore I have tried to configure the SMTP server in a ‘thing’ configuration file just as given in the example of the binding documentation. In this case I get the following errors in openhab.log:

2019-12-17 09:38:41.418 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘mail.things’ has errors, therefore ignoring it: [1,7]: no viable alternative at input ‘smtp’
*[1,14]: no viable alternative at input ‘hostname’ *
*[1,46]: no viable alternative at input ‘sender’ *
*[1,85]: no viable alternative at input ‘security’ *
*[1,101]: no viable alternative at input ‘username’ *
*[1,142]: no viable alternative at input ‘password’ *
[1,162]: no viable alternative at input ‘port’

The configuration line is this (personal data replaced)
Thing smtp [ hostname=“mail.mnet-online.de”, sender=“my@email.address”, security=“TLS”, username=“my@email.address”, password=“xxxx” port=“587”]

What am I doing wrong?

1 Like

The example in the documentation begins …

Thing mail:smtp:samplesmtp [

This has meaning - mail identifies the binding, smtp identifies the feature of the binding, samplesmtp is just a name that you can choose for your Thing e.g. “mymnet” instead

So your Thing doesn’t know it’s supposed to be used with the mail binding.

Thanks for your quick reply. That makes perfectly sense and it works as well :slight_smile:
Do you have any idea, why the PaperUI does not work for configuration of this thing?

I do not. You could raise a Github issue for that - it might be language related as you suggest. Offering descriptions in languages is part of the binding.

I just created Issue 6612 for this.

If you are using mail v1 it is now a legacy binding as per theRelease Notes. see Breaking Changes section.

v1 bindings do not use Things.

1 Like

Hi try that. Add a comma after the password and before the port.

username=“my@email.address”, password=“xxxx”, port=“587”]

1 Like