Another hubitat email question (using SMTP)

I just got a Hubitat C-7, but am already lost.
How can I send out SMTP email messages for notification purposes, from this device through an SMTP server I control? I have all of the server details, but don't know what procedure to use, to do it. I'm seeing screenshots of a GUI, but can't find it. I also have read about importing your own email handler.

Yes, I am aware of the Hubitat mobile app (it's not working on my phone, probably because of its Google trackers), Pushover, and sharptools. No thanks.

I also have come across this thing: [https]://github[dot]com/adsavia/Hubitat-DoNS (claims to be in the Hubitat package manager, but I'm not seeing it)
As well as this sendmail V2 implementation: [https]://github[dot]com/lgkahn/hubitat/blob/master/sendmail%20V2
But I don't know how I would add/use them in this case. I just want to send SMTP email. Through an email server. Which I own. But that is stunningly complicated, it seems.

Note also that I'm okay with message handling in the clear, if it must be so. I'll be using a dedicated email account and other controls to limit the risk.

Any advice?
Thank you!

You can find instructions on how to install and use @kahn-hubitat's sendmail driver over here:

You can find instructions on how to install and use @erktrek's email notification driver (Hubitat-DoNS) here:

Note that @erktrek's driver supports encryption, but requires something like an RPi to run on your local network to run a nodeJs server.

While I use @erktrek's implementation, they are both easy to setup and will create devices that work as Notification devices that can be used for notifications within your automations.

1 Like

@aaiyar thanks for the quick reply. I am trying to avoid having yet another local server, and am willing to sacrifice encryption to go that route.
Apparently I'm not getting it, because I saw the sendmail post, but am not understanding what to do with it. I tried importing the whole blob into Hubitat as a new app, but it threw an error when I tried saving it:
No signature of method: Script1.attribute() is applicable for argument types: (java.lang.String, java.lang.String) values: [lastCommand, string] on line 65

It sounds like either I missed a step, or this isn't script kiddie compatible.

Aha. It is not an app. It is a driver for a device. So save it as a driver. Then create a virtual device and assign the newly created driver as its driver. Configure the virtual device as described in @kahn-hubitat's instructions.....

1 Like

Ok, that was a stupid mistake. I got it added as a driver, and created a virtual device.

I'm still struggling to figure out how to use it, though. Can it be selected through Rule Machine somehow? I'm not finding it, but with so many options, I'm probably overlooking it.

1 Like

Yes.

2 Likes

What Google trackers?

1 Like

crashlytics[dot]com mainly, although it also uses googleapis[dot]com

Both are offered by Google so they can harvest user data.

@aaiyar Thank you again, I found it!

Please bear with me, but I'm getting an error still. The SMTP server is returning HTTP 421, so something isn't right. I know this email server works, because I use it for a bunch of other stuff as well. I'm currently connecting to the non-TLS port (2525, in my case), although just in case I got really lucky, I also tried the TLS port. Any thoughts on what might be misconfigured?


(you can see them getting backlogged here, as I was doing some other testing.)

Thank you!

That’s not the integration I use - I use @erktrek’s. I would recommend posting your question in the parent thread for @kahn-hubitat’s driver.

1 Like

If I had to guess based on the error code being an SMTP error code, the internet says:

“421 – Your message was temporarily deferred by the recipient server. This is usually a result of too many connections in a short timeframe or too many messages.”

It sounds like your smtp server may be rejecting the messages.

But like @aaiyar mentioned you are likely to get better help from others using the same driver by posting in the developers thread.

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.