Page 1 of 1


Posted: Wed Sep 12, 2012 7:06 am
by phatbenny
I'm using my Pi as a LAMP Web Server and one of the problems I have is with my error logs. A program may create a log entry which is fine, but then a small program called Nullmailer tries to send the entry as an email. This would be fine if i had Nullmailer configured properly, but as I don't it goes into an endless loop of error messages as Nullmailer itself reports is failure to log on to an smtp server and send the email.

It seems like this should be set up as a priority and probably for all Pi users. Can anyone suggest how you go about doing this, or the best way to do it?

Re: Nullmailer

Posted: Wed Sep 12, 2012 7:20 am
by phatbenny
I've edited /etc/nullmailer/remotes and inserted the line

Code: Select all smtp --port=25 [email protected] --pass=changeme
obviously changing the server, port, user and pass. I'll see what this does

Re: Nullmailer

Posted: Wed Sep 12, 2012 7:42 am
by phatbenny
Other files to configure:
[email protected] (the address where you want the email sent)

/etc/nullmailer/defaultdomain (I don't understand the significance of this, can anyone explain)

$ (I don't really understand this one either, I think it is just to identify the machine generating the message)

/etc/nullmailer/remotes smtp --port=465 --user=[email protected] --pass=mypass (details required to access your mail server to send mail)

Found on ... Nullmailer

Re: Nullmailer

Posted: Sun Sep 16, 2012 5:56 pm
by phatbenny
I think I've finally got this sorted so will post an update.

Code: Select all

is a useful command as it shows the messages in the mail queue

to view the folder with messages in use

Code: Select all

sudo su
cd /var/spool/nullmailer/queue/ 

you can the use nano to view and edit the files or
rm *
to delete the backlog

Finally you need to edit
/etc/mailname (i think this is the domain used at the end of the from address, it will be the current user [@] that send the email, i.e. [email protected])

I also needed to change
as I was using the smtp setting for my mail account, rather than the smtp settings that my ISP says are the only acceptable ones for my broadband account

You can use

Code: Select all

mail -s "this is a nullmailer test" root
to test if it works, you get to write a message then hit Ctrl D + return to send it

Re: Nullmailer

Posted: Sun Mar 24, 2013 10:16 pm
by wallasey

I posted information on how to set up nullmailer here: ... ry-pi.html

As this is the only forum thread on nullmailer it seemed the correct place to post.
For your particular issue with queue resend attempts and log files see the notes on the config file /etc/nullmailer/pausetime in the above blog post. Basically, you can configure nullmailer to wait until you manually trigger an attempt to send mail, and to only try once each time you trigger.

This would allow you to store mail until the Pi has network connectivity and trigger a send attempt then.

Hope it helps.