summaryrefslogtreecommitdiff
path: root/patch-save.py
diff options
context:
space:
mode:
Diffstat (limited to 'patch-save.py')
-rwxr-xr-xpatch-save.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/patch-save.py b/patch-save.py
index 1c0516f..a9b9a3c 100755
--- a/patch-save.py
+++ b/patch-save.py
@@ -18,6 +18,8 @@
#
import email
+import email.parser
+import email.policy
import pathlib
import re
import sys
@@ -46,7 +48,8 @@ def main(argv):
# Parse the message from stdin as binary, as we can't assume any particular
# encoding.
- msg = email.message_from_binary_file(sys.stdin.buffer)
+ parser = email.parser.BytesParser(policy=email.policy.default)
+ msg = parser.parse(sys.stdin.buffer)
# mailman can mangle the From header to work around DMARC rejection rules.
# It then formats From as "Name via mailing-list <mailing-list@domain>" and