# junkfilter # a junk email filter system for procmail # Copyright 2003 Gregory Sutter # # $Id: junkfilter.spamassassin,v 2.2 2003/12/01 11:59:49 gsutter Exp $ # # Please read the file "README" and the page # http://junkfilter.zer0.org/ before using junkfilter. # This is junkfilter.spamassassin, which calls the SpamAssassin engine. # (http://spamassassin.sf.net/) # SpamAssassin should have spamd running, and should be configured as # follows (in the local.cf file) to work properly with junkfilter: # # rewrite_subject 0 # report_safe 0 # fold_headers 0 # skip_rbl_checks 1 # optional # clear_headers # add_header spam Flag _YESNOCAPS_ # add_header all Status _YESNO_, hits=_HITS_ required=_REQD_ tests=_TESTS_ autolearn=_AUTOLEARN_ version=_VERSION_ # JFSEC=spamassassin # check for X-Spam-Checker-Version: header and capture if present :0 * ^X-Spam-Checker-Version:[ ]*\/.* { JFXSCV=$MATCH } # check for X-Spam-Flag: header and capture if present :0 * ^X-Spam-Flag:[ ]*\/.* { JFXSF=$MATCH } # check for X-Spam-Level: header and capture if present :0 * ^X-Spam-Level:[ ]*\/.* { JFXSL=$MATCH } # check for X-Spam-Report: header and capture if present :0 * ^X-Spam-Report:[ ]*\/.* { JFXSR=$MATCH } # check for X-Spam-Status: header and capture if present :0 * ^X-Spam-Status:[ ]*\/.* { JFXSS=$MATCH } # call SpamAssassin client :0 fw * < 262144 | /usr/local/bin/spamc # show the score and required score if it's a match. :0 * ^X-Spam-Status: Yes.*[ ]hits=\/[.0-9]+[ ]+required=[.0-9]+ { JFMATCH="$JFSEC: score=$MATCH" INCLUDERC=$JFDIR/junkfilter.match } # remove SA-generated headers. :0 fw | formail -I X-Spam-Checker-Version -I X-Spam-Flag -I X-Spam-Level -I X-Spam-Report -I X-Spam-Status # replace original X-Spam-Checker-Version header if there was one. :0 fw * $ $JFXSCV^0 | formail -I X-Spam-Checker-Version: $JFXSCV # replace original X-Spam-Flag header if there was one. :0 fw * $ $JFXSF^0 | formail -I X-Spam-Flag: $JFXSF # replace original X-Spam-Level header if there was one. :0 fw * $ $JFXSL^0 | formail -I X-Spam-Level: $JFXSL # replace original X-Spam-Report header if there was one. :0 fw * $ $JFXSR^0 | formail -I X-Spam-Report: $JFXSR # replace original X-Spam-Status header if there was one. :0 fw * $ $JFXSS^0 | formail -I X-Spam-Status: $JFXSS JFSEC # EOF junkfilter.spamassassin