diff options
author | Mark Sapiro <mark@msapiro.net> | 2015-11-06 09:14:29 -0800 |
---|---|---|
committer | Mark Sapiro <mark@msapiro.net> | 2015-11-06 09:14:29 -0800 |
commit | 8e017140ec920c6cb30191db2c092c4d75a9c7b1 (patch) | |
tree | c630b07fa54dd7f430d0142b205ef5373346627b /Mailman/Queue/NewsRunner.py | |
parent | 2b8a93aad055efe7754ee3f1c93afd588b1d53ff (diff) | |
download | mailman2-8e017140ec920c6cb30191db2c092c4d75a9c7b1.tar.gz mailman2-8e017140ec920c6cb30191db2c092c4d75a9c7b1.tar.xz mailman2-8e017140ec920c6cb30191db2c092c4d75a9c7b1.zip |
Posts gated to usenet will no longer have other than the target group
in the Newsgroups: header.
Diffstat (limited to '')
-rw-r--r-- | Mailman/Queue/NewsRunner.py | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/Mailman/Queue/NewsRunner.py b/Mailman/Queue/NewsRunner.py index 44850063..449532fb 100644 --- a/Mailman/Queue/NewsRunner.py +++ b/Mailman/Queue/NewsRunner.py @@ -1,4 +1,4 @@ -# Copyright (C) 2000-2005 by the Free Software Foundation, Inc. +# Copyright (C) 2000-2015 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 @@ -111,20 +111,12 @@ def prepare_message(mlist, msg, msgdata): del msg['subject'] msg['subject'] = stripped_subject # Add the appropriate Newsgroups: header - ngheader = msg['newsgroups'] - if ngheader is not None: - # See if the Newsgroups: header already contains our linked_newsgroup. - # If so, don't add it again. If not, append our linked_newsgroup to - # the end of the header list - ngroups = [s.strip() for s in ngheader.split(',')] - if mlist.linked_newsgroup not in ngroups: - ngroups.append(mlist.linked_newsgroup) - # Subtitute our new header for the old one. - del msg['newsgroups'] - msg['Newsgroups'] = COMMASPACE.join(ngroups) - else: - # Newsgroups: isn't in the message - msg['Newsgroups'] = mlist.linked_newsgroup + if msg['newsgroups'] is not None: + # This message is gated from our list to it's associated usnet group. + # If it has a Newsgroups: header mentioning other groups, it's not + # up to us to post it to those groups. + del msg['newsgroups'] + msg['Newsgroups'] = mlist.linked_newsgroup # Note: We need to be sure two messages aren't ever sent to the same list # in the same process, since message ids need to be unique. Further, if # messages are crossposted to two Usenet-gated mailing lists, they each |