You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by giga328 <gi...@hotmail.com> on 2008/02/01 12:34:10 UTC

Splitting test in two parts

I would like to split SpamAssassin test in two parts:
a) all test except in b) ;)
b) several expensive test which can not produce negative score
If after doing tests in a) score is greater than needed I would like to stop
scanning with spam result. If score is not big enough I would like that
SpamAssassing start tests from b).
If this is not possible, I would be happy to do it with third group with
just one test to shortcircuit scanning.
I read manual for Mail::SpamAssassin::Plugin::Shortcircuit but I must admit
it is to hard for one beginner.

Regards,
Giga

-- 
View this message in context: http://www.nabble.com/Splitting-test-in-two-parts-tp15224905p15224905.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.


Re: Splitting test in two parts

Posted by Matt Kettler <mk...@verizon.net>.
giga328 wrote:
> I would like to split SpamAssassin test in two parts:
> a) all test except in b) ;)
> b) several expensive test which can not produce negative score
> If after doing tests in a) score is greater than needed I would like to stop
> scanning with spam result. If score is not big enough I would like that
> SpamAssassing start tests from b).
>   
Currently there's no feature that does exactly that in SA. Shortcircuit, 
as you've mentioned below, is the closest you can get.

Also, make sure you're not trying to delay the DNS based tests this way. 
Your performance will probably suffer, as SA already launches the DNS 
tests early, but then moves on to running other rules before collecting 
the DNS results later on.. (ie: DNS lookups currently occur in parallel 
with the rest of the rules, delaying the launch would cause them to run 
sequentially)
> If this is not possible, I would be happy to do it with third group with
> just one test to shortcircuit scanning.
> I read manual for Mail::SpamAssassin::Plugin::Shortcircuit but I must admit
> it is to hard for one beginner.
>   
Well, re-ordering rule execution isn't exactly a "beginner" activity.

However, some key points to understand:

First, you need to understand how SA's priority keyword works. You need 
it to make useful use of the ShortCircuit plugin, and it is documented 
in the main Conf page, be sure to read about it there.. Essentially 
you'll be using priority to create your "groups". SpamAssassin grabs all 
the rules at the lowest priority (usually the most negative), and runs 
them all, and moves on to the next priority, runs those, etc, etc.

Shortcircuit works by stopping SA if the rule that's tagged for 
shortciruiting matches. Score has nothing to do with it, nor do any 
other rules. Shortcircuit  is just "if this rule hits, stop". It is 
designed to be used for things like whitelist or blacklist rules that 
are going to so heavily influence the message score there's no point in 
running any other rules at all.

> Regards,
> Giga
>
>