diff options
Diffstat (limited to 'src/mailman_pgp/pgp/utils.py')
| -rw-r--r-- | src/mailman_pgp/pgp/utils.py | 4 |
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: |
