Email Notifications Driver using Node/sendmail on a PI

By the way....the latest copy still isn't copying the users from my server or sending email. Now it lists the user not found whether or not it is.

As I said a few times now, an actual example picture with no blackouts, would be helpful. I cannot tell what I'm supposed to keep in the example file and what I do not. For example the < and > . Are those supposed to be left or removed?

UPDATE:
AH HA!!!!!!! You have to remvoe the < and > as well as the address!!!!!!! You never said that!!!!!!

Very cool!!! I couldn't imagine what was going on!!! Will update the sample config file to reflect the "real" way to do it.... I need to work on my documentation skills apparently.. :sweat_smile:

So sample file updated to:

module.exports = {
        "someemail@email.com": {authuser: "authuser1@email.com", authpwd: "auth password1"}
        ,"another@email.com": {authuser: "authuser2@someserver.com", authpwd: "auth password2"}
        ,"authuser3@gmail.com": {authuser: "authuser3@gmail.com", authpwd: "auth password3"}
};

Hope this makes it clearer.

E.

Much! Thank you!

Also for completeness I just tested the From: without the domain address part.. so something like this in eml_config:

"someemail": {authuser: "authuser1@email.com", authpwd: "auth password1"}

and someemail in the From spot..

For "smtp (587)" to my email server it did not work so it probably needs to be a full address in both places (config & from) if that makes any sense.

1 Like

@erktrek

I'm having issues setting this up. I've sendmail running on my Odroid (Ubuntu 18.04) for a long time. And I can send email as "xyz.hubitat@gmail.com" directly from the odroid with no issues (authentication is properly setup).

I think I have eml_config.js setup correctly. Here's what it looks like:

module.exports = {
     "xyz.hubitat@gmail.com": {authuser: "xyz.hubitat@gmail.com", authpwd: "xyz_password"}
 }; 

Running "node app.js" starts with no errors, and node binds TCP port 3000.

From my Mac, if I try "curl http://ip_address:3000/email", this is what is returned:

{"AllowedAddrs":["xyz.hubitat@gmail.com"]}

So it would seem like eml_config.js is ok and that app.js is starting up just fine.

However, from within Hubitat, when I setup a DoNS-MyEmail device, I get an error when I click on "Save Configuration" and the authuser doesn't show up under Current States. Here's the error:

[dev:1733](http://192.168.1.36/logs#dev1733)2019-08-31 08:09:14.584 [error](http://192.168.1.36/device/edit/1733)java.lang.Exception: No response data exists for async request on line 81 (httpGetEmlList)

Here's the Hubitat configuration. Obviously, I'm doing something wrong. Can you help me fix it please?

THANK YOU!

Is your firewall on your Odroid blocking access to port 3000?

No, I'm not running a firewall on the odroid.

Also, I can retrieve http://192.168.1.4:3000/email from my Mac. And what is retrieved looks ok:

{"AllowedAddrs":["xyz.hubitat@gmail.com"]}

Edit: retrieved ok using curl and Safari

Try putting "xyz.hubitat@gmail.com" in the From user...

I did - that was a typo when I was making the screenshot.

Edit - I'm really puzzled by this. Any server side logs that could help?

That is odd... I'm looking into it now. I'm now using sstmp... so haven't looked at sendmail in a bit.

1 Like

This is all that's seen on the server:

odroid@odroid:/opt/hubitat/Hubitat-DoNS/DoNetStuff$ node app.js

Created route: /email for controllers/email/index.js
Server running on port 3000

When I retrieve 192.168.1.4:3000/Email, the following additional line is added:

xyz.hubitat@gmail.com

So the "sendmail" part is the simplest - it actually doesn't use eml_config.js for lookups at all. I changed my device from "ssmtp" to "sendmail" and was able to send test entries just fine. My configuration looks exactly like yours. hmmmm

I'm using sendmail because I can't use smtps because that port is bound to the loopback address on my odroid.

odroid@odroid:~$ netstat -tan | grep 587
tcp 0 0 127.0.0.1:587 0.0.0.0:* LISTEN

I can bind smtps to 0.0.0.0 and try again.

Dang. Something is wrong with my setup. I wish I knew what.

Maybe add the full URL like:

http://192.168.1.4:3000/email

?? I know that's a trivial thing but.. that's the way mine looks.

Same error :frowning:

And your hub is on the same subnet? - not that it should matter of course.

Yes. On the same switch.

Let me get smtps to bind to 0.0.0.0 - give me 5 minutes. GOing to rebuild sendmail.cf