diff options
Diffstat (limited to 'Mailman/Queue')
-rw-r--r-- | Mailman/Queue/CommandRunner.py | 3 | ||||
-rw-r--r-- | Mailman/Queue/NewsRunner.py | 26 |
2 files changed, 25 insertions, 4 deletions
diff --git a/Mailman/Queue/CommandRunner.py b/Mailman/Queue/CommandRunner.py index c5cc3d94..a9f6f000 100644 --- a/Mailman/Queue/CommandRunner.py +++ b/Mailman/Queue/CommandRunner.py @@ -134,7 +134,8 @@ class Results: handler = sys.modules[modname] # ValueError can be raised if cmd has dots in it. # and KeyError if cmd is otherwise good but ends with a dot. - except (ImportError, ValueError, KeyError): + # and TypeError if cmd has a null byte. + except (ImportError, ValueError, KeyError, TypeError): # If we're on line zero, it was the Subject: header that didn't # contain a command. It's possible there's a Re: prefix (or # localized version thereof) on the Subject: line that's messing diff --git a/Mailman/Queue/NewsRunner.py b/Mailman/Queue/NewsRunner.py index 449532fb..fe693f28 100644 --- a/Mailman/Queue/NewsRunner.py +++ b/Mailman/Queue/NewsRunner.py @@ -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 @@ def prepare_message(mlist, msg, msgdata): 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', ''): + 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 @@ def prepare_message(mlist, msg, msgdata): # 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 @@ def prepare_message(mlist, msg, msgdata): 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? |