On 17-nov-2006, at 14:17, Vladimir wrote:
Hi all.
I'm using libsieve with dbmail system.
I want to filter messages based on the "X-Spam-Score" header field.
For example:
require ["fileinto", "comparator-i;ascii-numeric"];
if
header :value "ge" :comparator "i;ascii-numeric" ["X-Spam-
score"] ["10"] {
discard;
stop;
}
But when i try to insert the script into dbmail it says:
Script has errors: Parse error on line [1]: unsupported feature:
comparator-i;ascii-numeric.
I've discovered, that comparator-i;ascii-numeric is not implemented in
libsieve (according to http://wiki.fastmail.fm/index.php/
SieveExtensionsSupportMatrix)
Is there a workaround? How can i compare numeric values?
This may not be what you're looking for, but I tested the following
script
a few days ago and that worked fine. I don't have access to the exact
script right now, so the following may contain bugs:
require ["fileinto", "regex"];
if header :regex ["X-Spam-Level"] "^\*{3,}" {
fileinto "Spam";
}
I.e.: if the X-Spam-Level header starts with 3 stars, file the mail
into "Spam".
Of course this will only work if your spam filter actually adds an X-
Spam-Level
header which contains a string representation of the numerical score.
Leander