Fix compatibility with multiline MIME encoded header

This commit is contained in:
nemunaire 2018-04-09 00:20:43 +02:00
parent 4df7393069
commit fd1a397c14
1 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@
from datetime import datetime
import email
import email.policy
import os
import sys
import stat
@ -128,7 +129,7 @@ running for nemunaire@nemunai.re""")
def readmail(fp):
cnt = email.message_from_binary_file(fp)
cnt = email.message_from_binary_file(fp, policy=email.policy.default)
frm = cnt.get("From") or "someone"
subject = cnt.get("Subject") or "your mail"
ref = cnt.get("Message-ID") or ""