Franck has proposed merging lp:~mlm-author/mailman/2.1-author into 
lp:mailman/2.1.

Requested reviews:
  Mailman Coders (mailman-coders)

For more details, see:
https://code.launchpad.net/~mlm-author/mailman/2.1-author/+merge/115035

This change is optional through the use of the author_list variable and is set 
to off by default. Once set to on, it will use the list address in the From: 
header changing the display name to indicate who is the author of the post. The 
email address of the original post will be added to the reply-to field.

It does also some cleansing of some authentications headers.

Overall, this change allows mailing lists that choose so, to be able to be 
compatible with authentication schemes such as ADSP or DMARC.

A test list using this branch is at 
http://lists.peachymango.org/mailman/listinfo/mlm-auth
-- 
https://code.launchpad.net/~mlm-author/mailman/2.1-author/+merge/115035
Your team Mailman Coders is requested to review the proposed merge of 
lp:~mlm-author/mailman/2.1-author into lp:mailman/2.1.
=== modified file 'Mailman/Defaults.py.in'
--- Mailman/Defaults.py.in	2012-06-20 23:32:30 +0000
+++ Mailman/Defaults.py.in	2012-07-15 19:38:21 +0000
@@ -1039,6 +1039,9 @@
 # Send goodbye messages to unsubscribed members?
 DEFAULT_SEND_GOODBYE_MSG = Yes
 
+# Change emails so that the list is the author of emails
+DEFAULT_AUTHOR_LIST = No
+
 # Wipe sender information, and make it look like the list-admin
 # address sends all messages
 DEFAULT_ANONYMOUS_LIST = No

