From: utzoo!decvax!microsof!uw-beave!jim
Newsgroups: net.unix-wizards
Title: Re: Bugs in 4.1bsd mailers
Article-I.D.: uw-beave.275
Posted: Wed Jan  5 09:17:54 1983
Received: Thu Jan  6 20:20:48 1983
References: watcgl.95

    From: uw-beave!microsof!decvax!utzoo!watmath!watcgl!dmmartindale

    Several comments about uw-beaver!jim's suggestions on how to handle
    errors in /bin/mail: Do NOT change /bin/mail to do
    "exit(pclose(rmf) >> 8);" If uux dies from any sort of signal, this
    fact is indicated by the lower 8 bits of the return status and the
    upper 8 bits are zero, and you DON'T want to indicate normal exit
    in this case. ...

Dave Martindale's assessment of /bin/mail looks right to me.  As I
said, I wasn't advocating that you go right out and change your
sources, since I hadn't tested the modifications I proposed.  I was
just curious as to why the code was wrong and whether anyone had fixed
it.

The moral is that /bin/mail tries to do too many things and isn't very
good at any of them.  It is a user interface, a local mailer, and a
uucp mailer.  What we do is use /bin/mail for local delivery and a
different program for uucp delivery.  The uucp mailer checks to make
sure a site exists before doing the uux, and checks the exit status on
return just to make sure.