From c1ad161db7f540b35c7735851aca17e2978ce822 Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Fri, 11 Dec 2020 11:05:01 +0100 Subject: [PATCH] add email_log to get_spam_score --- email_handler.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/email_handler.py b/email_handler.py index 25221c97..992efc32 100644 --- a/email_handler.py +++ b/email_handler.py @@ -616,7 +616,7 @@ def forward_email_to_mailbox( if SPAMASSASSIN_HOST: start = time.time() - spam_score = get_spam_score(msg) + spam_score = get_spam_score(msg, email_log) LOG.d( "%s -> %s - spam score %s in %s seconds", contact, @@ -851,7 +851,7 @@ def handle_reply(envelope, msg: Message, rcpt_to: str) -> (bool, str): # do not use user.max_spam_score here if SPAMASSASSIN_HOST: start = time.time() - spam_score = get_spam_score(msg) + spam_score = get_spam_score(msg, email_log) LOG.d( "%s -> %s - spam score %s in %s seconds", alias, @@ -1657,8 +1657,8 @@ async def get_spam_score_async(message: Message) -> float: return -999 -def get_spam_score(message: Message) -> float: - LOG.debug("get spam score for %s", message[_MESSAGE_ID]) +def get_spam_score(message: Message, email_log: EmailLog) -> float: + LOG.debug("get spam score for %s", email_log) sa_input = to_bytes(message) # Spamassassin requires to have an ending linebreak