handle case spamassassin can't be reached
This commit is contained in:
parent
735c0310fd
commit
24d8babe46
|
@ -1225,9 +1225,12 @@ async def get_spam_score(message: Message) -> float:
|
|||
)
|
||||
return response.headers["Spam"].score
|
||||
except asyncio.TimeoutError:
|
||||
LOG.warning("SpamAssassin timeout on: %s", message)
|
||||
LOG.exception("SpamAssassin timeout")
|
||||
# return a negative score so the message is always considered as ham
|
||||
return -999
|
||||
except Exception:
|
||||
LOG.exception("SpamAssassin exception")
|
||||
return -999
|
||||
|
||||
|
||||
class MailHandler:
|
||||
|
|
Loading…
Reference in New Issue