Can't get Hubitat-DoNS email sends working on RPi

I flashed a fresh image on my RPi and followed the instructions here: GitHub - adsavia/Hubitat-DoNS. Everything appears to have worked, but triggering a test email in Hubitat is not working (I'm not receiving an email).

I'm using google and created an app password. Here are some screenshots.

Starting app on RPi

eml_config.js

HE Device

When I run this in seperate putty instance:
sudo systemctl status DoNetStuff

I get "Unit DoNetStuff.service could not be found."

Help.

Read --> Hubitat-DoNS/DoNetStuff/misc/systemd at master Ā· adsavia/Hubitat-DoNS Ā· GitHub

2 Likes

Thanks for that. I copied over the service, but still no dice. The process doesn't seem to be getting far enough to hit the google server since my google account is not showing the app password as having been used yet.

Hello and welcome to Hubitat!
First of all, I am no expert in Linux, but I did get this thing to work, so...

  1. Does your sendmail work? That is, is your rpi able to send mail? have you tested it, and is it working? (echo $hostname | /usr/sbin/sendmail -v youremailid@gmail.com)
  2. check to make sure that your DoNetStuff is working?
    sudo lsof -i -P -n | grep LISTEN
    (check to make sure that the port you picked, (e.g.3000) is on.
  3. check to see if/how DoNetStuff has been installed:
    sudo journalctl -xe

Please let us know the results of these checks.

3 Likes

OK, so dumb question. Was I supposed to do any configuration in Sendmail? I selected "google" in the HE Device's "Service" drop-down. Should I select "sendmail" instead?

OK, so I was working with my brother who is a Linux guy, and he had me set up a listener on the Pi on port 1337.

pi@Kessel:~ $ nc -l 1337

I confirmed the listener was working by attempting to telnet into it, and the listener reported that as expected.

I then changed the port in HE device to 1337 and clicked the "Device Notification" button to test it, and the listener isn't picking up anything. So I think the Driver/Device is not actually sending anything to the pi.

So, you have to get sendmail working (for your parameters) BEFORE you do all of this stuff (because if sendmail isn't working, then nothing on the back end will work either).
If you haven't got it working, then may I suggest the following article?
(One last point which isn't mentioned in this article, is that you may have to make the gmail account that is sending the mail able to be used by "less secure apps".)
https://williammcgill.co/2019/how-to-configure-sendmail-to-relay-through-gmail-on-debian-linux-10-buster/

P.S. I'd like to stress that if I, a relative Linux noob, can figure this stuff out, believe me, you can!

P.P.S. I just ordered my 3rd Linux box, a N2+ Odroid beast, so it just shows that you can teach a monkey to eat bananas!

2 Likes

postfix is the default mailer for Rpi so check if its running -- service postfix status

If it isnt then you need to install it

Thanks for the link. I'm reflashing the Pi and going to start over, installing Node, then installing and configuring Sendmail, then following the rest of the steps. Will let you all know what happens. Thanks.

1 Like

You probably only needed postfix installed....

1 Like

The thing that just doesn't make sense, is regardless of getting anything set up or configured, when I press the test button in the HE device, it should send data to the RPi and the listener I had running should pick that up, regardless of what it is, but it gets nothing. I have the new HE C-7. I wonder if that makes a difference at all.

Hello!

I have not tested the code with the new C7 but there is nothing crazy in the groovy code that should make a difference. When I developed this I used a stock Ubuntu server running in a proxmox vm. Sendmail just worked. There was some issues some people were having getting it to work on an RPi but it was some kind of system/config issue.. maybe @aaiyar can remember.

I haven't worked on this in a while as I now use Node-RED. However happy to maintain/tweak it if you find a reproducible bug I can test.

E.

2 Likes

Dude - Iā€™m older. Cut me some slack :rofl:

1 Like

The original term for my wife and I is "geriatric parents" (now called "parents of advanced age")... I am certainly getting there AND I have a teenage daughter who takes the rest of what little cognitive abilities I retain.

You are far too intelligent to fall for me trying to foist this on you apparently,,,

:smile:

1 Like

Thanks for chiming in! I'm running on an old Pi Model B that I had lying around. I do have an Ubuntu VM sitting on my Unraid box that I use when I want to play with linux. I should try booting that up and giving it a try. I just figured the Pi would be less overhead...

It's really very simple - originally I had intended to do more stuff with it DoNS (Do Net Stuff) but as always got distracted.

I think it's also a good template for doing RESTFul things in general.. tried to follow the proper MVC pattern.

If you need help I will be happy to see what I can do.

2 Likes

Might want to check this link out...

http://unixetc.co.uk/2014/11/04/enable-outgoing-mail-on-raspberry-pi/

Warning my google-fu may be weak this evening.. so ymmv

1 Like