Try around decode
This commit is contained in:
parent
c1bfaec431
commit
ab56c33c27
1 changed files with 4 additions and 1 deletions
|
@ -132,7 +132,10 @@ class ImapFilter:
|
|||
data
|
||||
)
|
||||
return {"match": False}
|
||||
part = data[1].decode('utf-8')
|
||||
try:
|
||||
part = data[1].decode('utf-8')
|
||||
except UnicodeDecodeError:
|
||||
part = data[1]
|
||||
message = email.message_from_string(part)
|
||||
decoded_field = email.header.decode_header(message.get(mfilter['field'], ""))
|
||||
if isinstance(decoded_field[0][0], str):
|
||||
|
|
Loading…
Reference in a new issue