Mail received by wrong persons ...

Rob Bernardo rob at pbhyf.PacBell.COM
Mon Jan 30 05:32:43 AEST 1989


In article <616 at csd4.milw.wisc.edu> dave at csd4.milw.wisc.edu (David A Rasmussen) writes:
+From article <3494 at mipos3.intel.com>, by rpartha at cadev4.intel.com (Rajan Parthasarathy ~):
+> 
+> We have been experiencing a problem with mail. Mail is getting delivered to 
+> people who are not on the address list.  The problem has happens infrequently,
+> and is not reproducible.  We are running Ultrix V2.2 and VMS 4.6 at our site.
+> 
+> Some common features of the problem are :
...
+> 2. In all known cases, the mailer used was Elm. It is not known if it
+>     has happened with other mailers.
+I am running elm at a 4.3 bsd-tahoe site. The same thing happens here
+periodically.
+
+I got a sendmail log of the last time this happened to me. I had elm'd a 
+message to a user mary, and then what looked like a reply to a student and our
+consulting alias got the same message (and my were they confused). Anyhow,
+not being a sendmail guru, I wonder if anyone sees anything the matter in
+the following section of logfile?  I thought perhaps elm generated a temp file
+name with the same uid, and sendmail sent one file with that uid and then
+saw it again and redelivered it with the wrong addresses, but that was just
+an initial guess that I didn't verify yet.

AHA! When ELM prepares a message to send out it writes the message to
a temp file and then executes something more or less like:
	([mail transport agent; rm [tempfilename]) <[tempfilename] &

Since the tempfilename is based on the process id and since
the mailing and deleting  of the tempfile is done  *in the background*,
if you send more than one message within a single  elm session in quick
succession,  it is possible that the elm could overwrite one message
with the contents of the next message before  you mail transport agent
read it and sent it off.

I don't have ELM 2.1 sources, so I can't produce the patch to fix
this, but if you want to patch this,  look in the source file mailmsg2.c.
Generate the temp file name using something like tempnam(3S) rather
than getpid(). I will effect the change in the version of ELM currently
under development.

Disclaimer: this is no doubt a bug in ELM, but not necessarily the source
of the problem mentioned above.
-- 
Rob Bernardo, Pacific Bell UNIX/C Reusable Code Library
Email:     ...![backbone]!pacbell!pbhyf!rob   OR  rob at pbhyf.PacBell.COM
Office:    (415) 823-2417  Room 4E750A, San Ramon Valley Administrative Center
Residence: (415) 827-4301  R Bar JB, Concord, California



More information about the Comp.unix.questions mailing list