diff options
author | Mark Sapiro <msapiro@value.net> | 2011-01-13 16:53:30 -0800 |
---|---|---|
committer | Mark Sapiro <msapiro@value.net> | 2011-01-13 16:53:30 -0800 |
commit | 07e69cf16e80a1514f0e7e6f8110063eeb738c44 (patch) | |
tree | f1b8111501203068c7246dfc6b3eeba15cb70c61 /Mailman | |
parent | 1584b7fac294eb6eb3bc000f3a3e5f79fe013a3f (diff) | |
download | mailman2-07e69cf16e80a1514f0e7e6f8110063eeb738c44.tar.gz mailman2-07e69cf16e80a1514f0e7e6f8110063eeb738c44.tar.xz mailman2-07e69cf16e80a1514f0e7e6f8110063eeb738c44.zip |
- Fixed a bug that could erroneously handle posts from addresses in
*_these_nonmembers and send held/rejected notices to bogus addresses when
The From or other sender header is RFC 2047 encoded. Bug #702516.
Diffstat (limited to 'Mailman')
-rw-r--r-- | Mailman/Message.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Mailman/Message.py b/Mailman/Message.py index 84e4aa26..3bbb9ecc 100644 --- a/Mailman/Message.py +++ b/Mailman/Message.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2009 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2011 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 @@ -149,9 +149,11 @@ class Message(email.Message.Message): if not fieldval: continue # Work around bug in email 2.5.8 (and ?) involving getaddresses() - # from multi-line header values. Note that cset='us-ascii' is OK - # since the address itself can't be RFC 2047 encoded. - fieldval = Utils.oneline(fieldval, 'us-ascii') + # from multi-line header values. + # Don't use Utils.oneline() here because the header must not be + # decoded before parsing since the decoded header may contain + # an unquoted comma or other delimiter in a real name. + fieldval = ''.join(fieldval.splitlines()) addrs = email.Utils.getaddresses([fieldval]) try: realname, address = addrs[0] @@ -207,7 +209,7 @@ class Message(email.Message.Message): if fieldvals: # See comment above in get_sender() regarding # getaddresses() and multi-line headers - fieldvals = [Utils.oneline(fv, 'us-ascii') + fieldvals = [''.join(fv.splitlines()) for fv in fieldvals] pairs.extend(email.Utils.getaddresses(fieldvals)) authors = [] |