I gotta admit, this is a bit of a weird one. I'll explain...
I finally got the ethernet cable connected to my Onan Cummins backup generator. This thing has a web interface that duplicates the control panel. Handy for some things, but to get any kind of almost real time notifications I'd need to poll the index page and screen scrape the HTML. Something I'll probably do at some point, but not right now.
It also will send emails when any kind of event happens. Great. Except it's a stupid micro-controller and doesn't know how to do encrypted connections to an SMTP server. And I wasn't really happy about (1) sending my email authentication info in the clear and (2) depending on external email servers. If it's the generator reporting things, there's a fair chance that my Internet connection is down.
So, I needed to set up an SMTP server on my LAN that the generator could talk to. I could have done that on my Indigo server, or my Synology file server. But then I got the bright idea to write a plugin that was an SMTP server. So I did.
This thing is dead simple. In the configuration dialog, you specify the port you want the server to listen on, and a username/password pair for your email client to use to authenticate. That's it. There's no devices and no actions. When an email is sent to the server (any email), an Event is triggered and the To/From/Subject/Text of the message are stored in variables that the plugin creates. Currently, I have my Twilio plugin send me an SMS with the Text of the email I get from the generator.
One gotcha (maybe) - this particular device (the generator) won't connect to an IP address. So you need a hostname for the email server (Indigo) machine that it can resolve. I have a DNS server on my Synology box, so I set up the generator's network to use it for DNS, and used a hostname there that resolves to the Indigo box. In the email setup for the device, you specify the hostname (or IP address) of the Indigo server, the port number you specified in the plugin config, and the username/password also specified in the plugin config. What you actually put on the email for From and To addresses is irrelevant. ANY email sent to the plugin will trigger the event. And there is NO forwarding from the plugin. Use BetterEmail or the built in email sender to forward the message if needed.
Download from: https://github.com/FlyingDiver/Indigo-S ... tag/v0.0.1