4.2 lost mail (part 1 of 2)
Chuck Privitera
crp at ccivax.UUCP
Tue Jan 15 01:33:17 AEST 1985
Index: bin/mail.c 4.2BSD
Description:
Queued mail to a local user never gets delivered and nobody
is notified of the failure.
Repeat-By:
Add the line:
Odqueue
to ~/.mailcf. Send mail to a local user. It will never be
delivered. The letter will show up in /usr/spool/mqueue/syslog
with stat=Sent, but it really wasn't.
Fix:
The problem is that when sendmail runs the mail queue,
it invokes /bin/mail as the sender, and uses the -r
(set from person) option. /bin/mail exits with a usage
error but never sets a bad exit status, so sendmail thinks
all went well. The first step to this solution was to
have /bin/mail set an error when invoked illegally.
This change will at least tell sendmail that there was
a problem so that it will return the mail to the sender.
A context diff follows:
Script started on Mon Jan 14 09:33:58 1985
root(21)> rcsdiff -c3 -r1.2 -r1.3 mail.c
RCS file: RCS/mail.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -c3 -r1.2 -r1.3
*** /tmp/,RCSt1001235 Mon Jan 14 09:34:29 1985
--- /tmp/,RCSt2001235 Mon Jan 14 09:34:35 1985
***************
*** 455,460
strcmp(my_name, "network") &&
strcmp(my_name, "uucp")) {
usage();
done();
}
gaver++;
--- 455,461 -----
strcmp(my_name, "network") &&
strcmp(my_name, "uucp")) {
usage();
+ error = EX_NOPERM;
done();
}
gaver++;
***************
*** 612,617
{
fprintf(stderr, "Usage: mail [ -f ] people . . .\n");
}
#include <sys/socket.h>
--- 613,619 -----
{
fprintf(stderr, "Usage: mail [ -f ] people . . .\n");
+ error = EX_USAGE;
}
#include <sys/socket.h>
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list