You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by "Kevin A. McGrail" <km...@pccc.com> on 2007/04/13 12:32:27 UTC

A Good Email for Shortcutting Rule Processing Fw: [Mimedefang] Memory Limit Variables?

David is the author of MIMEDefang and I thought his email below on 
short-circuiting deserved to be forwarded.

Regards,
KAM
----- Original Message ----- 
From: "David F. Skoll" <df...@roaringpenguin.com>
To: <mi...@lists.roaringpenguin.com>
Sent: Thursday, April 12, 2007 5:04 PM
Subject: Re: [Mimedefang] Memory Limit Variables?


> Mack wrote:
>
>> The -VE rules should be run before the +VE rules, i would have thought 
>> tbh,
>
> Not necessarily.  What if some of the negative rules are very expensive?
> The optimal order is a nightmare to figure out, but a first cut might go
> something like this:
>
> 1) Split the rules into positive- and negative-weighted sets.
>
> 2) Sort the rules by some combination of score and "cost of evaluation"
>
> 3) Kick off any "background" rules first.  These are things like DNS
> lookup that can proceed (sort-of) asynchronously while computation goes 
> on.
> These background rules must all be positive-weighted or the algorithm
> below breaks.
>
> 4) WHILE there are still negative-weighted rules OR your score is below 
> the
>   spam threshold:
>
>  4a) Run through the positive-weighted rules in order, until you either 
> hit
>      your threshold or there are no more positive rules left.
>  4b) Run through the negative-weighted rules in order, until you either 
> dip
>      below your threshold or there are no more negative rules left.
>
> 5) If you're below your threshold, wait for the scores to trickle in from
> the asynchronous rules and add them to the score.  (You can stop if it
> exceeds the spam threshold).
>
> Nasty!
>
> Regards,
>
> David.
> _______________________________________________
> NOTE: If there is a disclaimer or other legal boilerplate in the above
> message, it is NULL AND VOID.  You may ignore it.
>
> Visit http://www.mimedefang.org and http://www.roaringpenguin.com
> MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
>