Mon 27 May 2019


nullmailer: The ultimate home email not-server

The solution to a growing problem.

Face it - the number of server out there that SHOULD be a mail server is becoming vanishingly small. For a home back office it would be borderline negligent to run your own SMTP server. But decades of tools rely on /usr/sbin/sendmail being a thing.

Enter: nullmailer and a free gmail account

Nullmailer aims to provide all that plumbing without actually running. It is a collection of scripts that are kicked off periodically to drain the mail queues accumulated by a mock /usr/sbin/sendmail and ship them off to gmail and friends.

First you have to create that dummy gmail account and beg for SMTP access:
Google: Let less secure apps access your account

Trying to figure out how to get nullmailer to work is maddeningly difficult. Actually getting it to work is three lines of configuration.

apt-get install nullmailer
cd /etc/nullmailer

echo "garthwaite.org" > defaultdomain
echo "dan@garthwaite.org" > adminaddr
printf 'smtp.gmail.com smtp --port=587 --user="%s" --pass="%s" --starttls\n' \
  'some_new_gmail_account@gmail.com' \
  'trustno1toyourp@assword' \
  > remotes

Almost done. systemd wants its pound of flesh.

systemctl enable nullmailer
systemctl start nullmailer

Be prepared to have all your rootly emails aimed at the account given in /etc/nullmailer/adminaddr!

Go Top
comments powered by Disqus