Modification pour que chaques lists aient ses propres limites de scores.
darcs-hash:20061018095120-9e428-a06402e0c148ee592db468b623e2cfca057d198a.gz
This commit is contained in:
parent
6c689e4002
commit
ab4f97fa27
1 changed files with 15 additions and 5 deletions
|
@ -73,22 +73,32 @@ def process(mlist, msg, msgdata):
|
||||||
if msgdata.get('approved'):
|
if msgdata.get('approved'):
|
||||||
return
|
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))
|
score, symbols = check_message(mlist, str(msg))
|
||||||
|
|
||||||
if MEMBER_BONUS != 0:
|
|
||||||
|
if MEMBER_BONUS_LIST != 0:
|
||||||
for sender in msg.get_senders():
|
for sender in msg.get_senders():
|
||||||
if mlist.isMember(sender) or \
|
if mlist.isMember(sender) or \
|
||||||
matches_p(sender, mlist.accept_these_nonmembers):
|
matches_p(sender, mlist.accept_these_nonmembers):
|
||||||
score -= MEMBER_BONUS
|
score -= MEMBER_BONUS_LIST
|
||||||
break
|
break
|
||||||
|
|
||||||
if score > DISCARD_SCORE:
|
if score > DISCARD_SCORE_LIST:
|
||||||
listname = mlist.real_name
|
listname = mlist.real_name
|
||||||
sender = msg.get_sender()
|
sender = msg.get_sender()
|
||||||
syslog('vette', '%s post from %s discarded: '
|
syslog('vette', '%s post from %s discarded: '
|
||||||
'SpamAssassin score was %g (discard threshold is %g)'
|
'SpamAssassin score was %g (discard threshold is %g)'
|
||||||
% (listname, sender, score, DISCARD_SCORE))
|
% (listname, sender, score, DISCARD_SCORE_LIST))
|
||||||
raise SpamAssassinDiscard
|
raise SpamAssassinDiscard
|
||||||
elif score > HOLD_SCORE:
|
elif score > HOLD_SCORE_LIST:
|
||||||
Hold.hold_for_approval(mlist, msg, msgdata,
|
Hold.hold_for_approval(mlist, msg, msgdata,
|
||||||
SpamAssassinHold(score, symbols))
|
SpamAssassinHold(score, symbols))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue