------------------------------------------------------------
revno: 1637
fixes bug: https://launchpad.net/bugs/557955
committer: Mark Sapiro <m...@msapiro.net>
branch nick: 2.1
timestamp: Sat 2016-04-02 23:18:40 -0700
message:
  Attempt to improve threading of posts gated to Usenet.
modified:
  Mailman/Queue/NewsRunner.py
  NEWS


--
lp:mailman/2.1
https://code.launchpad.net/~mailman-coders/mailman/2.1

Your team Mailman Checkins is subscribed to branch lp:mailman/2.1.
To unsubscribe from this branch go to 
https://code.launchpad.net/~mailman-coders/mailman/2.1/+edit-subscription
=== modified file 'Mailman/Queue/NewsRunner.py'
--- Mailman/Queue/NewsRunner.py	2015-11-06 17:14:29 +0000
+++ Mailman/Queue/NewsRunner.py	2016-04-03 06:18:40 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2000-2015 by the Free Software Foundation, Inc.
+# Copyright (C) 2000-2016 by the Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -12,7 +12,8 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+# USA.
 
 """NNTP queue runner."""
 
@@ -109,7 +110,11 @@
                        or msgdata.get('origsubj')
     if not mlist.news_prefix_subject_too and stripped_subject is not None:
         del msg['subject']
-        msg['subject'] = stripped_subject
+        msg['Subject'] = stripped_subject
+    # Make sure we have a non-blank subject.
+    if not msg.get('subject', '').strip():
+        del msg['subject']
+        msg['Subject'] = '(no subject)'
     # Add the appropriate Newsgroups: header
     if msg['newsgroups'] is not None:
         # This message is gated from our list to it's associated usnet group.
@@ -125,6 +130,9 @@
     # isn't ours with one of ours, so we need to parse it to be sure we're not
     # looping.
     #
+    # We also add the original Message-ID: to References: to try to help with
+    # threading issues and create another header for documentation.
+    #
     # Our Message-ID format is <mailman.secs.pid.listname@hostname>
     msgid = msg['message-id']
     hackmsgid = True
@@ -137,6 +145,18 @@
     if hackmsgid:
         del msg['message-id']
         msg['Message-ID'] = Utils.unique_message_id(mlist)
+        if msgid:
+            msg['X-Mailman-Original-Message-ID'] = msgid
+            refs = msg['references']
+            del msg['references']
+            if not refs:
+                refs = msg.get('in-reply-to', '')
+            else:
+                msg['X-Mailman-Original-References'] = refs
+            if refs:
+                msg['References'] = '\n '.join([refs, msgid])
+            else:
+                msg['References'] = msgid
     # Lines: is useful
     if msg['Lines'] is None:
         # BAW: is there a better way?

=== modified file 'NEWS'
--- NEWS	2016-03-26 23:13:11 +0000
+++ NEWS	2016-04-03 06:18:40 +0000
@@ -19,6 +19,10 @@
 
   Bug fixes and other patches
 
+    - Modified NewsRunner.py to ensure that messages gated to Usenet have a
+      non-blank Subject: header and when munging the Message-ID to add the
+      original to References: to help with threading.  (LP: #557955)
+
     - Fixed the pipermail archiver to do a better job of figuring the date of
       a post when its Date: header is missing, unparseable or has an obviously
       out of range date.  This should only affect bin/arch as ArchRunner has

_______________________________________________
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to