fix case where header isn't string

This commit is contained in:
Son 2022-03-25 16:17:58 +01:00
parent 32fd65b69b
commit ce2d2a3b3a
1 changed files with 2 additions and 1 deletions

View File

@ -1445,7 +1445,8 @@ def get_dmarc_status(msg: Message) -> Optional[DmarcCheckResult]:
spam_result = msg.get_all(headers.SPAMD_RESULT)
if not spam_result:
return None
spam_entries = [entry.strip() for entry in spam_result[-1].split("\n")]
spam_entries = [entry.strip() for entry in str(spam_result[-1]).split("\n")]
for entry_pos in range(len(spam_entries)):
sep = spam_entries[entry_pos].find("(")
if sep > -1: