sSMTP is a simple program that punts mail over to a mailhub. I use this on a few Ubuntu hosts. I recently deployed a Raspberry Pi running Raspian that I wanted to enable mail alerting with. I quickly found that it could not send e-mails with sSMTP. At first, I assumed it was my configuration but I investigated and found an issue with TLS handshakes.
sSMTP has a known (and fixed) problem with TLS 1.3 handshakes. According to the changelog, this was fixed in August 2019.
Enabling “testing” on Debian would likely bring more issues than I cared for, so I set out to build a package for my Buster hosts.
Build sSMTP package on Buster
-
Download the files from debian
$ wget http://deb.debian.org/debian/pool/main/s/ssmtp/ssmtp_2.64.orig.tar.bz2 http://deb.debian.org/debian/pool/main/s/ssmtp/ssmtp_2.64-9.debian.tar.bz2 http://deb.debian.org/debian/pool/main/s/ssmtp/ssmtp_2.64-9.dsc
-
Prepare for build
$ tar jxvf ssmtp_2.64.orig.tar.bz2 $ cd ssmtp-2.64/ $ tar -jxvf ../ssmtp_2.64-9.debian.tar.bz2
-
Install build dependencies
- NOTE:
build-essential
is required, but part of raspian lite. You may need to add this to the list.
$ sudo apt-get install po-debconf libgnutls-openssl-dev
- NOTE:
-
Generate a new debian package
$ dpkg-buildpackage -b
Congrats. You now have
ssmtp_2.64-9_armhf.deb
. -
Install the package
$ sudo dpkg -i ssmtp_2.64-9_armhf.deb $ sudo apt-get install -f # If the above complains
-
OPTIONAL Remove build dependencies
$ sudo apt-get autoremove --purge po-debconf libssl-dev