On Mon, Mar 06, 2006 at 12:07:32PM +0100, Thue Janus Kristensen wrote:
> The manual page for mail says
>  -e      Don't send empty mails.  If the body is empty skip the mail.
> So when I use the commando 
>  echo "" | mail -e -s "test" [EMAIL PROTECTED]
> I expect that no mail is sendt; that is not the case.

This is not technically a bug:

$ cat /dev/null | mail -e -s test jeroen
<no mail>
$ echo | mail -e -s test jeroen
<mail>
$

This is because:

$ cat /dev/null | wc
      0       0       0
$ echo | wc
      1       0       1
$ echo | hd
00000000  0a                                                |.|
00000001
$

(also see echo's -n option)

Note that 'echo' will always output a newline (0x0a). So the body isn't
empty, it contains a single newline / a single empty line.

Of course, this could be special cased, but then, where to stop? Also
special case a single space? And what about other whitespace? Is tab
whitespace? Are the various unicode whitespace characters whitespace?

Note that I'm not the maintainer, so I'm leaving the bug open, but if I
were the maintainer, I'd have closed it now.

--Jeroen

-- 
Jeroen van Wolffelaar
[EMAIL PROTECTED] (also for Jabber & MSN; ICQ: 33944357)
http://Jeroen.A-Eskwadraat.nl


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to