Stunnel to Gmail on Fedora 20 with systemd
Posted on Monday Jan 25, 2016 at 06:24PM in Linux
I have some devices in my network that are not capable of SSL email required by Gmail accounts. No problem stunnel can easily wrap the messages in SSL from GMail. Stunnel can do soooo much more, but for this simple usage, the setup is very easy.
1) yum install stunnel
2) edit the /etc/stunnel/stunnel.conf to look like...
|client = yes
accept = YOURSERVERIP:465
connect = smtp.gmail.com:465
Make sure to change YOURSERVERIP to your own IP addr.
3) create a systemd.service file to start and autostart stunnel at startup:
Description=Stunnel SSL Tunnel
# Give a reasonable amount of time for the server to start up/shut down
4) Start stunnel with systemctl start stunnel.service
5) enable it to autostart systemctl enable stunnel.service
6) send a test email, but point your client at YOURSERVERIP with your Gmail user password.
Works for me!