If you want to receive status updates from your Debian or Ubuntu system in your inbox, you need to employ the help of a mail tansfer agent (MTA). nullmailer is a relay-only forwarding MTA that can be used as an alternative to more complex MTAs such as Exim, Sendmail or Postfix. Instructions for setting up Exim are available for comparison.
nullmailer can be configured to use Fastmail as a smarthost and hence ensure the deliverability of your messages. In principle, these instructions should also be applicable to service providers other than Fastmail.
In the following example configuration,
debian is the hostname,
bookworm the local username and
email@example.com the Fastmail username.
Log into your Fastmail account and set up a new app password for SMTP authentication.
Create the new directory
/etc/nullmailer and the file
$ sudo mkdir /etc/nullmailer && sudo nano /etc/nullmailer/adminaddr
Your Fastmail username is the only entry in
Install the required packages.
$ sudo apt-get install --yes nullmailer mailutils
Perform the initial configuration using
nullmailer at any time after the initial installation using the following comand.
$ sudo dpkg-reconfigure nullmailer
Setting the mail name
Set the system mail name. If you are setting up on a home network, you should use
home.arpa as the domain name.
Configuring nullmailer Mailname of your system: debian.home.arpa Ok
Configuring the smarthost
Set the Fastmail server as the smarthost. Use the app password you set in Step 1.
Configuring nullmailer Smarthosts: smtp.fastmail.com smtp --port=587 --auth-login --starttls --firstname.lastname@example.org --pass=password Ok
Test your configuration with the following command.
echo "Test mail from nullmailer on debian.home.arpa to the local root user and forwarded on to Fastmail" | mail -s "Test nullmailer" root
Check your Inbox, Linus!