[Mailman-Developers] Sender: header duplication

Harald Meland Harald.Meland@usit.uio.no
29 Nov 1998 22:32:07 +0100


This is a MIME multipart message.  If you are reading
this, you shouldn't.

--=-=-=

Currently, whenever Mailman delivers a message to a list, a
list-specific `Sender' header is appended.  As RFC822 specifies that
there should only be at most `Sender' header in any message, appending
is not right if there already is such a header present (e.g. whenever
the senders MUA added a `Sender' header).

The included (untested, but simplistic) patch (against current CVS
Mailman) tries to fix this.

[ However, I suspect my patch might not work for messages already
  containing multiple `Sender' headers when Mailman receives them, as
  Message.SetHeader doesn't appear to really be "crushing duplicates"
  in those cases. ]

To cater for umbrella lists, similar fixes should probably be applied
to the `Errors-To' and `X-Mailman-Version' header appending in
Mailman.Deliverer.DeliverToList().
-- 
Harald

--=-=-=

--- Mailman/Deliverer.py.orig	Sun Nov 29 22:12:12 1998
+++ Mailman/Deliverer.py	Sun Nov 29 22:11:17 1998
@@ -110,7 +110,7 @@
 	if self.reply_goes_to_list:
             del msg['reply-to']
             msg.headers.append('Reply-To: %s\n' % self.GetListEmail())
-	msg.headers.append('Sender: %s\n' % self.GetAdminEmail())
+	msg.SetHeader('Sender', self.GetAdminEmail())
         if not msg.getheader('list-id'):
             msg.headers.append('List-Id: %s\n' % self.GetListIdentifier())
 	msg.headers.append('Errors-To: %s\n' % self.GetAdminEmail())

--=-=-=--