Configure nullmailer with a relay host
If you wish to receive status updates from your Debian or Ubuntu system, you need to install and configure a mail transfer 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.
A relay host, also referred to as a smarthost, can be defined as an email server for outgoing mail that is being afforded a good reputation by its peers. In this example, we use Fastmail because email deliverability depends on a number of different factors.
Configuration of nullmailer with Email Service Providers (ESPs) other than Fastmail should be similar, given that all ESPs implement the Simple Mail Transfer Protocol (SMTP).
Step 1
Generate an app password
Log into your Fastmail account and set up a new app password for SMTP authentication.
Create an alias
Set up a dedicated Fastmail alias to receive incoming messages.
Step 2
Use copy and paste to enter the following commands. Be careful not to miss any punctuation.
Create the new directory /etc/nullmailer and the file /etc/nullmailer/adminaddr.
The Fastmail alias you created in Step 1 should be the only entry in /etc/nullmailer/adminaddr.
Step 3
Install the required packages.
$ sudo apt-get install --yes nullmailer mailutilsStep 4
Enter the system mailname. If you are setting up on a home network, you should use home.arpa as the domain name.
Mailname of your system:
tux.home.arpa
Ok
Configuring the smarthost
Configure nullmailer to use the Fastmail SMTP server as a smarthost. Use your Fastmail username and the app password from Step 1.
Step 5
Test your configuration with the following command.
$ echo "Test mail from nullmailer on tux.home.arpa to the local root user and forwarded on to Fastmail" | mail -s "Test nullmailer" rootCheck your inbox!
Step 6
You can reconfigure nullmailer at any time by issuing the following comand.

Configure nullmailer with a relay host
"If you want to receive status updates from your Debian or Ubuntu system, 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."