[Dovecot] SpamAssassin and i;ascii-numeric comparator

Julian Cowley julian at lava.net
Sun Jan 24 11:42:28 EET 2010


Hi Stephan,

I noticed that you changed i;ascii-numeric comparator recently 
(<http://hg.rename-it.nl/dovecot-1.2-sieve/rev/17fb38aee85f>) to correct a 
small bug.  I have an interest in this because I use the comparator to 
check for SpamAssassin scores.  Before the fix, this was all that was 
necessary to check for scores above a certain value:

     header :value "ge" :comparator "i;ascii-numeric" "X-Spam-Score" "5"

Since SpamAssassin includes negative scores and the i;ascii-numeric 
comparator doesn't recognize negative numbers, all negative scores are 
actually treated as positive infinity after the fix.  Of course, this 
means mail which has a negative score then gets counted as spam.

Now an additional test is necessary, something like this:

     allof(not header :matches "X-Spam-Score" "-*",
 	  header :value "ge" :comparator "i;ascii-numeric" "X-Spam-Score" "5")

I thought I'd mention this because other people may get affected by this 
once 0.1.15 comes out.

Here is a patch that makes further tests for the comparator between 
numeric and non-numeric values.  Hope you can use it.

-=- julian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: db2b3626e180.patch
Type: text/x-diff
Size: 1987 bytes
Desc: 
Url : http://dovecot.org/pipermail/dovecot/attachments/20100123/2dadcfa2/attachment.bin 


More information about the dovecot mailing list