On Thu, 4 Mar 2004, Michael Dengler wrote:
> Is it possible to tag ALL mails with their spam score regardless of if
> they meet the spam threshold or not?
> I've tried many many ways to get this to happen...but so far no luck.

In procmail, after you run spamc....

# First, delete (or spamfolder) mail tagged by spamassassin:
:0
* ^Subject:.*\[SPAM DELETE\]
/dev/null

# For mail that is ham (Status = "no") 
# And the user has configured their SA to tag ham (test ...)
# extract the hits from the header....
:0fw
* ? test -e $HOME/.mailfilter.tagsubject
* ^X-Spam-Status: No, hits=\/[^ ]*
{
HITS=$MATCH
# And paste that hit number into a subject line tag......
:0fw
* ^Subject: \/.*
| formail -I"Subject: [$HITS] $MATCH"
}

NOTES: This code is part of a system that permits users to configure their
spamassassin to merely TAG spam subjects or DELETE spam.
   Subject: [SPAM DELETE] yada    -OR-    Subject: [SPAM 47.6] yada
Our users also have the option of tagging or not tagging the ham as a
separate choice. Hence the test for '.mailfilter.tagsubject' as a flag.
   Subject: [3.5] yada

Hopefully this explains the 'logic' above. :-)

- Charles

Reply via email to