On Sunday, June 8, 2003, at 11:58 AM, Robin wrote:

On Thursday, June 5, 2003, at 03:36 am, Dan Mills wrote:

It's unfortunate that mail exits with 0, however. I was burned by this
not very long ago (ran M-x mail in emacs for a quick mail, no error,
never got there. Eventually I ran mailq and realized sendmail wasn't
setup properly).


It isn't mail's fault, though. sendmail returns with 0 as well.

I've come accross this before, it's a UNIX C-ism which return 0 instead - historically any other return value would be an error code, see quotes below for clarifiaction

Yes, but that's the point. It returns 0, even though it clearly failed to send the mail.


A quick test[*] reveals that mail does not return 1 even if I rig sendmail to return 1, so the point is moot. They are both broken, imo. Perhaps there is some (historical?) reason for it.

-Dan

[*] replacing /usr/sbin/sendmail with a sh script that exits 1:
# sendmail
# echo $?
1
# echo "foo" | mail -s "whee" [EMAIL PROTECTED]
# echo $?
0



Reply via email to