Mail.cfg possibly truncating password that contains hash symbol

I’m on openhabian and I added the mail action.

I set up the mail.cfg file and it does attempt to send bt I get in the OH log:

Username and Password not accepted

When editing the mail.cfg, in vscode the password= the accounts password has a # in it. Everything after the # gets colored as a comment. I’m wondering if OH sendMail is truncating the password at the #?

I tried wrapping it with “pwd” and ‘pwd’ neither worked…


That seems very likely.
Have you tried changing the password?

You can try escaping the # using \# or you can’t have a # in your password.

is the comment symbol and everything after that will be treated as a comment.

I will try the escape.

But, if it doesn’t work that way, it is far easier to just use the mail node in node-red (since this is where I’m sensing the event anyway) than it is to change passwords on devices all over the place to accommodate OH.

The node-red mail node does handle the # character just fine.

Shame if OH has this restriction, since there are other things that would be nice to get emails about.

You could log an enhancement request for the mail action. It may not be easy to fix, if it involves parsing legacy cfg files. But at least it will get recorded for anyone developing a true v2 mail binding/action.

I’d recommend ssmtp as an option. It’s simple and light weight, can be called from OH using executeCommandLine or the Exec binding, and because it is installed you can get all sorts of useful info from the OS like failed logins, disk health and status, tripwire reports, etc which would never be available from OH or Node Red.

FTR, OH1 is the wrong tracker for this. I was able to verify that passwords containing the # are received correctly by the binding in 2.3.0 RC1.

Perhaps this is an openhabian problem.

The code that reads in and parses the config files is probably maintained on Eclipse Smarthome. All the bindings use common code to get their configs.