aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ08nY2017-07-10 23:32:24 +0200
committerJ08nY2017-07-10 23:32:24 +0200
commit589cfab420d1fa9343956be1a31e28e3524f5f69 (patch)
tree6d3c30d3e12ea440766cf8fcb2ec6a8ed6c9d7ab
parent0ba497780cbe1abe9b91321993e31456bfcf1cd0 (diff)
downloadmailman-pgp-589cfab420d1fa9343956be1a31e28e3524f5f69.tar.gz
mailman-pgp-589cfab420d1fa9343956be1a31e28e3524f5f69.tar.zst
mailman-pgp-589cfab420d1fa9343956be1a31e28e3524f5f69.zip
-rw-r--r--src/mailman_pgp/pgp/utils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mailman_pgp/pgp/utils.py b/src/mailman_pgp/pgp/utils.py
index 0946e3f..a824138 100644
--- a/src/mailman_pgp/pgp/utils.py
+++ b/src/mailman_pgp/pgp/utils.py
@@ -18,7 +18,7 @@
"""Various pgp and email utilities."""
-def copy_headers(from_msg, to_msg):
+def copy_headers(from_msg, to_msg, overwrite=False):
"""
Copy the headers and unixfrom from a message to another one.
@@ -28,6 +28,8 @@ def copy_headers(from_msg, to_msg):
:type to_msg: email.message.Message
"""
for key, value in from_msg.items():
+ if overwrite:
+ del to_msg[key]
if key not in to_msg:
to_msg[key] = value
if to_msg.get_unixfrom() is None: