From ab4f97fa276ae537d75f00445f993a4587c98464 Mon Sep 17 00:00:00 2001 From: bobot Date: Wed, 18 Oct 2006 11:51:20 +0200 Subject: [PATCH] Modification pour que chaques lists aient ses propres limites de scores. darcs-hash:20061018095120-9e428-a06402e0c148ee592db468b623e2cfca057d198a.gz --- mailman/Handlers/SpamAssassin_crans.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/mailman/Handlers/SpamAssassin_crans.py b/mailman/Handlers/SpamAssassin_crans.py index 03e0fd93..b4f1db2b 100644 --- a/mailman/Handlers/SpamAssassin_crans.py +++ b/mailman/Handlers/SpamAssassin_crans.py @@ -73,22 +73,32 @@ def process(mlist, msg, msgdata): if msgdata.get('approved'): return + #Recuperation des parametres SpamAssassin de la liste + + #Score modifie minimum pour que le message soit rejete + DISCARD_SCORE_LIST = getattr(mlist, 'SPAMASSASSIN_DISCARD_SCORE', DISCARD_SCORE) + #Score modifie minimum pour que le message soit mis en attente de moderation + HOLD_SCORE_LIST = getattr(mlist, 'SPAMASSASSIN_HOLD_SCORE', HOLD_SCORE) + #Modificateur du score de Spamassassin selon le nombre d'expediteur du message abonne a la liste. + MEMBER_BONUS_LIST = getattr(mlist, 'SPAMASSASSIN_MEMBER_BONUS', MEMBER_BONUS) + score, symbols = check_message(mlist, str(msg)) - if MEMBER_BONUS != 0: + + if MEMBER_BONUS_LIST != 0: for sender in msg.get_senders(): if mlist.isMember(sender) or \ matches_p(sender, mlist.accept_these_nonmembers): - score -= MEMBER_BONUS + score -= MEMBER_BONUS_LIST break - if score > DISCARD_SCORE: + if score > DISCARD_SCORE_LIST: listname = mlist.real_name sender = msg.get_sender() syslog('vette', '%s post from %s discarded: ' 'SpamAssassin score was %g (discard threshold is %g)' - % (listname, sender, score, DISCARD_SCORE)) + % (listname, sender, score, DISCARD_SCORE_LIST)) raise SpamAssassinDiscard - elif score > HOLD_SCORE: + elif score > HOLD_SCORE_LIST: Hold.hold_for_approval(mlist, msg, msgdata, SpamAssassinHold(score, symbols))