diff options
author | Yasuhito FUTATSUKI at POEM <futatuki@poem.co.jp> | 2019-11-11 21:15:57 +0900 |
---|---|---|
committer | Yasuhito FUTATSUKI at POEM <futatuki@poem.co.jp> | 2019-11-11 21:15:57 +0900 |
commit | 9cf674e0573c1c5f5cbb914a0626ab89f2f00707 (patch) | |
tree | 4334aed7acd8001fd82c07104de97640640f1460 /Mailman/Handlers/AvoidDuplicates.py | |
parent | 436c7209b6abc78e9f294535cee54e187d6f4dca (diff) | |
parent | 74f050981cd4dca57451ea74a1ec4a8b3dba153f (diff) | |
download | mailman2-9cf674e0573c1c5f5cbb914a0626ab89f2f00707.tar.gz mailman2-9cf674e0573c1c5f5cbb914a0626ab89f2f00707.tar.xz mailman2-9cf674e0573c1c5f5cbb914a0626ab89f2f00707.zip |
merge lp:mailman/2.1 up to rev 1827
Diffstat (limited to '')
-rw-r--r-- | Mailman/Handlers/AvoidDuplicates.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Mailman/Handlers/AvoidDuplicates.py b/Mailman/Handlers/AvoidDuplicates.py index 25c1b410..0e6e2229 100644 --- a/Mailman/Handlers/AvoidDuplicates.py +++ b/Mailman/Handlers/AvoidDuplicates.py @@ -53,6 +53,7 @@ def process(mlist, msg, msgdata): explicit_recips[addr.lower()] = True # Figure out the set of explicit recipients ccaddrs = {} + munge_cc = False for header in ('to', 'cc', 'resent-to', 'resent-cc'): addrs = getaddresses(msg.get_all(header, [])) if header == 'cc': @@ -88,6 +89,7 @@ def process(mlist, msg, msgdata): newrecips.append(r) elif ccaddrs.has_key(r.lower()): del ccaddrs[r.lower()] + munge_cc = True else: # Otherwise, this is the first time they've been in the recips # list. Add them to the newrecips list and flag them as having @@ -96,10 +98,13 @@ def process(mlist, msg, msgdata): # Set the new list of recipients msgdata['recips'] = newrecips # RFC 2822 specifies zero or one CC header - if ccaddrs: + if ccaddrs and mlist.drop_cc and munge_cc: + # There are remaining Ccs and we've dropped one or more and the list + # allows changing. change_header('Cc', COMMASPACE.join([formataddr(i) for i in ccaddrs.values()]), mlist, msg, msgdata) - else: + elif not ccaddrs and mlist.drop_cc: + # The list allows changing and there are no remaining Ccs del msg['cc'] |