mirror of
https://github.com/simple-login/app.git
synced 2025-11-09 17:30:44 +08:00
return only bounce report that can be decoded
This commit is contained in:
parent
278a9d19c6
commit
9c27f94e8e
1 changed files with 8 additions and 1 deletions
|
|
@ -644,7 +644,14 @@ def get_mailbox_bounce_info(bounce_report: Message) -> Optional[Message]:
|
|||
if not part["content-transfer-encoding"]:
|
||||
LOG.w("add missing content-transfer-encoding header")
|
||||
part["content-transfer-encoding"] = "7bit"
|
||||
return part
|
||||
|
||||
try:
|
||||
part.as_bytes().decode()
|
||||
except UnicodeDecodeError:
|
||||
LOG.w("cannot use this bounce report")
|
||||
return
|
||||
else:
|
||||
return part
|
||||
|
||||
|
||||
def get_orig_message_from_hotmail_complaint(msg: Message) -> Optional[Message]:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue