Enabling mail program

Derek Broughton derek at pointerstop.ca
Thu Sep 3 00:53:19 UTC 2009

Michael Satterwhite wrote:

> On Tuesday 01 September 2009 11:05:00 am Chris G wrote:
>> On Tue, Sep 01, 2009 at 10:55:59AM -0500, Michael Satterwhite wrote:
>> >    I installed mailutils to enable command line email for scripts on my
>> >    system. As a test, I ran
>> >
>> >    mail -s "Test Message" michael at weblore.com < /dev/null
>> >
>> >    It seemed to run without error, but I never received the test
>> >    message. Obviously, I need to do something else to get the mail
>> >    program
>> > working. Would someone be so kind as to let me in on the magic that I'm
>> > missing?
>> By redirecting from /dev/null you sent yourself an empty message so it
>> doesn't seem to me to be very surprising that you received nothing.
>> Try redirecting from a text file of some sort.
> Actually, if you execute the command it will tell you that it sent a
> message with an empty body - which should have been received. There is no
> requirement that a message have a body.

I'm pretty sure there is.  It can be null, but the SMTP dialog requires 
headers, a blank line, some number of lines (which can be zero) of text, and 
a line containing only "." to terminate the body.  "mail" expects that "." 
and  I wouldn't have been surprised that redirecting from /dev/null didn't 
work, because it doesn't have that ".", but...
> Regardless, I have tried it as well with a small text file. Same results.

So look at your syslog.  It should be in there (this is masqmail, but other 
MTAs should give something similar).

$ mail -s "test2" derek at localhost </dev/null
Null message body; hope that's ok
$ tail /var/log/syslog
Sep  2 21:48:47 morgen masqmail[14379]: 1Mj0VL-3jv-00 <= <derek at morgen> with 
Sep  2 21:48:47 morgen masqmail[14380]: 1Mj0VL-3jv-00 => <derek at localhost> 
with maildir
Sep  2 21:48:47 morgen masqmail[14380]: 1Mj0VL-3jv-00 completed.


More information about the ubuntu-users mailing list