• You've been granted Beta access to this site, allowing you to explore some of the new features while they're still under construction. More information can be found in the Beta forum.

Email notifications

pete_c

Guru
This post will review how to configure an STunnel proxy and use Google Mail with it. This will work with your Omnipro 2 panel, Elk panel, Home Assistant, OmniLinkBridge plugin, Homeseer, Homeseer OmniPlugin or any automation you have running on your local LAN. Will post another one for using Office 365 Outlook mail. A few months ago switched from GMail to personal Email paid service. The personal email service was working fine until they switched to Office 365 Email. So I switched back to using Gmail notifications.

For Automation / Security here have used:

1 - Google Mail
2 - Outlook Mail
3 - personal Email server

Sending out mostly texts relating to status of security these days.

1 - TMobile ==> [email protected] 2 - AT&T ==> [email protected] 3 - Verizon ==> [email protected]


Switched from Google Mail to personal email server a few months ago and noticed that my personal email service got switched over to Office 365 last week. I was notified of the changes about a month ago.

My automation / security here runs mostly in Linux. For many years have used STunnel and today using STunnel4 on one Linux box.

I point all automation / security boxes to the Ubuntu server port 25 for SMTP mail. I do not do any pop or incoming mail with any automation server or security stuff.
This works fine with any Debian box you have on line (like an RPi). You can also install STunnel in Windows. This post will only cover Linux installation.

Old way

sudo apt update
sudo apt install stunnel4

New way

sudo apt update
sudo apt install snapd
sudo snap install stunnel5

There are examples on your /etc/stunnel/ configuration out there in Internetlandia. Use the following for GMail configuration.

After installation you want to create a certificate file called stunnel.pem

openssl genrsa -out key.pem 2048 openssl req -new -x509 -key key.pem -out cert.pem -days 1095 cat key.pem cert.pem >> /etc/stunnel/stunnel.pem

There are examples on your /etc/stunnel/ configuration out there in Internetlandia. Use the following for GMail configuration.

nano /etc/stunnel/stunnel.conf

I am having issues with this post.
 
Last edited:

pete_c

Guru
Continuing this post here:

I cannot post the configuration file used for Stunnel here ...keeps erroring out.

Here is an image of the configuration file:

stunnelconfiguration.jpg

After the above you want to enable STunnel.

nano /etc/default/stunnel4
Put this in the file:
ENABLED=1

Then you want to enable and start the stunnel service

systemctl enable stunnel4.service
systemctl start stunnel4.service
systemctl status stunnel4.service

If you have a typo in the configuration then when you look at the status you will see that the service has exited.
That is all you need to use STunnel. (not really).

Configuring any automation device on your network to use SMTP mail do the following:
1 - SMTP mail address ==> IP of STunnel box and use port 25
IE: 192.168.244.174:25
2 - use your gmail address and password

Send out a test email and you will see "incorrect" password in the logs for GMail.

GMail authentication has changed and now you need a application specfic password for non standard device authentication.

I used name and password and copied this over to a text file.

1 - log in to Google
2 - go to Google Account settings
3 - Go to security - App passwords
4 - add a new app and you will be given a new password. Call the app anything you want. I saved the password such that I could use it multiple times.
5 - now reconfigure your smtp gmail login on any app and use this new password. Send a test email and you will see it working fine.
GoogleAccount.jpg
Security-2.jpg
 
Last edited:
Top