Jump to content
From ArchWiki

Nullmailer is a small mail program that allows you (or your system) to send mails through an existing email account (using an SMTP server). Technically, this is a MTA. Nullmailer is particularly useful on systems that are not always online (like a travelling laptop).

## Installation

Install the package nullmailer.

## Configuration

Configuration files are located in `/etc/nullmailer/`. Each file contains one option and the possible configurations are not particularly well documented. Below we give an example of a configuration to use gmail as a relay host.

After setting the configurations, start/enable the `nullmailer.service`.

### Example: gmail

In the file `/etc/nullmailer/remotes` you need to set the connection to the relay host. For gmail:

    smtp.gmail.com smtp --port=465 --auth-login --user=gmail_address --pass=password --ssl

You can also use starttls.

Note: You are encoding your password in this file. Make sure the permissions are set correctly so that only you can read it. The default settings are safe, but please check.

In the file `/etc/nullmailer/me`, you need to encode the hostname of your computer.

In the file `/etc/nullmailer/defaultdomain`, you need to set the gmail domain:

    gmail.com

Note: In the configuration after installation, this file is missing. However, it is required by `nullmailer.service`. If you get an error message

    Condition check resulted in Nullmailer relay-only MTA being skipped.

in the journal, this might refer to this file.

### Other configurations

In the file `/etc/nullmailer/pausetime` you can set the minimum time to pause between successive queue runs when there are messages in the queue, in seconds. This defaults to 60, which for a travelling laptop is way too soon. You can set this to one hour for example:

    3600

In the file `/etc/nullmailer/sendtimeout` you can set how long nullmailer tries to send a particular message before giving up. The default is one hour, 3 minutes might be a more reasonable cutoff:

    180

## Testing

You can test the configuration by sending a test email:

    $ echo "Subject: sendmail test" | sendmail -v recipient_address

## See also

- Official page, only a reference to a mailing list: untroubled.org/nullmailer.
- A "for Dummies" style blog post with useful configuration tips: www.troubleshooters.com/linux/nullmailer.

Category:

- Mail server