4.2 lost mail

Chuck Privitera crp at ccivax.UUCP
Fri Apr 12 02:08:26 AEST 1985


Description:
	A couple months back in article <276 at uw-beaver>, Voradesh
	Yenbut stated:

>	I found that sendmail, compiled with DBM defined, does not
>	call initaliases() before it processes queued mails.  So,
>	it will fail when looking for an alias name of a local
>	recipient.

	Shortly thereafter in article <230 at ccivax.UUCP> I rebutted:

>	I don't know about you, but my sendmail does alias expansion when
>	the mail is queued. In the mainline code for sendmail, there is a
>	switch which does alias initialization only if:
>		1. You are running as newaliases (or -bi option given)
>		2. You are not running in daemon mode.
>	Thus, alias expansions are done when you submit mail, so the
>	only time the daemon has to worry about doing alias expansions
>	is when mail is submitted via SMTP. And as the note in Version.c
>	says, initaliases is called in srvrsmtp.

	I ended this article with the question: Is Voradesh's
	fix really necessary? Nobody has responded and I have
	been bitten by NOT installing his fix.

	We have implemented a hashed password file as described in
	the Toronto Usenix conference talk on improving system perform-
	ance.  To make sendmail use the hashed password file, we used
	mdbm distributed on the net (so you can have more than
	one dbm database open at one time). With mdbm, you reference
	a database with a pointer to a structure mdbm (much like
	stdio's FILE pointers), this is how I got bitten. The database
	was never opened so the pointer to the structure mdbm was
	null. While my argument above is entirely valid, sendmail
	still tries to do alias expansion on queue runs. So if you
	use plain ol' dbm, accesses to the database will quietly
	fail but the mail will still be delivered because the
	expansion is already complete. But for future considerations
	(I think 4.2+, 4.3 or whatever will use a hashed password
	 file), you should install Voradesh's fix.
Repeat-by:
	If you really want, use mdbm instead of dbm in sendmail
	and queue a mail message (to anybody, not just an alias).
Fix:
	For those of you who missed it:


> ==================================================================
>   SCCSID(@(#)queue.c	4.2		3/11/84	(no queueing));
> 
> *** /tmp/,RCSt1002663	Fri Dec 21 12:02:11 1984
> --- queue.c	Mon Dec  3 09:35:01 1984
> ***************
> *** 256,261
>   		/* child -- double fork */
>   		if (fork() != 0)
>   			exit(EX_OK);
>   	}
>   # ifdef LOG
>   	if (LogLevel > 11)
> 
> --- 258,266 -----
>   		/* child -- double fork */
>   		if (fork() != 0)
>   			exit(EX_OK);
> + 
> + 		/* open the alias database */
> + 		initaliases(AliasFile, FALSE);
>   	}
>   # ifdef LOG
>   	if (LogLevel > 11)
> 



More information about the Comp.unix.wizards mailing list