Xref: utzoo comp.mail.sendmail:276 comp.bugs.4bsd:1106 Path: utzoo!attcan!uunet!mcvax!nikhefh!e07 From: e07@nikhefh.hep.nl (Eric Wassenaar) Newsgroups: comp.mail.sendmail,comp.bugs.4bsd Subject: sendmail queue run interferes with active transactions Message-ID: <580@nikhefh.hep.nl> Date: 22 Nov 88 23:18:04 GMT Organization: Nikhef-H, Amsterdam (the Netherlands). Lines: 29 A sendmail queue run may destructively interfere with other active sendmail transactions. As a result, mail may be lost, left-over queue files may remain in the mqueue directory, and various error messages may appear in the syslog file. Analysis: The routine runqueue() in queue.c scans the queue, calling dowork() for each individual entry. If an entry is found busy, dowork() will syslog such entry as "AAxxxxx: locked", and return immediately. After the queue scan, runqueue() calls finis() to terminate. However, if the last queue entry examined by dowork() was locked, 'CurEnv->e_id' still contains the id of this entry, and dropenvelope() which is called by finis() will inappropriately perform cleanup action for this queue entry, possibly unlinking associated queue files. Remedy: Either make CurEnv->e_id = NULL again in dowork() when returning after signaling a locked entry, or put CurEnv->e_id = NULL in runqueue() just before calling finis(). Now dropenvelope() will exit immediately. Note that in case dowork() could process a non-active entry, it will internally call dropenvelope() for this entry. Eric Wassenaar -- Organization: NIKHEF-H, National Institute for Nuclear and High-Energy Physics Address: Kruislaan 409, P.O. Box 41882, 1009 DB Amsterdam, the Netherlands Phone: +31 20 5920412 Home phone: +31 20 909449 Telex: 10262 (hef nl) Internet: e07@nikhefh.hep.nl Bitnet: nikhefh!e07@mcvax.bitnet