Moar e-mail notifications
Recap
So, last time I was able to configure an e-mail notification for the router logins, using my iCloud e-mail and Apple’s SMTP server. This gave me a boost to play around with other equipment and services I have.
Next victim: my Ubuntu VM
I wanted to keep an eye on my Ubuntu docker VM so it was the next logical subject for this experiment. I needed a local SMTP server which is able to use Apple’s SMTP, since I still don’t have the urge to host my own. As a quick solution, Postfix came to mind first, since I’m most familiar with that, but hey - how would a guy learn anything new if he stayed in his little bubble. So, finally I decided on sSMTP.
Installation
Yup, guessed right, just apt install it:
sudo apt install ssmtp
Configuration
Configuring sSMTP is really straightforward, I’ll just dump here the config files.
/etc/ssmtp/ssmtp.conf
|
|
/etc/ssmtp/revaliases
Put an alias in this file so the root user (which will send all of my e-mails) will be mapped to my iCloud e-mail address. Honestly, don’t know if it’s needed but what the hell…
|
|
Testing
You can test the config with a simple one-liner:
echo -e 'Subject: test\n\nTesting ssmtp' | sendmail -v icloud@email.address
Conclusion
After testing it, I went ahead and used this config to receive an e-mail each time the unattended-upgrade cronjob ran. Which reminds me, that could be our next topic.
On the whole, the process was really easy, so I guess it’s time to break something if I want to learn something. Oh, well… Did I mention my shiny, new server died on me? We will have something to talk about next time.