From: "sebast...@debianfan.de" <sebast...@debianfan.de> Date: Sun, 05 Apr 2009 01:56:38 +0200 Hello, i am filtering mails with spamassassin & procmail. This is more of a procmail question, so it doesn't actually belong here.
The header of message X-Spam-Level: ****************** I want to sort mails into some different directories. 10 or more --> directory 10 9 --> directory 9 and so one.... Do you really want that many different mail folders? Wouldn't low>=5, mid>=10 and high>=15 be sufficient? But - nothing happens - the mails are all in the /Maildir/new directory why ? The .*\( part. :0: * ^X-Spam-Level: .*\(\*\*\*\*\*\*\*\*\*\* Maildir/10/new You don't need the .* and you don't want the \( * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\* Also, You can use the numeric score directly. For example, you can set X_SPAM_SCORE in a procmail recipe the be the number following score= on the X-Spam-Status line. X_IS_SPAM="Unknown" X_SPAM_SCORE="" :0 * ^X-Spam-Status: \/.* { :0 * ^X-Spam-Status: \/(Yes|No|YES|NO|Skipped) { X_IS_SPAM="$MATCH" } :0 * ^X-Spam-Status: (Yes|No|YES|NO)[, ]+(hits|score)=\/([-0-9.]+) { X_SPAM_SCORE="$MATCH" } } Then you can do recipes like this that matches spam scoring 12.5 or higher. SPAM_CUTOFF=12.499 :0 * X_IS_SPAM ?? (Yes|YES) *$ -$SPAM_CUTOFF ^0 *$ $X_SPAM_SCORE ^0 somefolder :0: * ^X-Spam-Level: .*\(\*\*\*\*\*\*\*\*\*\* Maildir/10/new :0: * ^X-Spam-Level: .*\(\*\*\*\*\*\*\*\*\* X-Spam-Level: ******* Maildir/9/new You don't want the extra 'X-Spam-Level: *******' line here. -jeff