diff options
author | Yasuhito FUTATSUKI at POEM <futatuki@poem.co.jp> | 2021-10-15 05:39:36 +0900 |
---|---|---|
committer | Yasuhito FUTATSUKI at POEM <futatuki@poem.co.jp> | 2021-10-15 05:39:36 +0900 |
commit | d4a18da3a7dda34718f7043409f2dbc28a6e97c4 (patch) | |
tree | 0b6ce2aa91377c21584f836e650609d427e57ed6 /Mailman/Handlers/WrapMessage.py | |
parent | 393892351c22b83e54b95965d17ae346e5fad989 (diff) | |
parent | 6cc831d90d9e22091c05f49e54502d188f7f0712 (diff) | |
download | mailman2-d4a18da3a7dda34718f7043409f2dbc28a6e97c4.tar.gz mailman2-d4a18da3a7dda34718f7043409f2dbc28a6e97c4.tar.xz mailman2-d4a18da3a7dda34718f7043409f2dbc28a6e97c4.zip |
sync merge lp:mailman/2.1 up to 1871
Diffstat (limited to 'Mailman/Handlers/WrapMessage.py')
-rw-r--r-- | Mailman/Handlers/WrapMessage.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Mailman/Handlers/WrapMessage.py b/Mailman/Handlers/WrapMessage.py index 0ee08cb1..3aef64a2 100644 --- a/Mailman/Handlers/WrapMessage.py +++ b/Mailman/Handlers/WrapMessage.py @@ -63,13 +63,19 @@ def process(mlist, msg, msgdata): # make a copy of the msg, then delete almost everything and set/copy # what we want. omsg = copy.deepcopy(msg) + # If CookHeaders didn't change the Subject: we need to keep it too. + # Get a fresh list. + keepers = list(KEEPERS) + if 'subject' not in [key.lower() for key in + msgdata.get('add_header', {}).keys()]: + keepers.append('subject') for key in msg.keys(): - if key.lower() not in KEEPERS: + if key.lower() not in keepers: del msg[key] msg['MIME-Version'] = '1.0' msg['Message-ID'] = Utils.unique_message_id(mlist) # Add the headers from CookHeaders. - for k, v in msgdata['add_header'].items(): + for k, v in msgdata.get('add_header', {}).items(): msg[k] = v # Are we including dmarc_wrapped_message_text? I.e., do we have text and # are we wrapping because of dmarc_moderation_action? |