=== modified file 'Mailman/Gui/General.py'
--- Mailman/Gui/General.py	2011-10-04 21:53:13 +0000
+++ Mailman/Gui/General.py	2012-07-15 19:38:21 +0000
@@ -154,6 +154,10 @@
                             (listname %%05d) -> (listname 00123)
              """)),
 
+            ('author_list', mm_cfg.Radio, (_('No'), _('Yes')), 0,
+             _("""Replace the sender with the list address to conform with policies
+             like ADSP and DMARC (Removes From and modify Reply-To fields)""")),
+
             ('anonymous_list', mm_cfg.Radio, (_('No'), _('Yes')), 0,
              _("""Hide the sender of a message, replacing it with the list
              address (Removes From, Sender and Reply-To fields)""")),

=== modified file 'Mailman/Handlers/Cleanse.py'
--- Mailman/Handlers/Cleanse.py	2010-04-09 20:17:07 +0000
+++ Mailman/Handlers/Cleanse.py	2012-07-15 19:38:21 +0000
@@ -19,7 +19,7 @@
 
 import re
 
-from email.Utils import formataddr
+from email.Utils import formataddr, parseaddr
 
 from Mailman.Utils import unique_message_id
 from Mailman.Logging.Syslog import syslog
@@ -38,6 +38,19 @@
     del msg['x-approve']
     # Also remove this header since it can contain a password
     del msg['urgent']
+    # We change the from so the list takes ownership of the email
+    if mlist.author_list:
+        mlist.include_sender_header = 0
+        if msg['reply-to'] == "" :
+            msg['reply-to'] = msg['reply-to'] + " , " + msg['from']
+        else:
+           msg['reply-to'] = msg['from']
+        realname, email = parseaddr(msg['from'])
+        del msg['from']
+        msg['From'] = formataddr(('%s via %s' % (realname,mlist.real_name), mlist.GetListEmail()))
+        del msg['domainkey-signature']
+        del msg['dkim-signature']
+        del msg['sender']
     # We remove other headers from anonymous lists
     if mlist.anonymous_list:
         syslog('post', 'post to %s from %s anonymized',

=== modified file 'Mailman/Handlers/CookHeaders.py'
--- Mailman/Handlers/CookHeaders.py	2012-06-20 23:32:30 +0000
+++ Mailman/Handlers/CookHeaders.py	2012-07-15 19:38:21 +0000
@@ -159,7 +159,7 @@
         # Also skip Cc if this is an anonymous list as list posting address
         # is already in From and Reply-To in this case.
         if mlist.personalize == 2 and mlist.reply_goes_to_list <> 1 \
-           and not mlist.anonymous_list:
+           and not mlist.anonymous_list and not mlist.author_list:
             # Watch out for existing Cc headers, merge, and remove dups.  Note
             # that RFC 2822 says only zero or one Cc header is allowed.
             new = []

=== modified file 'Mailman/MailList.py'
--- Mailman/MailList.py	2012-06-20 23:32:30 +0000
+++ Mailman/MailList.py	2012-07-15 19:38:21 +0000
@@ -347,6 +347,7 @@
         self.bounce_matching_headers = \
                 mm_cfg.DEFAULT_BOUNCE_MATCHING_HEADERS
         self.header_filter_rules = []
+        self.author_list = mm_cfg.DEFAULT_AUTHOR_LIST
         self.anonymous_list = mm_cfg.DEFAULT_ANONYMOUS_LIST
         internalname = self.internal_name()
         self.real_name = internalname[0].upper() + internalname[1:]

=== modified file 'NEWS'
--- NEWS	2012-06-27 00:53:52 +0000
+++ NEWS	2012-07-15 19:38:21 +0000
@@ -5,6 +5,7 @@
 
 Here is a history of user visible changes to Mailman.
 
+<<<<<<< TREE
 2.1.15-1 (xx-xxx-xxxx)
 
   Bug Fixes and other patches
@@ -13,6 +14,13 @@
       HTML entities. (LP: #1018208)
 
 2.1.15 (13-Jun-2012)
+=======
+This Branch
+    -Adding author_list to enable the application of ADSP and DMARC like 
+     email policies
+
+2.1.15 (xx-xxx-xxxx)
+>>>>>>> MERGE-SOURCE
 
   Security
 

=== modified file 'contrib/majordomo2mailman.pl'
--- contrib/majordomo2mailman.pl	2003-01-02 05:25:50 +0000
+++ contrib/majordomo2mailman.pl	2012-07-15 19:38:21 +0000
@@ -480,6 +480,7 @@
 		  'max_num_recipients', "10",
 		  'forbidden_posters', "[]",
 		  'bounce_matching_headers',  "\"\"\"\n\"\"\"\n",
+                  'author_list', "0",
 		  'anonymous_list', "0",
 		  'nondigestable', "1",
 		  'digestable', "1",

=== modified file 'doc/mailman-admin.txt'
--- doc/mailman-admin.txt	2012-05-16 03:35:44 +0000
+++ doc/mailman-admin.txt	2012-07-15 19:38:21 +0000
@@ -331,7 +331,12 @@
           language. In this case, because of vagarities of the email
           standards, you may or may not want to add a trailing space.
 
-   anonymous_list
+    author_list
+          This variable allows you to replace the From header with the
+          list address, so that policies like ADSP or DMARC can be
+          applied.
+
+    anonymous_list
           This variable allows you to turn on some simple anonymizing
           features of Mailman. When you set this option to Yes, Mailman
           will remove or replace the From:, Sender:, and Reply-To: fields

=== modified file 'doc/mailman-admin/node10.html'
--- doc/mailman-admin/node10.html	2012-05-16 03:35:44 +0000
+++ doc/mailman-admin/node10.html	2012-07-15 19:38:21 +0000
@@ -140,6 +140,11 @@
 
 <p>
 </dd>
+<dt><strong>author_list</strong></dt>
+<dd>This variable allows you to replace the From header with the
+    list address, so that policies like ADSP or DMARC can be
+    applied.
+</dd>
 <dt><strong>anonymous_list</strong></dt>
 <dd>This variable allows you to turn on some simple anonymizing
     features of Mailman.  When you set this option to <em>Yes</em>,

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

Reply via email to