Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ccivax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!rochester!ritcv!ccivax!crp From: crp@ccivax.UUCP (Chuck Privitera) Newsgroups: net.bugs.4bsd,net.unix-wizards Subject: Re: 4.2 lost mail Message-ID: <240@ccivax.UUCP> Date: Thu, 11-Apr-85 11:08:26 EST Article-I.D.: ccivax.240 Posted: Thu Apr 11 11:08:26 1985 Date-Received: Sat, 13-Apr-85 05:31:59 EST Distribution: net Organization: CCI Telephony Systems Group, Rochester NY Lines: 72 Xref: watmath net.bugs.4bsd:1459 net.unix-wizards:12795 Description: A couple months back in article <276@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@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) >