Malte S. Stretz has proposed merging lp:~mss/mailman/2.1-sender-header into 
lp:mailman/2.1.

Requested reviews:
  Mailman Coders (mailman-coders)
Related bugs:
  #266824 Add option to remove Sender header
  https://bugs.launchpad.net/bugs/266824


Adds the long due option to disable the generation of the Sender header.  The 
patch is quite simple, the changes in behaviour essentially being what some 
people already use for ages.  But I don't know if I made an error in the GUI 
integration.  Already prediscussed here 
<http://www.mail-archive.com/mailman-developers%40python.org/msg11948.html>.
-- 
https://code.launchpad.net/~mss/mailman/2.1-sender-header/+merge/28901
Your team Mailman Coders is requested to review the proposed merge of 
lp:~mss/mailman/2.1-sender-header into lp:mailman/2.1.
=== modified file 'Mailman/Defaults.py.in'
--- Mailman/Defaults.py.in	2010-05-12 22:04:17 +0000
+++ Mailman/Defaults.py.in	2010-06-30 15:01:28 +0000
@@ -1040,6 +1040,14 @@
 # lists with no archives).
 ALLOW_RFC2369_OVERRIDES = Yes
 
+# RFC 2822 suggests that not adding a Sender header when Mailman is the agent
+# responsible for the actual transmission is a breach of the RFC.  However,
+# some MUAs (notably Outlook) tend to display the Sender header instead of the
+# From details, confusing users and actually losing the original sender when
+# forwarding mail.  By setting this variable to Yes, list owners will be
+# given the option to avoid setting this header.
+ALLOW_SENDER_OVERRIDES = Yes
+
 # Defaults for content filtering on mailing lists.  DEFAULT_FILTER_CONTENT is
 # a flag which if set to true, turns on content filtering.
 DEFAULT_FILTER_CONTENT = No

=== modified file 'Mailman/Gui/General.py'
--- Mailman/Gui/General.py	2007-12-04 19:52:18 +0000
+++ Mailman/Gui/General.py	2010-06-30 15:01:28 +0000
@@ -414,6 +414,29 @@
              does not affect the inclusion of the other <tt>List-*:</tt>
              headers.)"""))
             )
+        # Suppression of Sender header modification
+        if mm_cfg.ALLOW_SENDER_OVERRIDES:
+            rtn.append(
+                ('include_sender_header', mm_cfg.Radio,
+                 (_('No'), _('Yes')), 0,
+                 _("""Should the <tt>Sender</tt> header be rewritten for this
+                 mailing list to avoid stray bounces?  <em>Yes</em> is
+                 recommended."""),
+
+                 _(""""<a href="http://www.faqs.org/rfcs/rfc2822.html";>RFC
+                 2822</a> defines the <tt>Sender</tt> header and defines it
+                 as "the mailbox of the agent responsible for the actual
+                 transmission of the message."  Mailman replaces this header
+                 per default with the list's bounce address.
+                 
+                 <p>While it is debatable if Mailman is such an agent, setting
+                 this header helps directing bounces from some broken MTAs to
+                 the right destination.  On the other hand do some mail
+                 readers show unexpected behaviour if this header is set (like
+                 missing addresses in forwarded mails and copies sent to the
+                 bounce address on reply-to-all), so it can be disabled 
+                 here."""))
+                )
 
         # Discard held messages after this number of days
         rtn.append(

=== modified file 'Mailman/Handlers/SMTPDirect.py'
--- Mailman/Handlers/SMTPDirect.py	2009-08-01 23:15:35 +0000
+++ Mailman/Handlers/SMTPDirect.py	2010-06-30 15:01:28 +0000
@@ -355,10 +355,26 @@
     # the Sender header at all.  Brad Knowles points out that MTAs tend to
     # wipe existing Return-Path headers, and old MTAs may still honor
     # Errors-To while new ones will at worst ignore the header.
-    del msg['sender']
+    #
+    # With some MUAs (eg. Outlook 2003) rewriting the Sender header with our
+    # envelope sender causes more problems than it solves, because some will 
+    # include the Sender address in a reply-to-all, which is not only 
+    # confusing to subscribers, but can actually disable/unsubscribe them from
+    # lists, depending on how often they accidentally reply to it.  Also, when
+    # forwarding mail inline, the sender is replaced with the string "Full 
+    # Name (on behalf [email protected])", essentially losing the original
+    # sender address.
+    # 
+    # The drawback of not touching the Sender: header is that some MTAs might
+    # still send bounces to it, so by not trapping it, we can miss bounces.
+    # (Or worse, MTAs might send bounces to the From: address if they can't
+    # find a Sender: header.)  So instead of completely disabling the sender
+    # rewriting, we offer an option to disable it.
     del msg['errors-to']
-    msg['Sender'] = envsender
     msg['Errors-To'] = envsender
+    if mlist.include_sender_header:
+        del msg['sender']
+        msg['Sender'] = envsender
     # Get the plain, flattened text of the message, sans unixfrom
     # using our as_string() method to not mangle From_ and not fold
     # sub-part headers possibly breaking signatures.

=== modified file 'Mailman/MailList.py'
--- Mailman/MailList.py	2010-02-27 17:57:24 +0000
+++ Mailman/MailList.py	2010-06-30 15:01:28 +0000
@@ -363,6 +363,7 @@
         self.available_languages = []
         self.include_rfc2369_headers = 1
         self.include_list_post_header = 1
+        self.include_sender_header = 1
         self.filter_mime_types = mm_cfg.DEFAULT_FILTER_MIME_TYPES
         self.pass_mime_types = mm_cfg.DEFAULT_PASS_MIME_TYPES
         self.filter_filename_extensions = \

=== modified file 'Mailman/versions.py'
--- Mailman/versions.py	2007-11-25 07:08:04 +0000
+++ Mailman/versions.py	2010-06-30 15:01:28 +0000
@@ -353,6 +353,7 @@
     add_only_if_missing('send_goodbye_msg', mm_cfg.DEFAULT_SEND_GOODBYE_MSG)
     add_only_if_missing('include_rfc2369_headers', 1)
     add_only_if_missing('include_list_post_header', 1)
+    add_only_if_missing('include_sender_header', 1)
     add_only_if_missing('bounce_score_threshold',
                         mm_cfg.DEFAULT_BOUNCE_SCORE_THRESHOLD)
     add_only_if_missing('bounce_info_stale_after',

_______________________________________________
Mailman-coders mailing list
[email protected]
http://mail.python.org/mailman/listinfo/mailman-coders

Reply via email to