Email Notifications Driver using Node/sendmail on a PI

can you send an email to your isp or are they blocking you.. if you can send an email from your computer to your isp with a username and password.. you can use my sendmail device i wrote awhile ago and just posted..

alternatives are twillio etc.. most cell phone providers have a email to text gateway. here is an example of using my native hubitat sendmail to send myself text messages via a email server to at&t

1 Like

sorry i wasnt more helpful i dont use webcore, only rule machine and event engine, etc. if you are already using webcore the solution above for its mail gateway sounds best.

OK, it's been a few days, and I've been able to spend some more time with php and sendmail and XAMPP / Apache.

I have sendmail working as I can send myself an email using the computer / webserver that is running XAMPP, Apache, php, and sendmail. So I know that works just fine.

Now, I've setup the Hubitat DoNetStuff, but I'm getting "status of post call is: 408"

Would love some help please from this group.

408 is an HTTP request timeout. It would appear that the node server for DoNetStuff is not running (or not listening to TCP port 3000).

On the computer running DoNetStuff, can you post the output of:

ps ax | grep DoNetStuff

and

netstat -tan | grep 3000
(On OS X: netstat -p tcp -an | grep 3000)

I'm running the DoNetStuff on a windows box (Win 7 x64). I've changed the DoNetStuff to run on port 5000 (I'm pretty sure).

I've modified the app.js file to change from 3000 to 5000

I've modified the DoNetStuff.service file from port=3000 to port=5000

Working directory is set to "C:/Notification"

Execstart is set to "C:/Program Files/Notifications/npm start"

I know nothing about Windows, so I have a couple questions:

  1. Have you confirmed that DoNetStuff is running and listening at TCP port 5000?
  2. Have you configured @erktrek's Hubitat driver to use port 5000 instead of 3000?

Ohh...not the driver. Not sure how to do that, but I'll search the groovy code for "3000"

And I'm not sure how to check if DoNetStuff is actually running

from a command prompt telnet to that port and see if you get a response or it times out..

1 Like

You don't have to edit the driver. It is a configuration preference.

Screen Shot 2020-11-25 at 5.57.07 PM

When you set the DoNetStuff Email URL, you can also specify the port number ....

I typed "telnet 5000, and was told "could not open connection to the host, on port 5000"

So, it seems I have some issue here....

When I try the device notification, I get an error in the logs

"java.lang.Exception: No response data exists for async request on line 81 (httpGetEmlList)"

Not sure what that means.....then, a second or two later, the 408 notice comes up

The node server isn't running. So there's no listener on TCP 5000. Which also explains this error:

THAT NOT the syntax.. look up the usage of telnet
it is telnet the ip then the port

1 Like

whoops...fat fingered the reply...

typed: "telnet xxx.xxx.xx.xxx 5000"

2 Likes

yep then i agree it is not running at minimum it should hang on a blank screen if running

ok, I forgot to type "npm start" in the folder....just did that and that shell says "server running on port 5000"

now when I type "telnet 192.192.5.100 5000" the shell just hangs....apparently like it should.

email URL is: 192.168.x.xxx:5000/email
service is: smtps(587)

2 Likes

now if not working there should be a log file in thenpm directory or in thewindows event log depending on how it is implemented. I also have n o experience with it.. I run npm on one of my qnaps for the alexa tts cookie refresh but that is as far as my experience goes.

hmmm...ok. I looked around for some log file, but came up with nothing.

Perhaps someone else on this page may have some ideas. I very much appreciate the help. I feel like I'm a little further already.....one or two steps remain (I hope is all).

Hello! Yeah make sure your windows firewall is not blocking the port either.

1 Like

I've paused the firewall....still no love....

I cannot get the Hubitat to send the email....only can do it from the windows machine that is running php and sendmail....