aboutsummaryrefslogtreecommitdiffstats
path: root/news2mail.py
diff options
context:
space:
mode:
Diffstat (limited to 'news2mail.py')
-rw-r--r--news2mail.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/news2mail.py b/news2mail.py
index 624290f..a92c7e5 100644
--- a/news2mail.py
+++ b/news2mail.py
@@ -26,6 +26,7 @@ from __future__ import absolute_import
from __future__ import print_function
from collections import OrderedDict
import email
+import email.policy
import smtplib
from socket import gethostbyaddr, gethostname
import sys
@@ -52,7 +53,8 @@ class news2mail(object):
self.heads_dict = {}
self.article, self.headers, self.body = [], [], []
- self.message = self.__addheads(email.message_from_binary_file(sys.stdin.buffer))
+ self.message = self.__addheads(
+ email.message_from_file(sys.stdin, policy=email.policy.default))
def __addheads(self, msg):
"""add new header like X-Gateway: Received: