Monthly Archives: February 2013

Using nullmailer as a simple MTA

nullmailer is a very simple MTA I like to use on Linux servers when I don’t want to have a lot of hassle with mail server configuration.

It will automatically send all local mail to one of my email addresses by simply installing it and configuring two files.  The /etc/nullmailer/remotes I put in my smtp server.  Here is an example:

mail.example.com smtp --user=myemail@example.com --pass=examplepassword

For /etc/nullmailer/adminaddr I put the following:

myemail@example.com

All mail delivered to, say, the local root account automatically gets sent to the email address put in the adminaddr file.  Simple and convenient.

Troubleshooting is also simple.  When the email is still in queue, you can see it with command mailq.  It will also show where it’s going to be delivered.  Logs can be found in /var/log/mail.log and /var/log/mail.err

One thing I’ve noticed is you’ve got to get your hostnames right.  Make sure /etc/mailname has the fully qualified domain name in it.  I had an issue when the hostname on the machine (/etc/hostname) was the same as the /etc/mailname.