Xref: utzoo comp.mail.sendmail:2039 comp.bugs.4bsd:1608 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!mips!decwrl!shelby!bloom-beacon!eru!luth!sunic!mcsun!hp4nl!nikhefh!e07 From: e07@nikhefh.nikhef.nl (Eric Wassenaar) Newsgroups: comp.mail.sendmail,comp.bugs.4bsd Subject: incorrect address rewriting during returntosender Message-ID: <976@nikhefh.nikhef.nl> Date: 27 Aug 90 09:21:40 GMT Sender: e07@nikhef.nl (Eric Wassenaar) Organization: Nikhef-H, Amsterdam (the Netherlands). Lines: 43 Ref: All versions of sendmail up to/including 5.64 Description: Sendmail will rewrite 'new style' addresses in the header lines incorrectly when returning a message to the sender, e.g. when mailing back a return receipt or an error message. Repeat-by: Send a message To: him@hisdomain and ask for a Return-Receipt-To: Your Name Most probably (assuming his sendmail generates fully qualified addresses, and can handle 'old style' addresses) this appears in the return message as To: Your@hisdomain, Name@hisdomain, Analysis: Sendmail returns a message using the sequence sendtolist(recipient_list, ...) returntosender(...) The recipient(s) are parsed within sendtolist(), the 'new style' address is recognized, and the EF_OLDSTYLE bit is cleared in the envelope e_flags field. The actual delivery is done within returntosender(), but this routine switches to a temporary envelope which gets the default e_flags with the EF_OLDSTYLE bit set. During subsequent header rewriting, in putheader() and commaize(), the headers are handled incorrectly, with the above result. Fix: In the routine returntosender() in the file savemail.c, after switching to the temporary envelope ee, add the following lines: if (!bitset(EF_OLDSTYLE, CurEnv->e_flags)) ee->e_flags &= ~EF_OLDSTYLE; 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 592 0412, Home: +31 20 909449, Telefax: +31 20 592 5155 Internet: e07@nikhef.nl