[Dovecot] sieve spamtest extension

Stephan Bosch stephan at rename-it.nl
Sat May 15 19:13:38 EEST 2010


Nikita Koshikov wrote:

> If X-Spam-Scan-Score have 6-9 digit after dot - the first one ignored, thus
> X-Spam-Scan-Score: 3.6 -> "ge" skips. #right
> X-Spam-Scan-Score: 3.8 -> "ge" works. #wrong
> X-Spam-Scan-Score: 5.9 -> "ge" works. #wrong
> X-Spam-Scan-Score: 6.0 -> "ge" works. #right
> X-Spam-Scan-Score: 6.9 -> "ge" works. #right
> X-Spam-Scan-Score: 7.3 -> "ge" works. #right
> 

Note that the value '0' has a special meaning for the spamtest test. The 
'definitely not spam' value is '1'. Therefore, values ranging from 0.0 
to 10.0 are calculated into a score as follows:

score = (header_value / 10.0) * 9 + 1

So, the 5.9 match is correct as it yields 6.3, matching against "6".

The 3.8 match, however, is not correct. Please run the attached 
testsuite script I composed from your e-mail as follows:

src/testsuite/testsuite nikita-spamtest.svtest

At my end, this test case succeeds fully, including the 3.8 match. The 
test suite script should be fairly easy to understand and modify. If you 
manage to trigger a bug somehow, please let me now.

> If the rule modified to (spamtest :value "ge" :comparator "i;ascii-numeric" "6.0") everything works as expected.
> 

Matching against "6.0" will end at the first non-digit character, which 
should normally be equal to matching against "6". Very strange that this 
somehow helps. What version are you using?

> One more thing - sieve-test. I couldn't test my scripts with it:
> 
>  # sieve-test -x +spamtest -t sieve spam.txt 
> 00000007: SPAMTEST test
> 00000007: spamtest: extension not configured
> 00000013: JMPFALSE (false)
> 

You need to set the configuration by setting the appropriate config 
values in the environment (e.g. SIEVE_SPAMTEST_MAX_VALUE) while calling 
sieve-test. (For Dovecot v2.0 the tools also still don't use the Dovecot 
configuration, which needs to be fixed before the first release).

Regards,

Stephan.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: nikita-spamtest.svtest
Url: http://dovecot.org/pipermail/dovecot/attachments/20100515/7c3f07aa/attachment.pl 


More information about the dovecot mailing list