On Thursday, June 5, 2003, at 03:36 am, Dan Mills wrote:
On Wed, 2003-06-04 at 03:44, David Cantrell wrote:
To send mail, you need two components. A mail client (aka a mail user
agent or MUA) and an SMTP program (aka a mail transport agent or MTA). The
'mail' program is an MUA. It passes messages to a local MTA for delivery.
IIRC on OS X the MTA (sendmail) is installed, but not configured, so 'mail'
successfully hands the message over to sendmail, which then neither knows
what to do with it, nor knows how to warn you of the fact.
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
hth
Robin
quotes lifted from unix C programming manpages:
Upon successful completion, getrlimit() and setrlimit() return 0. Otherwise, these functions return -1 and set errno to indicate the error.
The exit function
The argument to exit is a status indication returned to the invoking environment. In the UNIX operating system, a value of 0 is the successful return code from a program. As usage of C has spread beyond UNIX, exit(0) has often been retained as an idiom indicating successful termination, even on operating systems with different systems of return codes. This usage is thus recognized as standard.