Fix compatibility with multiline MIME encoded header
This commit is contained in:
parent
4df7393069
commit
fd1a397c14
1 changed files with 2 additions and 1 deletions
3
check.py
3
check.py
|
@ -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 ""
|
||||
|
|
Reference in a new issue