also sprach martin f krafft <madduck@madduck.net> [2013-12-27 18:04 +1300]:
I tested those regular expressions with sed -r, e.g.
% sed -rne "s@^X-Spam-Status: [^,]*, score=-?[[:digit:]]+\.[[:digit:]] required=(-?[[:digit:]]+\.[[:digit:]]).*@\1@p" mailfile 5.0
and they work.
Unfortunately, in sieve scripts, the spamtest value is always 0, which is indicative of the spamtest "not having run", which in this case I assume means that the regular expression didn't match.
The documentation talks about "POSIX regular expressions", but the examples use extended regexps. This should probably be clarified.
However, even if I remove the -r in the above sed call and escape the characters +?(), it does not work. Character classes, such as [:digit:] are available in regular POSIX regexps, to my knowledge.
So: the documentation needs clarification, but my problem remains.
Yes, I could just "text"-match against X-Spam-Flag (which I now do), but I'd prefer it if the user could match against a spam probability, e.g. already filter if SpamAssassin assigns 6 out of 10 required points.
Thanks,
-- martin | http://madduck.net/ | http://two.sentenc.es/
"geld ist das brecheisen der macht." - friedrich nietzsche
spamtraps: madduck.bogus@madduck.net