Xref: utzoo comp.mail.elm:1037 comp.mail.sendmail:458 comp.unix.questions:11377 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!pacbell!pbhyf!rob From: rob@pbhyf.PacBell.COM (Rob Bernardo) Newsgroups: comp.mail.elm,comp.mail.sendmail,comp.unix.questions Subject: Re: Mail received by wrong persons ... Message-ID: <4606@pbhyf.PacBell.COM> Date: 29 Jan 89 19:32:43 GMT References: <3494@mipos3.intel.com> <616@csd4.milw.wisc.edu> Reply-To: rob@pbhyf.PacBell.COM (Rob Bernardo) Distribution: na Organization: Pacific * Bell, San Ramon, CA Lines: 47 In article <616@csd4.milw.wisc.edu> dave@csd4.milw.wisc.edu (David A Rasmussen) writes: +From article <3494@mipos3.intel.com>, by rpartha@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@pbhyf.PacBell.COM Office: (415) 823-2417 Room 4E750A, San Ramon Valley Administrative Center Residence: (415) 827-4301 R Bar JB, Concord, California