4.2 lost local mail fix

John Pierce jwp at sdchema.UUCP
Sun Dec 2 20:27:09 AEST 1984


This has now come up a couple of times...

The (or at least one) problem that results in lost local mail occurs in an
interaction between sendmail and /bin/mail.  It appears only when sendmail
has queued mail (due to the load average going over the highwater mark) and
later hands the queued mail to /bin/mail for delivery.  It can be fixed by
commenting out a piece of code in src/bin/mail.c.  Line numbers wouldn't help
much because of the rcs headers, but the context should be clear.  The long
comment encompases the piece of code that needs to go.
-----------------------------------------------------------------------------
In the function bulkmail():

	/*
	 * When we fall out of this, argv[1] should be first name,
	 * argc should be number of names + 1.
	 */

	while (argc > 1 && *argv[1] == '-') {
		cp = *++argv;
		argc--;
		switch (cp[1]) {
		case 'r':
			if (argc <= 0) {
				usage("bulkmail, case r, first");
				done();
			}
/*
 * If this code is left in, local mail passed on by 'sendmail' after it has
 * been queued fails because then 'sendmail' passes "-r jwp -d jwp".  I don't
 * understand why, since for non-queued mail it passes only "-d jwp" (as
 * nearly as I can tell).  Probably the correct fix would be to get the
 * effective UID at the time 'my_name' is established and check that against
 * root's UID (and possibly others'), but it's too late to think about that
 * now.
 *							--jwp, 20Jul84, 0320
 *			if (strcmp(my_name, "root") &&
 *			    strcmp(my_name, "uucp") &&
 *			    strcmp(my_name, "daemon") &&
 *			    strcmp(my_name, "network")) {
 *				usage(my_name ? my_name : "NULL");
 *				done();
 *			}
 */
			gaver++;
			strcpy(truename, argv[1]);
			fgets(line, LSIZE, stdin);
			if (strcmpn("From", line, 4) == 0)
				line[0] = '\0';
			argv++;
			argc--;
			break;

		case 'h':
-----------------------------------------------------------------------------

I don't know of a way for binary-only sites to fix this.  It's possible that
it could be fixed in sendmail.cf, but I make no pretense of understanding
that very well and I leave it alone as much as possible.  Getting from a
sendmail.cf to sendmail.fc is sufficiently buggy that I never know whether
I've screwed something up or it just doesn't work right.



More information about the Comp.unix.wizards mailing list