Question: I'm getting a lot of messages like these:

```
me@home:/etc/snmp$ tail /var/log/syslog
Jun 12 17:52:15 home nullmailer[1238]: Starting delivery: protocol: smtp host: mail. file: 1339502401.24665
Jun 12 17:52:15 home nullmailer[7086]: smtp: Failed: Connect failed
Jun 12 17:52:15 home nullmailer[1238]: Sending failed:  Host not found
Jun 12 17:52:15 home nullmailer[1238]: Starting delivery: protocol: smtp host: mail. file: 1339174804.27614
Jun 12 17:52:15 home nullmailer[7087]: smtp: Failed: Connect failed
Jun 12 17:52:15 home nullmailer[1238]: Sending failed:  Host not found
Jun 12 17:52:15 home nullmailer[1238]: Starting delivery: protocol: smtp host: mail. file: 1339324201.21737
Jun 12 17:52:15 home nullmailer[7088]: smtp: Failed: Connect failed
Jun 12 17:52:15 home nullmailer[1238]: Sending failed:  Host not found
Jun 12 17:52:15 home nullmailer[1238]: Delivery complete, 331 message(s) remain.

```

The problem is, I don't recall sending anything. How do I find out which software is sending these messages? How do I read them?

Answer: 
To see the contents of one of the messages in the queue, try something like this: (obviously replacing the numeric filename with an actual one from your syslog)

```
$ sudo cat /var/spool/nullmailer/queue/1347323616.6506

```

Note that you have to use either `sudo` or be logged in as root due to permissions on the queue subdir and files.
You seem to have installed `nullmailer` but no possibility to sent the emails to on your mashine. All those mails are being tried to send on every startup. also if you restart nullmailer, you will generate those messages again:

```
sudo /etc/init.d/nullmailer restart

```

have a look in your mail queue:

```
sudo su
ls -lah /var/spool/nullmailer/queue/

```

and look at the dates. They are probably all useless old e-mails.

So there are two solutions:

no need for local mails
=======================

So if you don't care about emails sent by your system, just empty the nullmail queue every now and then:

```
rm /var/spool/nullmailer/queue/*

```

And probably you will delete the many GB of mail logs also with:

```
rm /var/log/mail.*
rm /var/log/syslog*

```

[You can add this to your `etc/rc.local` file to do this automatically](https://askubuntu.com/a/759821/34298).

local mail delivery
===================

If you really want to get emails from your sytem, for example PHP sends out messages and you want to test how they would look like, you can install `fakemail` to store those mails in a folder

(see: <http://distinctplace.com/2013/06/20/nullmailer-and-fake-mail-two-little-tools-for-every-developer/>)