mirror of
https://github.com/samsonjs/imapbackup.git
synced 2026-03-25 08:45:53 +00:00
fix for non utf8 content in raw email
This commit is contained in:
parent
e60ad2c96b
commit
0f07508b14
1 changed files with 2 additions and 2 deletions
|
|
@ -274,7 +274,7 @@ def scan_folder(server, foldername, nospinner):
|
|||
if 'OK' != typ:
|
||||
raise SkipFolderException("FETCH %s failed: %s" % (num, data))
|
||||
|
||||
data_str = str(data[0][1],'utf-8')
|
||||
data_str = str(data[0][1], 'utf-8', 'replace')
|
||||
header = data_str.strip()
|
||||
|
||||
# remove newlines inside Message-Id (a dumb Exchange trait)
|
||||
|
|
@ -292,7 +292,7 @@ def scan_folder(server, foldername, nospinner):
|
|||
if 'OK' != typ:
|
||||
raise SkipFolderException(
|
||||
"FETCH %s failed: %s" % (num, data))
|
||||
data_str = str(data[0][1], 'utf-8')
|
||||
data_str = str(data[0][1], 'utf-8', 'replace')
|
||||
header = data_str.strip()
|
||||
header = header.replace('\r\n', '\t').encode('utf-8')
|
||||
messages['<' + UUID + '.' +
|
||||
|
|
|
|||
Loading…
Reference in a new issue