#Copyright (C) 2002 Robert # #This code segment is free software; you can redistribute it and/or #modify it under the terms of the GNU General Public License #as published by the Free Software Foundation; either version 2 #of the License, or (at your option) any later version. # #This program is distributed in the hope that it will be useful, #but WITHOUT ANY WARRANTY; without even the implied warranty of #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. # #You should have received a copy of the GNU General Public License #along with this code segment; if not, write to the Free Software #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. MAINADDR=robert@dummy.no-ip.com SECONDADDR=robert@yourcompany.com ROOTADDR=root@yourcompany.com WHERE=work WORKDOMAINS=yourcompany TRASHDIR=$HOME PROCMAIL_TRASHDIR=$TRASHDIR/procmail LOWPRIORITY=$HOME/lowpriority PROCMAIL_TRASH=$HOME/spam GLOBLOCKFILE=$LOGFILE.lock #LOGABSTRACT=yes #VERBOSE=on # used for both this script and SpamBouncer SPAMMESSIDS=$TRASHDIR/spam.messids NASTIESFILE=$HOME/junkicide.proc.nasties RAZORFLAGS="" :0hfw *! ^return-path:.*[^-_.a-z0-9][a-z0-9][-_.a-z0-9=+]*@[-_.a-z0-9]+\.[a-z]?[a-z][a-z]($|[^-_.a-z0-9]) |formail -i Return-Path: FROM=`formail -ztrx To:` :0w *FROM??^^\/.+ { FROM=$MATCH } :0w *FROM??^foo@bar$ { FROM="" } #FROM=|printenv FROM|perl -e '@_=<>;$_=join("",@_);while (s/\n$//) {};s/.*\n//g;print;' IFBOUNCESSNEAK="" :0w *^from:.*\|[^0-9a-z]*[0-9a-z]+@sneakemail\.com *^x-sneakemail-is-sneakemail: *^x-sneakemail-from: { #:0hw #FROM1=|formail -zx From:\ # |sed -n 's,^.*[^-._a-zA-Z0-9]\([a-zA-Z0-9][-._+a-zA-Z0-9=+]*@[-_.a-zA-Z0-9]*\.[a-zA-Z]*[a-zA-Z][a-zA-Z]\).*@.*$,\1,p' FROM1=`formail -i From: -R X-Sneakemail-From: From:|formail -ztrx To:` IFBOUNCESSNEAK="-i Reply-To: -R From: Reply-To: \ -R X-Sneakemail-From: From: -I X-Sneakemail-Label: \ -I X-Sneakemail-Keyword: -I X-Sneakemail-Address: \ -I X-Sneakemail-Is-Sneakemail: \ -I X-Sneakemail-Folder-Path: \ -I X-Sneakemail-Rcpt: \ -I X-Sneakemail-Return- \ -I X-Sneakemail-Inc-Phrase:" } #FROM=`formail -c -zx From: | sed -e 's, ,,g;s,.*<,,;s,>.*,,;s,(.*),,'` HDRFILT="-I X-SB -I X-Spam- -I X-Spam: -I X-SpamBouncer: -I X-AntiVirus: \ -I X-to: -I X-UIDL: -I X-UID: -I X-Fetchmail- -I MBOX-Line: \ -I Delivered-To: -I X-Loop: -I Return-Path: -I Old- -I X-match: \ -I X-header-match: -I X-forged-from: -I X-Precedence: \ -I X-pstn- -I X-Sonic- $IFBOUNCESSNEAK -I X-DSPAM- \ -I Priority: -I X-DCC- -I X-score -I X-nastiness -I X-Bogosity \ -I Delivery-date: -I Envelope-to: -I X-Keywords: -I X-full \ -I X-HELO- -I Bcc: -I X-SpamBayes -I X-SpamProbe -I Fcc: \ -I X-friends: -I Keywords:" :0w *FROM1??^^^^ { FROM1=`formail -zrx To:` } :0w *FROM1??^^\/.+ { FROM1=$MATCH } :0w *$FROM1??^$FROM$ { FROM1="" } :0w *FROM1??^foo@bar$ { FROM1="" } FROM2="" :0w *^x-from: { FROM2=`formail -zx X-from:\ |sed -e 's,^.*[^-._a-zA-Z0-9]\([a-zA-Z0-9][^@]*@[-_.a-zA-Z0-9]*[.a-zA-Z][a-zA-Z][a-zA-Z]\).*@.*$,\1,'` } :Ew *^x-sneakemail-address: { FROM2=`formail -zx X-Sneakemail-Address:` } :0w *FROM2??^foo@bar$ { FROM2="" } PRIORITY="D" SAVE_TO="" :0w *!^x-sbrule: { :0fhw *^x-spam-report:.*[^a-z](invalid_msgid) |formail -a "X-SBRule: empty Message-ID:" :Efhw *^x-spam-report:.*[^a-z](to_empty) |formail -a "X-SBRule: empty To:" :Efhw *^x-spam-report:.*[^a-z](from_(missing|malformed)) |formail -a "X-SBRule: empty From:" } VERBOSE=on :0c *^x-sbrule: *empty () /dev/null :Ec *!NOLOOP?^^^^ *$^TO$NOLOOP@ /dev/null :Ew *$^TO\/($MAINADDR) { SAVE_TO="$MATCH" } :0w *BAYESHEAD??^^^^ { EXTRAFILTEROUT="-I X-SpamBayes" } :0fhw *SCORE??^^^^ |formail -I X-Bogosity: -I X-SpamProbe: $EXTRAFILTEROUT EXTRAFILTEROUT :0w *$^(x-loop|old-(delivered|envelope)-to): *(mailer-daemon|$MAINADDR) *B??.*(x-ifbounce|return-path|received): { LOCKFILE=$GLOBLOCKFILE LOG="`formail -x X-SBRule: -x X-SBNote: -x X-Spam-Report:` " :0Bw *^to: { LOG="`formail -I ''|/bin/grep -i '^to: '|sed -e 's,^, ,'` " } :0Bw *^subject: { LOG="`formail -I ''|/bin/grep -i '^subject: '|sed -e 's,^, ,'` " } VERBOSE=off LOG=" junk: bounced direct auto-response: " :0w *?which fuzzysum { SUBJECT=`formail -x Subject:|cut -c2-71` HASH=`formail -I ""|(printenv SUBJECT;\ sed -e '/^-----BEGIN PGP SIGNATURE-----$/d;/^-----END PGP SIGNATURE-----$/d')\ |head -c 100000|fuzzysum -b` SUBJECT } :0Bw *.*x-ifbounce: *\/[.a-z0-9]+/[.0-9]+ *.*x-loop: { IFBOUNCESPATH=$MATCH IFBOUNCESFILE="`basename $IFBOUNCESPATH`" IFBOUNCESDIR="`dirname $IFBOUNCESPATH`" PROCMAIL_TRASHDIRDIR="`dirname $PROCMAIL_TRASHDIR`" VERBOSE=off LOG=`echo -n ' '; cat "$PROCMAIL_TRASHDIRDIR/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" | formail -X Subject:; cat >/dev/null` LOG=" " VERBOSE=on #:0icw #|head -20 `dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE 1>&2 :0c *?which razor-report |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | razor-report $RAZORFLAGS; cat >/dev/null :0c *?which pyzor |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | pyzor report 2>/dev/null; cat >/dev/null :0c *?which dccproc |[ ! -d $TRASHDIR/dccproc ] \ && mkdir $TRASHDIR/dccproc; \ cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | dccproc -l $TRASHDIR/dccproc; \ cat >/dev/null :0cw:$HOME/.idata.lock *?which ifile |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | formail -I "From " \ | phrases $HOME/.idata.phrases | ifile -k -S -w -m 100000 -i spam \ && cat >/dev/null :0Bcw:$HOME/.bogofilter.lock *!^x-bogosity: *spam *?which bogofilter |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Acw:$HOME/.bogofilter1.lock #|cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0Bc *^x-spamprobe: *^x-spamprobe: *spam /dev/null :Ecw:$HOME/.spamprobe.lock *?which spamprobe |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | spamprobe -Y -Hall train-spam \ && cat >/dev/null :0Bc *^x-dspam *^x-dspam[^:]*:.*\/dev/null :0Bc *^x-spambayes *^x-spambayes[^:]*: *spam /dev/null :Ecw:$HOME/.hammiedb.lock *?which sb_filter.py |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | sb_filter.py -s \ && cat >/dev/null :0w *?which fuzzysum { IFBOUNCEDFILE="`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" SUBJECT=`formail -x Subject: < $IFBOUNCEDFILE|cut -c2-71` HASH=`formail -I "" < $IFBOUNCEDFILE|(printenv SUBJECT;\ sed -e '/^-----BEGIN PGP SIGNATURE-----$/d;/^-----END PGP SIGNATURE-----$/d')\ |head -c 100000|fuzzysum -b` IFBOUNCEDFILE SUBJECT } :0hcw:$SPAMMESSIDS.lock |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | formail -D 122880 $SPAMMESSIDS; \ formail -D 122880 $SPAMMESSIDS; exit 0 } :EBw *^(return-path|received): { NEWHEAD=`formail -I "" \ | sed -n 's,^Subject: Re: ,Subject: ,I;/^return-path: /I,/^$/{p;b;};/^received: /I,/^$/p' \ | formail $HDRFILT` SUBJECT=`formail -I "" \ | sed -n 's,^Subject:,,p'|cut -c2-71` HASH=`formail -I "" \ | sed -n '/^Return-Path: /,$p;/^Received: /,$p' \ | (printenv SUBJECT;\ sed -e '/^-----BEGIN PGP SIGNATURE-----$/d;/^-----END PGP SIGNATURE-----$/d')\ |head -c 100000|fuzzysum -b` :0bc *?which razor-report |printenv NEWHEAD | razor-report $RAZORFLAGS :0bc *?which pyzor |printenv NEWHEAD | pyzor report 2>/dev/null; cat >/dev/null :0bc *?which dccproc |printenv NEWHEAD | dccproc -l $TRASHDIR/dccproc :0bc:$HOME/.idata.lock *?which ifile |printenv NEWHEAD \ | head -c 100000 \ | formail -I "From " \ | phrases $HOME/.idata.phrases | ifile -k -S -w -m 100000 -i spam \ && cat >/dev/null :0Bbc:$HOME/.bogofilter.lock *!^x-bogosity: *spam *?which bogofilter |printenv NEWHEAD \ | head -c 100000 \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:ABbc:$HOME/.bogofilter1.lock #|printenv NEWHEAD \ # | head -c 100000 \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0Bc *^x-spamprobe: *^x-spamprobe: *spam /dev/null :Ebc:$HOME/.spamprobe.lock *?which spamprobe |printenv NEWHEAD \ | head -c 100000 \ | spamprobe -Y -Hall train-spam \ && cat >/dev/null :0Bc *^x-dspam *^x-dspam[^:]*:.*\/dev/null :0Bc *^x-spambayes *^x-spambayes[^:]*: *spam /dev/null :Ebc:$HOME/.hammiedb.lock *?which sb_filter.py |printenv NEWHEAD \ | head -c 100000 \ | sb_filter.py -s \ && cat >/dev/null :0hcw:$SPAMMESSIDS.lock |printenv NEWHEAD \ | formail -D 122880 $SPAMMESSIDS; \ formail -D 122880 $SPAMMESSIDS; exit 0 NEWHEAD } :0w *!HASH??^^^^ { # this is wrong; shouldn't be non-spam #:0hcw:$TRASHDIR/procmail_junk.messids.lock #|formail -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -I "Message-ID: <$HASH@unknown>" /dev/null } :0hcw:$TRASHDIR/procmail_junk.messids.lock |formail -D 122880 $TRASHDIR/procmail_junk.messids; exit 0 LOCKFILE VERBOSE=off :0: $PROCMAIL_TRASH } :Ec *^FROM_DAEMON /dev/null # don't trust any mailer :Ec *^x-sbrule: *empty () /dev/null # if it's addressed to us and it's someone we know, continue on... #|pstn-levels:[^a-z]*s:[^0-9]*0\.0 :Ec *^x-spam-status: *yes /dev/null :Ew *$^subject: cron[ ]*(:.*|<)$LOGNAME *^return-path: *[^@]*$ { PRIORITY="C" } :Ew *^from data@sneakemail\.com { PRIORITY="B" } # NOBOUNCE is used by both SpamBouncer and various processes in here NOBOUNCE=$SBDIR/nobounce :0w *PRIORITY??^[^ABC]$ *NASTINESS??^^^^ { LOCKFILE=$GLOBLOCKFILE VERBOSE=on #|/bin/cp $TRASHDIR/procmail_junk.messids $TRASHDIR/procmail_junk.messids.$$; formail -D 122880 $TRASHDIR/procmail_junk.messids.$$; RET=$?; /bin/rm $TRASHDIR/procmail_junk.messids.$$; exit $RET :0Wihc:$SPAMMESSIDS.lock *NASTINESS??^^^^ *^message-id: *\/[^ ]+ |[ -f $SPAMMESSIDS ] && strings -1 $SPAMMESSIDS|/bin/fgrep -x "$MATCH" :aw { VERBOSE=off LOG=" junk: repeated spam " :0: $PROCMAIL_TRASH } :0ihc *?which dccproc |[ ! -d $TRASHDIR/dccproc ] && mkdir $TRASHDIR/dccproc # don't know why this is needed 10/12/2007 #MOREFROM="" #:0w #*!FROM1??^^^^ #{ MOREFROM="\|$FROM1" } #:0w #*!FROM2??^^^^ #{ MOREFROM="\|$FROM2" } #*!?set -xv;[ -f $TRASHDIR/procmail_junk.messids ] \ # && strings -1 $TRASHDIR/procmail_junk.messids \ # | /bin/grep -x "$FROM$MOREFROM" :0w *!^FROM_DAEMON *?which fuzzysum { SUBJECT=`formail -x Subject:|cut -c2-71` HASH=`formail -I ""|(printenv SUBJECT;\ sed -e '/^-----BEGIN PGP SIGNATURE-----$/d;/^-----END PGP SIGNATURE-----$/d')\ |head -c 100000|fuzzysum -b` SUBJECT :0Wihc:$SPAMMESSIDS.lock *!HASH??^^^^ |[ -f $SPAMMESSIDS ] && \ strings -1 $SPAMMESSIDS|/bin/fgrep -x "<$HASH@unknown>" :aw |set -xv;/bin/fgrep -i -x "$FROM" $NOBOUNCE \ || ([ "$FROM1" ] && /bin/fgrep -i -x "$FROM1" $NOBOUNCE) \ || ([ "$FROM2" ] && /bin/fgrep -i -x "$FROM2" $NOBOUNCE) :ew { VERBOSE=off LOG=" junk: repeated hash spam " :0c *?which razor-report |formail $HDRFILT | razor-report $RAZORFLAGS :0c *?which pyzor |formail $HDRFILT | pyzor report 2>/dev/null; cat >/dev/null :0c *?which dccproc |formail $IFBOUNCESSNEAK | dccproc -l $TRASHDIR/dccproc :0c:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -I "From " $HDRFILT \ | phrases $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -i spam \ && cat >/dev/null :0c:$HOME/.bogofilter.lock *?which bogofilter |head -c 100000 | formail $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Ac:$HOME/.bogofilter1.lock #|head -c 100000 | formail $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail $HDRFILT \ | spamprobe -Y -Hall train-spam \ && cat >/dev/null :0c:$HOME/.dspam.lock *?which dspam |head -c 100000 | formail $HDRFILT \ | dspam --user $LOGNAME --stdout --source=corpus --class=spam \ && cat >/dev/null # avoid overtraining spambayes -- 10/27/07 #:0c:$HOME/.hammiedb.lock #*?which sb_filter.py #|head -c 100000 | formail $HDRFILT \ # | sb_filter.py -s \ # && cat >/dev/null :0hcw:$SPAMMESSIDS.lock *!HASH??^^^^ |formail -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -D 122880 $SPAMMESSIDS; exit 0 # this is wrong; this should not be a non-spam #:0hcw:$TRASHDIR/procmail_junk.messids.lock #*^message-id: #|formail -D 122880 $TRASHDIR/procmail_junk.messids; exit 0 :0: $PROCMAIL_TRASH } } VERBOSE=off LOCKFILE } REPEATED=no :0w *PRIORITY??^[^ABC]$ *NASTINESS??^^^^ *!x-spambayes[^:]*: *spam { LOCKFILE=$GLOBLOCKFILE VERBOSE=on :0Wihc:$TRASHDIR/procmail_junk.messids.lock *^message-id: *\/[^ ]+ |[ -f $TRASHDIR/procmail_junk.messids ] && \ strings -1 $TRASHDIR/procmail_junk.messids|/bin/fgrep -x "$MATCH" :aw { VERBOSE=off LOG=" repeated message " REPEATED=yes :0hfw |formail -i "X-match: repeated" } :0Wihc:$TRASHDIR/procmail_junk.messids.lock *!HASH??^^^^ |[ -f $TRASHDIR/procmail_junk.messids ] && \ strings -1 $TRASHDIR/procmail_junk.messids|/bin/fgrep -x "<$HASH@unknown>" :aw { VERBOSE=off LOG=" repeated hash " :0hcw:$TRASHDIR/procmail_junk.messids.lock *^message-id: |formail -D 122880 $TRASHDIR/procmail_junk.messids; exit 0 REPEATED=yes :0hfw |formail -i "X-match: repeated hash" } VERBOSE=off LOCKFILE } :0w *PRIORITY??^[^ABC]$ *!REPEATED??yes { LOCKFILE=$GLOBLOCKFILE VERBOSE=on FILENO1=$FILENO ORIGTRAP=$TRAP #PREVTRAP="" #:0w #*!TRAP??^^^^ #{ PREVTRAP="; $TRAP" ORIGTRAP=$TRAP } #TRAP='[ "$EXITCODE" = 0 ]'" \ # && lockfile -l60 $TRASHDIR/procmail_junk.messids.lock\ # && (head -c 100000 \ # | formail -D 122880 $TRASHDIR/procmail_junk.messids\ # || true) \ # && /bin/rm -f $TRASHDIR/procmail_junk.messids.lock$PREVTRAP" #PREVTRAP #:0w #*NASTINESS??^^^^ #*!HASH??^^^^ #{ # # [ -z '$SAVE_TO' ] && \ # # this statement must occur after above setting of TRAP # # because TRAP must be non-empty # TRAP="$TRAP; "'[ "$EXITCODE" = 0 -a "$RESPOND" != yes ]'" \ # && lockfile -l60 $TRASHDIR/procmail_junk.messids.lock\ # && (formail -I 'Message-ID: <$HASH@unknown>' ?From )([^>]*[^(.%@a-z0-9])?\ (pineapp-notify|Post(ma?(st(e?r)?|n)|office)|(send)?Mail(er)?\ |sysadmin|daemon|m(mdf|ajordomo)|n?uucp|LIST(SERV|proc)|NETSERV\ |o(wner|ps)|r(e(quest|sponse))|bbs\.smtp|echo\ |mirror|s(erv(ices|er)|mtp(error)?|ystem)\ |A(dmin(istrator)?|MMGR|utoanswer)|notify@yahoogroups\.com)(([^).!:a-z0-9][-_a-z0-9]*)?\ [%@>\t ][^<)]*(\(.*\).*)?)?$([^>]|$))\ |^TO\/mailer-daemon@|^\/x-(sbpass|spam-report):.*[^a-z](abuse|mailer[-_]daemon)) { LOG="`printenv MATCH | sed -e 's,^, ,'; cat >/dev/null` " :0Bw *.*x-loop: *mailer-daemon { VERBOSE=off LOG="`formail -x X-SBRule: -x X-SBNote: -x X-Spam-Report:` " :0Bw *^to: { LOG="`formail -I ''|/bin/grep -i '^to: '|sed -e 's,^, ,' && echo ""` " } :0Bw *^subject: { LOG="`formail -I ''|/bin/grep -i '^subject: '|sed -e 's,^, ,'` " } LOG="junk: simulated bounce bounced mailer-daemon auto-response: " :0: $PROCMAIL_TRASH } :EBw *$.*x-loop: *($MAINADDR) { VERBOSE=off LOG=`formail -x X-SBRule: -x X-SBNote: -x X-Spam-Report:` LOG=" " :0Bw *^to: { LOG="`formail -I ''|/bin/grep -i '^to: '|sed -e 's,^, ,'` " } :0Bw *^subject: { LOG="`formail -I ''|/bin/grep -i '^subject: '|sed -e 's,^, ,'` " } :0Bw *.*x-ifbounce: *\/[.a-z0-9]+/[.0-9]+ *.*x-loop: { IFBOUNCESPATH=$MATCH IFBOUNCESFILE="`basename $IFBOUNCESPATH`" IFBOUNCESDIR="`dirname $IFBOUNCESPATH`" PROCMAIL_TRASHDIRDIR="`dirname $PROCMAIL_TRASHDIR`" LOG=`echo -n ' '; \ cat "$PROCMAIL_TRASHDIRDIR/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | formail -X Subject:` LOG=" junk: bounced mailer-daemon auto-response: " #:0icw #|head -20 `dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE 1>&2 :0c *?which razor-report |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | razor-report $RAZORFLAGS; cat >/dev/null :0c *?which pyzor |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | pyzor report 2>/dev/null; cat >/dev/null :0c *?which dccproc |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | dccproc -l $TRASHDIR/dccproc; \ cat >/dev/null :0cw *?which ifile |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | formail -I "From " \ | phrases $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -i spam \ && cat >/dev/null :0Bcw:$HOME/.bogofilter.lock *!^x-bogosity: *spam *?which bogofilter |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:ABcw:$HOME/.bogofilter1.lock #|cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0Bc *^x-spamprobe: *^x-spamprobe: *spam /dev/null :Ecw:$HOME/.spamprobe.lock *?which spamprobe |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | spamprobe -Y -Hall train-spam \ && cat >/dev/null :0Bc *^x-dspam *^x-dspam[^:]*:.*\/dev/null :0Bc *^x-spambayes *^x-spambayes[^:]*: *spam /dev/null :Ecw:$HOME/.hammiedb.lock *?which sb_filter.py |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | sb_filter.py -s \ && cat >/dev/null :0w *?which fuzzysum { IFBOUNCEDFILE="`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" SUBJECT=`formail -x Subject: < $IFBOUNCEDFILE|cut -c2-71` HASH=`formail -I "" < $IFBOUNCEDFILE|(printenv SUBJECT;\ sed -e '/^-----BEGIN PGP SIGNATURE-----$/d;/^-----END PGP SIGNATURE-----$/d')\ |head -c 100000|fuzzysum -b` IFBOUNCEDFILE SUBJECT } :0hcw:$SPAMMESSIDS.lock |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | formail -D 122880 $SPAMMESSIDS; \ formail -D 122880 $SPAMMESSIDS; exit 0 } :EBw *^(return-path|received): { LOG=" junk: mailer-daemon spam with return-path/received: " NEWHEAD=`formail -I "" \ | sed -n 's,^Subject: Re: ,Subject: ,I;/^return-path: /I,/^$/{p;b;};/^received: /I,/^$/p' \ | formail $HDRFILT` :0bc *?which razor-report |(printenv NEWHEAD; echo ""; sed -n 's,^>,,p;/^Return-Path: /,$p;/^Received: /,$p') \ | razor-report $RAZORFLAGS :0bc *?which pyzor |(printenv NEWHEAD; echo ""; sed -n 's,^>,,p;/^Return-Path: /,$p;/^Received: /,$p') \ | pyzor report 2>/dev/null; cat >/dev/null :0bc *?which dccproc |(printenv NEWHEAD; echo ""; sed -n 's,^>,,p;/^Return-Path: /,$p;/^Received: /,$p') \ | dccproc -l $TRASHDIR/dccproc :0bc:$HOME/.idata.lock *?which ifile |(printenv NEWHEAD; echo ""; sed -n 's,^>,,p;/^Return-Path: /,$p;/^Received: /,$p') \ | head -c 100000 \ | formail -I "From " \ | phrases $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -i spam \ && cat >/dev/null :0Bbc:$HOME/.bogofilter.lock *!^x-bogosity: *spam *?which bogofilter |(printenv NEWHEAD; echo ""; sed -n 's,^>,,p;/^Return-Path: /,$p;/^Received: /,$p') \ | head -c 100000 \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:ABbc:$HOME/.bogofilter1.lock #|(printenv NEWHEAD; echo ""; sed -n 's,^>,,p;/^Return-Path: /,$p;/^Received: /,$p') \ # | head -c 100000 \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0Bc *^x-spamprobe: *^x-spamprobe: *spam /dev/null :Ebc:$HOME/.spamprobe.lock *?which spamprobe |(printenv NEWHEAD; echo ""; sed -n 's,^>,,p;/^Return-Path: /,$p;/^Received: /,$p') \ | head -c 100000 \ | spamprobe -Y -Hall train-spam \ && cat >/dev/null :0Bc *^x-dspam: *^x-dspam[^:]*:.*\,,p;/^Return-Path: /,$p;/^Received: /,$p') \ | head -c 100000 \ | dspam --user $LOGNAME --stdout --source=corpus --class=spam \ && cat >/dev/null :0Bc *^x-spambayes *^x-spambayes[^:]*: *spam /dev/null :Ebc:$HOME/.hammiedb.lock *?which sb_filter.py |(printenv NEWHEAD; echo ""; sed -n 's,^>,,p;/^Return-Path: /,$p;/^Received: /,$p') \ | head -c 100000 \ | sb_filter.py -s \ && cat >/dev/null :0w *?which fuzzysum { SUBJECT=`formail -I "" \ | sed -n 's,^Subject:,,p'|cut -c2-71` HASH=`formail -I "" \ | sed -n '/^Return-Path: /,$p;/^Received: /,$p' \ | (printenv SUBJECT;\ sed -e '/^-----BEGIN PGP SIGNATURE-----$/d;/^-----END PGP SIGNATURE-----$/d')\ |head -c 100000|fuzzysum -b` SUBJECT } :0hcw:$SPAMMESSIDS.lock |printenv NEWHEAD \ | formail -D 122880 $SPAMMESSIDS; \ formail -D 122880 $SPAMMESSIDS; exit 0 NEWHEAD } :0w *!HASH??^^^^ { # this is wrong; it may not be a non-spam #:0hcw:$TRASHDIR/procmail_junk.messids.lock #|formail -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -I "Message-ID: <$HASH@unknown>" /dev/null } :0: $PROCMAIL_TRASH } TRASHMAILER=no :0w *SAVE_TO??^$ { TRASHMAILER=yes } :EBw *$!^from:.*[^_a-z0-9]($MAINADDR) { TRASHMAILER=yes } :0w *!TRASHMAILER??no { VERBOSE=off LOG="`formail -x X-Spam-Report: -x X-SpamBayes -x X-pstn-levels:` " LOG=" `formail -I ''|/bin/grep -i '^to: '|head -1` " LOG=" `formail -I ''|/bin/grep -i '^subject: '|head -1` " LOG=" junk: mailer-daemon spam " :0c *?which razor-report |formail $HDRFILT | razor-report $RAZORFLAGS :0c *?which pyzor |formail $HDRFILT | pyzor report 2>/dev/null; cat >/dev/null :0c *?which dccproc |formail $IFBOUNCESSNEAK | dccproc -l $TRASHDIR/dccproc :0c:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -I "From " $HDRFILT \ | phrases $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -i spam \ && cat >/dev/null :0c:$HOME/.bogofilter.lock *!^x-bogosity: *spam *?which bogofilter |head -c 100000 | formail $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Ac:$HOME/.bogofilter1.lock #|head -c 100000 | formail $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spamprobe: *^x-spamprobe: *spam /dev/null :Ec:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail $HDRFILT \ | spamprobe -Y -Hall train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam /dev/null :Ec:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null :0hcw:$SPAMMESSIDS.lock *!HASH??^^^^ |formail -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -D 122880 $SPAMMESSIDS; exit 0 :0: $PROCMAIL_TRASH } VERBOSE=on FROM_MAILER_DAEMON=yes } :0w *BAYESHEAD??^^^^ *?which sb_filter.py { BAYESHEAD="`(head -c 100000; cat >/dev/null) \ | formail $HDRFILT \ | sb_filter.py -f \ | formail -X X-SpamBayes`" :0fhw *!BAYESHEAD??^^^^ |formail -i "$BAYESHEAD" BAYESHEAD } :0w *!x-spam-status: *yes *?which spamprobe { PROBE="`head -c 100000 | formail $HDRFILT | spamprobe -R score`" :0fhw *!PROBE??^^^^ |formail -i "X-SpamProbe: $PROBE" #:ahfw #*^x-spamprobe: *good *\/0*\.00.* #|formail -i "X-SpamProbe: unsure $MATCH" #*^x-spamprobe: *good *\/[.0-9]+ #*?set -xv;echo $MATCH'*1000'|bc|sed -e 's,\..*,,'|xargs -t -i test '{}' -ge 300 PROBE } :0w *!x-spam-status: *yes *?which dspam { DSPAM="`head -c 100000 | formail $HDRFILT | dspam --user $LOGNAME --stdout --mode=notrain --classify`" :0fhw *!DSPAM??^^^^ |formail -i "$DSPAM" DSPAM } :0w *!x-(spam-status: *yes|spamprobe: *spam|dspam[^:]*:.*\/dev/null; cat >/dev/null :0c *?which dccproc |formail $IFBOUNCESSNEAK | dccproc -l $TRASHDIR/dccproc :0c:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -I "From " $HDRFILT \ | phrases $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -i spam \ && cat >/dev/null :0c:$HOME/.bogofilter.lock *!^x-bogosity: *spam *?which bogofilter |head -c 100000 | formail $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Ac:$HOME/.bogofilter1.lock #|head -c 100000 | formail $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spamprobe: *^x-spamprobe: *spam /dev/null :Ec:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail $HDRFILT \ | spamprobe -Y -Hall train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam /dev/null :Ec:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null # this is wrong -- shouldn't be marked as non-spam #:0hcw:$TRASHDIR/procmail_junk.messids.lock #*!HASH??^^^^ #|formail -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!HASH??^^^^ |formail -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -D 122880 $SPAMMESSIDS; exit 0 :0: $PROCMAIL_TRASH } :Ew *FROM_MAILER_DAEMON??yes { LOG="`formail -X X-SBClass: -X X-SBPass: \ | sed -e 's,^, ,'; cat >/dev/null` " :0w *^x-spam-report:.*[^a-z]mailer_daemon { LOG="`formail -X X-Spam-Report: \ | sed -e 's,^, ,'; cat >/dev/null` " } TRASHMAILER=no #|pstn-levels:[^a-z]*s:[^0-9]*0.0 :0w *^(x-(sbclass: *spam|spam-status: *yes|(bogosity|spamprobe|spambayes[^:]*): *spam|dspam[^:]*:.*\;$_=join("",@_);while (s/\n$//) {};s/.*\n//g;s/^subject: *//i;print;'` } :0fwh *!SAVE_MATCH??^^^^ |formail -A "X-header-match: $SAVE_MATCH" SCORE1=$SCORE } BOGOHEAD } :Ew { TRASHMAILER=yes } :0w *!TRASHMAILER??no { VERBOSE=off LOG="`formail -x X-SBRule: -x X-SBNote: -x X-Spam-Report: -x X-Bogosity: -x X-pstn-levels:` " LOG=" `formail -I ''|/bin/grep -i '^to: '|head -1` " LOG=" `formail -I ''|/bin/grep -i '^subject: '|head -1` " LOG=" junk: mailer-daemon spam " :0c *?which razor-report |formail $HDRFILT | razor-report $RAZORFLAGS :0c *?which pyzor |formail $HDRFILT | pyzor report 2>/dev/null; cat >/dev/null :0c *?which dccproc |formail $IFBOUNCESSNEAK | dccproc -l $TRASHDIR/dccproc :0c:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -I "From " $HDRFILT \ | phrases $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -i spam \ && cat >/dev/null :0c:$HOME/.bogofilter.lock *!^x-bogosity: *spam *?which bogofilter |head -c 100000 | formail $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Ac:$HOME/.bogofilter1.lock #|head -c 100000 | formail $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spamprobe: *^x-spamprobe: *spam /dev/null :Ec:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail $HDRFILT \ | spamprobe -Y -Hall train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam /dev/null :Ec:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null :0hcw:$SPAMMESSIDS.lock *!HASH??^^^^ |formail -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -D 122880 $SPAMMESSIDS; exit 0 :0: $PROCMAIL_TRASH } #VERBOSE=on PRIORITY="C" } :Ew *PRIORITY??^[^AB]$ *SAVE_TO??^$ { #|pstn-levels:[^a-z]*s:[^0-9]*0\.0 :0w *^(x-(sbclass: *spam|spam-status: *yes|(bogosity|spamprobe|spambayes[^:]*): *spam|dspam[^:]*:.*\/dev/null; cat >/dev/null :0c *?which dccproc |formail $IFBOUNCESSNEAK | dccproc -l $TRASHDIR/dccproc :0c:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -I "From " $HDRFILT \ | phrases $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -i spam \ && cat >/dev/null :0c:$HOME/.bogofilter.lock *!^x-bogosity: *spam *?which bogofilter |head -c 100000 | formail $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Ac:$HOME/.bogofilter1.lock #|head -c 100000 | formail $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spamprobe: *^x-spamprobe: *spam /dev/null :Ec:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail $HDRFILT \ | spamprobe -Y -Hall train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam /dev/null :Ec:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null # this is wrong -- shouldn't be marked as non-spam #:0hcw:$TRASHDIR/procmail_junk.messids.lock #*!HASH??^^^^ #|formail -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!HASH??^^^^ |formail -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -D 122880 $SPAMMESSIDS; exit 0 :0: $PROCMAIL_TRASH } #:Ew #*!^x-((sbclass|spam-status):|pstn-levels:[^a-z]*s:[^0-9]*0.0) #{ # VERBOSE=off # LOG=" #junk: suspected undirected spam: #" # :0: # $PROCMAIL_TRASH #} # special keyword... #|pstn-levels:[^a-z]*s:[^0-9]*0\.0 :Ew *FROM_MAILER_DAEMON??yes *^x-(sbclass: *spam|spam-status: *yes|(bogosity|spamprobe|spambayes[^:]*): *spam|dspam[^:]*:.*\/dev/null :0c:$HOME/.bogofilter.lock *!^x-bogosity: *spam *?which bogofilter |head -c 100000 | formail $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Ac:$HOME/.bogofilter1.lock #|head -c 100000 | formail $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spamprobe: *^x-spamprobe: *spam /dev/null :Ec:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail $HDRFILT \ | spamprobe -Y -Hall train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam /dev/null :Ec:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null :0: $PROCMAIL_TRASH } # special keyword... } :0w *!^(x-((sbclass|bogosity|spamprobe|spambayes[^:]*): *spam|dspam[^:]*:.*\.*$,,;s,\(.*\),\1.bulk.rhs.mailpolice.com \1.porn.rhs.mailpolice.com \1.blackhole.securitysage.com \1.rhsbl.sorbs.net \1.rhsbl.ahbl.org,'\ # |xargs -t -n1 nslookup -sil -timeout=1\ # |/bin/grep '^Name: '|wc -l\ # |sed -e 's,^ *,,;s,$,+'$NASTINESS1','|bc` # :0hfw # *!NASTINESS??^0 # |formail -A "X-header-match: rblcheck1" # NASTINESS1=$NASTINESS #} # spamcop is in spamassassin #:0hw #*NASTINESS??^0 #NASTINESS=|formail -c -X Received:|sed -n 's,.*[[(]\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)[])].*,\4.\3.\2.\1,p'|sed -e 's,\(.*\),\1.bl.spamcop.net,'|xargs -n1 nslookup -sil -timeout=1|/bin/grep '^Name: '|wc -l|sed -e 's,^ *,,;s,$,+'$NASTINESS1','|bc #NASTINESS1=$NASTINESS #:0hi #*NASTINESS??^0 #NASTINESS=|if (-f /usr/local/bin/rblcheck.gz) guz /usr/local/bin/rblcheck;/bin/grep -i '^received: .*[([][1-9][0-9]*\.[1-9][0-9]*\.[1-9][0-9]*\.[1-9][0-9]*[])]'|sed -e 's,.*[([]\([1-9][0-9]*\.[1-9][0-9]*\.[1-9][0-9]*\.[1-9][0-9]*\)[])].*,\1,'|xargs -r -l1 rblcheck|/bin/grep -v '^not '|wc -l|sed -e 's,^ *,,' # PRIORITY==C iff FROM_DAEMON } #:0w #*SAVE_TO??^$ #*NASTINESS??^[1-9] #{ # VERBOSE=off # :0hw # LOG=|formail -x X-SBRule: -x X-SBNote: -x X-Spam-Report: && echo "" # LOG=" #junk: suspected undirected spam: nastiness=$NASTINESS #" # :0c # *?which razor-report # |razor-report $RAZORFLAGS # :0c # *?which dccproc # |[ ! -d $TRASHDIR/dccproc ] \ # && mkdir $TRASHDIR/dccproc; \ # dccproc -l $TRASHDIR/dccproc # :0: # $PROCMAIL_TRASH #} #:0fh #|formail -I Priority: -R To: Old-To: -R X-to: To: #:0w #|formail -A "X-Precedence: junk-mail" -i "Priority: $PRIORITY" >>$LOWPRIORITY KEYWORDS="keyword1|keyword2" :0w *!XKEYWORDS?^^^^ { KEYWORDS="keyword1|keyword2" # this needs to be kept in case we come in here a second time #XKEYWORDS } PLACES="place1|place2" FULLNAMES="\]*\)>,\1,g;s,\([^(]*\)([^)]*),\1,g;s/,/|/g;' #sed -e 's,",,g;s,'"'"',,g;s,$, '$PATHS $PATHS1,'|xargs -r -l1 /bin/egrep -i :0w *!^x-sbrule: *filter *evasion *0^0 *125^1 $^(subject|x-sneakemail-keyword|keywords):.*\/($KEYWORDS) { SCORE2=$= SAVE_MATCH=$MATCH :0w *SAVE_MATCH??(.*$)*\/.+ { SAVE_MATCH=$MATCH } # SAVE_MATCH=|printenv MATCH | perl -e '@_=<>;$_=join("",@_);while (s/\n$//) {};s/.*\n//g;print;' SCORE1=`expr $SCORE2 + $SCORE` SCORE=$SCORE1 :0fwh |formail -A "X-header-match: $SAVE_MATCH" } :0w *!^x-sbrule: *filter *evasion *0^0 *125^1 $^(subject|keywords):.*\/($PLACES) { SCORE2=$= SAVE_MATCH=$MATCH :0w *SAVE_MATCH??(.*$)*\/.+ { SAVE_MATCH=$MATCH } #SAVE_MATCH=|printenv MATCH | perl -e '@_=<>;$_=join("",@_);while (s/\n$//) {};s/.*\n//g;print;' SCORE1=`expr $SCORE2 + $SCORE` SCORE=$SCORE1 :0fwh |formail -A "X-header-match: $SAVE_MATCH" } #:0w #*0^0 #*16^.873 $B??.*\/$MAINADDR #{ # SAVE_MATCH="$MATCH" # SCORE2=$= # SCORE1=`expr $SCORE2 + $SCORE` # SCORE=$SCORE1 #} #2/14/09 #COMPANIES="company1|company2" #:0w #*0^0 #*16^.873 $B??.*\/[^@]($COMPANIES)\> #{ # SCORE2=$= # SAVE_MATCH=$MATCH # :0w # *SAVE_MATCH??(.*$)*\/.+ # { SAVE_MATCH=$MATCH } # #SAVE_MATCH=|printenv MATCH | perl -e '@_=<>;$_=join("",@_);while (s/\n$//) {};s/.*\n//g;print;' # SCORE1=`expr $SCORE2 + $SCORE` # SCORE=$SCORE1 # :0fwh # |formail -A "X-match: $SAVE_MATCH" #} #COMPANIES :0w *!^x-sbrule: *filter *evasion *0^0 *16^.873 $B??.*\/$KEYWORDS { SCORE2=$= SAVE_MATCH=$MATCH :0w *SAVE_MATCH??(.*$)*\/.+ { SAVE_MATCH=$MATCH } #SAVE_MATCH=|printenv MATCH | perl -e '@_=<>;$_=join("",@_);while (s/\n$//) {};s/.*\n//g;print;' SCORE1=`expr $SCORE2 + $SCORE` SCORE=$SCORE1 :0fwh |formail -A "X-match: $SAVE_MATCH" } KEYWORDS :0w *0^0 *16^.873 $B??.*\/$PLACES { SCORE2=$= SAVE_MATCH=$MATCH :0w *SAVE_MATCH??(.*$)*\/.+ { SAVE_MATCH=$MATCH } #SAVE_MATCH=|printenv MATCH | perl -e '@_=<>;$_=join("",@_);while (s/\n$//) {};s/.*\n//g;print;' SCORE1=`expr $SCORE2 + $SCORE` SCORE=$SCORE1 :0fwh |formail -A "X-match: $SAVE_MATCH" } PLACES :0w *SCORE??^[12]$ { #|pstn-levels:[^a-z]*s:[^0-9]*0\.0 :0w *^(x-(sbclass: *spam|spam-status: *yes|(bogosity|spamprobe|spambayes[^:]*): *spam)|subject: *spam detected by bigfoot:|dspam[^:]*:.*\/dev/null; cat >/dev/null :0c *?which dccproc |formail $IFBOUNCESSNEAK | dccproc -l $TRASHDIR/dccproc :0c:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -I "From " $HDRFILT \ | phrases $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -i spam \ && cat >/dev/null :0c:$HOME/.bogofilter.lock *!^x-bogosity: *spam *?which bogofilter |head -c 100000 | formail $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Ac:$HOME/.bogofilter1.lock #|head -c 100000 | formail $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spamprobe: *^x-spamprobe: *spam /dev/null :Ec:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail $HDRFILT \ | spamprobe -Y -Hall train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam /dev/null :Ec:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null # this is wrong; should be non-spam #:0hcw:$TRASHDIR/procmail_junk.messids.lock #*!HASH??^^^^ #|formail -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!HASH??^^^^ |formail -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -D 122880 $SPAMMESSIDS; exit 0 :0: $PROCMAIL_TRASH } #deal with totally forged e-mail addresses :Ew *^x-forged-from: { VERBOSE=off LOG=`formail -x X-forged-from: -x X-SBRule: \ -x X-SBNote: -x X-Spam-Report: -x X-HELO-Warning:` LOG=" junk: directed forged address spam: " :0c *?which razor-report |formail $HDRFILT | razor-report $RAZORFLAGS :0c *?which pyzor |formail $HDRFILT | pyzor report 2>/dev/null; cat >/dev/null :0c *?which dccproc |formail $IFBOUNCESSNEAK | dccproc -l $TRASHDIR/dccproc :0c:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -I "From " $HDRFILT \ | phrases $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -i spam \ && cat >/dev/null :0c:$HOME/.bogofilter.lock *!^x-bogosity: *spam *?which bogofilter |head -c 100000 | formail $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Ac:$HOME/.bogofilter1.lock #|head -c 100000 | formail $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spamprobe: *^x-spamprobe: *spam /dev/null :Ec:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail $HDRFILT \ | spamprobe -Y -Hall train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam /dev/null :Ec:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null # this is wrong -- shouldn't be marked as non-spam #:0hcw:$TRASHDIR/procmail_junk.messids.lock #*!HASH??^^^^ #|formail -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!HASH??^^^^ |formail -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -D 122880 $SPAMMESSIDS; exit 0 :0: $PROCMAIL_TRASH } :0Whc *!NASTINESS??^0 |set -xv;formail -c -X Received:\ |sed -n 's,.*[[(]\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)[])].*,\4.\3.\2.\1,p'\ |(/bin/grep -v '^1\.0\.0\.127$' || true) \ |sed -e 's,\(.*\),\1.query.bondedsender.org,'\ |xargs -t -n1 host \ |/bin/grep ' A ' 1>&2 :aw { :0hfw |formail -A "X-header-match: bondedsender" NASTINESS=0 } :0w *!NASTINESS??^0 *!x-helo-warning: *?which spfquery *$^received:.*from .*\[\/.*helo[^-_.a-z0-9][-_.a-z0-9].*by .*($THISISP) { RECEIVED=$MATCH :0w *RECEIVED??^\/[0-9.]+ { REVIP=$MATCH } :0w *RECEIVED??.*\]+ { SPFQUERYARG="-m $MATCH" :0Wic |spfquery -i $REVIP -h $HELO $SPFQUERYARG SPFRET=$? SPFQUERYARG :0w *SPFRET??^0 { NASTINESS=0 :0hfw |formail -A "X-header-match: spf" } SPFRET } HELO RECEIVED REVIP } HAMCOUNT=0 :0w *^x-(sbpass: .*(nobounce|whitelist|legitimate)|sbrule: .*local) { HAMCOUNT=1 } :0w *!^x-bogosity: *?which bogofilter { BOGOHEAD="`head -c 100000 | formail $HDRFILT | bogofilter --multi-token-count=2 -v`" :0fhw |formail -i "$BOGOHEAD" BOGOHEAD } :0w *^x-bogosity: *ham { HAMCOUNT=`expr $HAMCOUNT + 1` :0fhw |formail -A "X-header-match: bogofilter" } :0w *?which ifile { :0Bw *FROM_MAILER_DAEMON??yes *^subject: *^(return-path|received): { :0bWc |formail -I "" \ | sed -n '/^return-path: /I,${p;b;};/^received: /I,$p' \ | (head -c 100000; cat >/dev/null) \ | formail -I "From " $HDRFILT \ | phrases -r $HOME/.idata.phrases \ | ifile -S -w -m 100000 -c -q \ | /bin/grep ^spam :ew { HAMCOUNT=`expr $HAMCOUNT + 1` IFILETMP=`formail -I "" \ | sed -n '/^return-path: /I,${p;b;};/^received: /I,$p' \ | head -c 100000 \ | formail -I "From " $HDRFILT \ | phrases -r $HOME/.idata.phrases \ | ifile -S -w -m 100000 -q` } } :Ew { :0Wc |(head -c 100000; cat >/dev/null) \ | formail -I "From " $HDRFILT \ | phrases -r $HOME/.idata.phrases \ | ifile -S -w -m 100000 -c -q \ | /bin/grep ^spam #|(ifile -S -w -m 100000 -q || true) | head -1 | /bin/grep ^spam :ew { HAMCOUNT=`expr $HAMCOUNT + 1` IFILETMP=`head -c 100000 \ | formail -I "From " $HDRFILT \ | phrases -r $HOME/.idata.phrases \ | ifile -S -w -m 100000 -q` } } :0fhw *!IFILETMP??^^^^ |formail -A "X-header-match: ifile: `echo $IFILETMP`" IFILETMP } :0w *?which sb_filter.py { :0Bw *FROM_MAILER_DAEMON??yes *^subject: *^(return-path|received): { BAYESHEAD="`formail -I '' \ | sed -n '/^return-path: /I,${p;b;};/^received: /I,$p' \ | (head -c 100000; cat >/dev/null) \ | formail $HDRFILT \ | sb_filter.py -f \ | formail -X X-SpamBayes`" :0fhw |formail -i "$BAYESHEAD" LOG=" $BAYESHEAD " BAYESHEAD } } :0w *^x-spambayes[^:]*: *ham { HAMCOUNT=`expr $HAMCOUNT + 1` :0fhw |formail -A "X-header-match: spambayes" } :0w *?which spamprobe { :0Bw *FROM_MAILER_DAEMON??yes *^subject: *^(return-path|received): { PROBE=`formail -I '' \ | sed -n '/^return-path: /I,${p;b;};/^received: /I,$p' \ | (head -c 100000; cat >/dev/null) \ | formail $HDRFILT \ | spamprobe -R score` :0fhw |formail -i "X-SpamProbe: $PROBE" PROBE } } :0w *^x-spamprobe: *good *0*\.000 { HAMCOUNT=`expr $HAMCOUNT + 1` :0fhw |formail -A "X-header-match: spamprobe" } :0w *?which dspam { :0Bw *FROM_MAILER_DAEMON??yes *^subject: *^(return-path|received): { DSPAM=`formail -I '' \ | sed -n '/^return-path: /I,${p;b;};/^received: /I,$p' \ | (head -c 100000; cat >/dev/null) \ | formail $HDRFILT \ | dspam --user $LOGNAME --mode=notrain --classify` :0fhw |formail -i "$DSPAM" DSPAM } } :0w *^x-dspam[^:]*:.*\/dev/null; cat >/dev/null :0c *?which dccproc |formail $IFBOUNCESSNEAK | dccproc -l $TRASHDIR/dccproc :0c:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -I "From " $HDRFILT \ | phrases $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -i spam \ && cat >/dev/null :0c:$HOME/.bogofilter.lock *!^x-bogosity: *spam *?which bogofilter |head -c 100000 | formail $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Ac:$HOME/.bogofilter1.lock #|head -c 100000 | formail $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spamprobe: *^x-spamprobe: *spam /dev/null :Ec:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail $HDRFILT \ | spamprobe -Y -Hall train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam /dev/null :Ec:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null # this is wrong; shouldn't be non-spam #:0hcw:$TRASHDIR/procmail_junk.messids.lock #*!HASH??^^^^ #|formail -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!HASH??^^^^ |formail -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -D 122880 $SPAMMESSIDS; exit 0 :0: $PROCMAIL_TRASH } # this seems to already be handled above #:Ew #*^x-(sbclass: *spam|spam-status: *yes|pstn-levels:[^a-z]*s:[^0-9]*0\.0) #{ # VERBOSE=off # LOG=`formail -x X-SBRule: -x X-SBNote: \ # -x X-Spam-Report:` # LOG=" #junk: definite undirected non-ok spam: #" # :0c # *?which razor-report # |formail $HDRFILT | razor-report $RAZORFLAGS # :0c # *?which pyzor # |formail $HDRFILT | pyzor report 2>/dev/null; cat >/dev/null # :0c # *?which dccproc # |formail $IFBOUNCESSNEAK | dccproc -l $TRASHDIR/dccproc # :0hcw:$SPAMMESSIDS.lock # *!HASH??^^^^ # |formail -I "Message-ID: <$HASH@unknown>" /dev/null # :0: # $PROCMAIL_TRASH #} #:Ew #*!^x-((sbclass|spam-status):|pstn-levels:[^a-z]*s:[^0-9]*0.0) #{ # VERBOSE=off # LOG=" #junk: suspected unlabelled multi-directed spam: #" # :0: # $PROCMAIL_TRASH #} :Ew *NASTINESS??^[1-9] { VERBOSE=off LOG=`formail -x X-SBClass: -x X-SBRule: \ -x X-SBNote: \ -x X-Spam-Report: -x X-header-match: \ -x X-SpamBayes \ -x X-Bogosity: \ -x X-SpamProbe: \ -x X-DSPAM ` LOG=" junk: nasty undirected spam: nastiness=$NASTINESS " :0c *?which razor-report |formail $HDRFILT | razor-report $RAZORFLAGS :0c *?which pyzor |formail $HDRFILT | pyzor report 2>/dev/null; cat >/dev/null :0c *?which dccproc |formail $IFBOUNCESSNEAK | dccproc -l $TRASHDIR/dccproc :0c:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -I "From " $HDRFILT \ | phrases $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -i spam \ && cat >/dev/null :0c:$HOME/.bogofilter.lock *!^x-bogosity: *spam *?which bogofilter |head -c 100000 | formail $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Ac:$HOME/.bogofilter1.lock #|head -c 100000 | formail $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spamprobe: *^x-spamprobe: *spam /dev/null :Ec:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail $HDRFILT \ | spamprobe -Y -Hall train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam /dev/null :Ec:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null # this is wrong; shouldn't be non-spam #:0hcw:$TRASHDIR/procmail_junk.messids.lock #*!HASH??^^^^ #|formail -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!HASH??^^^^ |formail -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -D 122880 $SPAMMESSIDS; exit 0 :0: $PROCMAIL_TRASH } } # sneakemail's fall thru... :0c *^return-path:.*[^0-9a-z][0-9a-z]+@sneakemail\.com /dev/null :Ew *PRIORITY??^[^C]$ *!^x-(spam-report:.*[^a-z]((habeas|listed *in *(razor|dcc))[^a-z])) *!FROM_MAILER_DAEMON??yes *!^to: .*, *!^cc: *[^ ] *^from: *!SAVE_TO??^$ { #ATTEMPTS=0 #:0Bw #*.*attempt\/[0-9][0-9]* #{ # ATTEMPTS=`expr $MATCH + 1` # :0bf # |/bin/grep -v 'attempt[0-9]' #} STILL="" AGAIN="" RESPOND=yes :0Whc:$TRASHDIR/procmail_junk.auto.lock |formail -rtD 12288 $TRASHDIR/procmail_junk.auto :aWhc:$TRASHDIR/procmail_junk.auto.1.lock |formail -rtD 12288 $TRASHDIR/procmail_junk.auto.1 :aw { AGAIN=" again" STILL=" still" } :aWhc:$TRASHDIR/procmail_junk.auto.2.lock |formail -rtD 12288 $TRASHDIR/procmail_junk.auto.2 :aWhc:$TRASHDIR/procmail_junk.auto.3.lock |formail -rtD 12288 $TRASHDIR/procmail_junk.auto.3 :aWhc:$TRASHDIR/procmail_junk.auto.4.lock |formail -rtD 12288 $TRASHDIR/procmail_junk.auto.4 :aWhc:$TRASHDIR/procmail_junk.auto.5.lock |formail -rtD 12288 $TRASHDIR/procmail_junk.auto.5 :aw { RESPOND=no } :0w *RESPOND??yes { IFBOUNCESFILE="$$.`date +%H%M%S`" IFBOUNCESSNEAK="" :0icw:$PROCMAIL_TRASHDIR/procmail_junk.$IFBOUNCESFILE.lock |(head -c 100000; echo ""; echo "") \ |formail $HDRFILT \ > $PROCMAIL_TRASHDIR/procmail_junk.$IFBOUNCESFILE HDRTMP="$PROCMAIL_TRASHDIR/procmail_junk.$$.hdr" :0hcw:$HDRTMP.lock |formail -X To: -X From: -X Subject: \ -X Date: -X Message-ID: \ -X X-SBRule: -X X-SBNote: \ -X X-Spam-Flag: \ -X X-Spam-Status: -X X-SBClass: \ -X X-Spam-Report: -X X-Spam: \ -X X-SpamBayes \ -X X-Bogosity: \ -X X-SpamProbe: \ -X X-DSPAM \ >> $HDRTMP \ && (echo "X-Loop: $SAVE_TO" \ && echo "Old-Envelope-To: $SAVE_TO" \ && echo "Old-Delivered-To: $SAVE_TO" \ && echo "X-ifbounce: `basename $PROCMAIL_TRASHDIR`/$IFBOUNCESFILE") \ >> $HDRTMP PREVTRAP="" :0w *!TRAP??^^^^ { PREVTRAP="; $TRAP" } TRAP="/bin/rm $HDRTMP$PREVTRAP" PREVTRAP :0hc |formail -rD 122880 $TRASHDIR/procmail_junk.messids :0hc |formail -rtD 122880 $TRASHDIR/procmail_junk.messids # nasty ones eventually get trashed :0w *NASTINESS??^[1-9] { VERBOSE=off LOG=`formail \ -x X-Spam-Report: \ -x X-Spam-Status: \ -x X-Spam-Flag: \ -x X-SBRule: \ -x X-SBNote: -x X-SBClass: \ -x X-header-match: \ -x X-SpamBayes \ -x X-Bogosity: \ -x X-SpamProbe: \ -x X-DSPAM` LOG=" junk: suspected nasty directed spam: nastiness=$NASTINESS " #*!^FROM_DAEMON #-a "Auto-Submitted: auto-generated" #*ATTEMPTS??^[^9] #echo "attempt$ATTEMPTS" && # disabled on 12/24/06 #:0wc:$TRASHDIR/download_mail.spam/2.`date +%h.%d`.lock #|formail $HDRFILT \ # >> $TRASHDIR/download_mail.spam/2.`date +%h.%d` # -I "Subject: please try sending your message again" \ :0whc |(formail -R To: X-from: \ | formail -i X-from: \ -i "X-ifbounce: `basename $PROCMAIL_TRASHDIR`/$IFBOUNCESFILE" \ -rt \ && echo "" \ && echo "Hello. Thanks for writing$AGAIN. Because my spam filter is unacquainted" \ && echo "with your address, your message has been deleted. In order for me to read" \ && echo "your email, please resend using one or more of these techniques:" \ && echo "1) With exactly the same subject of a message I sent to you before this one" \ && echo "2) From an e-mail address that you used before" \ && echo "3) CC'ed to an e-mail address of someone we mutually know" \ && echo "4) With the full name or phone number or address of someone we mutually know" \ && echo " in the subject or at the top of your message" \ && echo "5) With my full name or phone number or address in the subject or at the" \ && echo " top of your message" \ && echo "6) With keywords in the subject or your message such as where we met," \ && echo " how you found or know me, password in zork, etc." \ && echo "7) Sending your message as plain text without base64 encoding." \ && echo "8) PGP or GPG encrypted to me" \ && echo "9) With your full name in the subject or in your message" \ && echo "10) Use another internet server provider (e.g., Google, Yahoo, Hotmail)" \ && echo "11) Use other mail software than what you're using" \ && echo "12) Register as a bonded sender at http://senderscorecertified.com/register" \ && echo "If your email passes through my filter, you will not receive this message" \ && echo "again. If a spammer has sent you a message using my address, please" \ && echo "forward the message to your ISP instead of replying to me. Thanks." \ && echo "" && cat $HDRTMP) \ | $SENDMAIL -t VERBOSE=on :0iw:$PROCMAIL_TRASH.lock |(formail -A "X-nastiness: $NASTINESS" \ | head -c 100000; \ echo "" && echo "") \ >>$PROCMAIL_TRASH } # -a "Auto-Submitted: auto-generated" #*ATTEMPTS??^[^9] #echo "attempt$ATTEMPTS" && # -I "Subject: thanks for writing$AGAIN" \ :Echw |(formail -R To: X-from: \ | formail -i X-from: \ -i "X-ifbounce: `basename $PROCMAIL_TRASHDIR`/$IFBOUNCESFILE" \ -rt \ && echo "" \ && echo "Hello. Thanks for writing$AGAIN. Your message has not been deleted but" \ && echo "is in my lowest priority folder. To have your message read more quickly," \ && echo "please resend using one or more of these techniques:" \ && echo "1) With exactly the same subject of a message I sent to you before this one" \ && echo "2) From an e-mail address that you used before" \ && echo "3) CC'ed to an e-mail address of someone we mutually know" \ && echo "4) With the full name or phone number or address of someone we mutually know" \ && echo " in the subject or at the top of your message" \ && echo "5) With my full name or phone number or address in the subject or at the" \ && echo " top of your message" \ && echo "6) With keywords in the subject or your message such as where we met," \ && echo " how you found or know me, password in zork, etc." \ && echo "7) Sending your message as plain text without base64 encoding." \ && echo "8) PGP or GPG encrypted to me" \ && echo "9) With your full name in the subject or in your message" \ && echo "10) Use another internet server provider (e.g., Google, Yahoo, Hotmail)" \ && echo "11) Use other mail software than what you're using" \ && echo "12) Register as a bonded sender at http://senderscorecertified.com/register" \ && echo "Once my mail filter becomes acquainted with your e-mail address ($FROM)," \ && echo "you will not receive this message again. If a spammer has sent you a" \ && echo "message using my address, please forward the message to your ISP instead" \ && echo "of replying to me. Thanks." \ && echo "" && cat $HDRTMP) \ | $SENDMAIL -t :Aw { VERBOSE=off LOG=`formail \ -x X-Spam-Report: \ -x X-Spam-Status: \ -x X-Spam-Flag: \ -x X-SBRule: \ -x X-SBNote: -x X-SBClass: \ -x X-header-match: \ -x X-SpamBayes \ -x X-Bogosity: \ -x X-SpamProbe: \ -x X-DSPAM` LOG=" junk: suspected directed spam `formail -X From: -X Subject:` " } } :Ew { VERBOSE=off LOG=" junk: directed over-responded-to spam: " :0c *?which razor-report |formail $HDRFILT | razor-report $RAZORFLAGS :0c *?which pyzor |formail $HDRFILT | pyzor report 2>/dev/null; cat >/dev/null :0c *?which dccproc |formail $IFBOUNCESSNEAK | dccproc -l $TRASHDIR/dccproc :0c:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -I "From " $HDRFILT \ | phrases $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -i spam \ && cat >/dev/null :0c:$HOME/.bogofilter.lock *!^x-bogosity: *spam *?which bogofilter |head -c 100000 | formail $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Ac:$HOME/.bogofilter1.lock #|head -c 100000 | formail $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spamprobe: *^x-spamprobe: *spam /dev/null :Ec:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail $HDRFILT \ | spamprobe -Y -Hall train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam /dev/null :Ec:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null :0hcw:$SPAMMESSIDS.lock *!HASH??^^^^ |formail -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -D 122880 $SPAMMESSIDS; exit 0 :0: $PROCMAIL_TRASH } PRIORITY="D" SCORE=2 } :Ew *NASTINESS??^[1-9] { VERBOSE=off :0w *!SAVE_TO??^$ { LOG="`formail -x X-SBRule: -x X-SBNote: \ -x X-SBClass: -x X-Spam-Report: \ -x X-Spam-Flag: \ -x X-Spam-Status: \ -x X-pstn-levels: \ -x X-header-match: \ -x X-SpamBayes \ -x X-Bogosity: \ -x X-SpamProbe: \ -x X-DSPAM` " LOG="junk: nasty directed spam: nastiness=$NASTINESS " } :Ew { LOG=" junk: nasty undirected spam: nastiness=$NASTINESS " } :0c *?which razor-report |formail $HDRFILT | razor-report $RAZORFLAGS :0c *?which pyzor |formail $HDRFILT | pyzor report 2>/dev/null; cat >/dev/null :0c *?which dccproc |formail $IFBOUNCESSNEAK | dccproc -l $TRASHDIR/dccproc :0c:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -I "From " $HDRFILT \ | phrases $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -i spam \ && cat >/dev/null :0c:$HOME/.bogofilter.lock *!^x-bogosity: *spam *?which bogofilter |head -c 100000 | formail $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Ac:$HOME/.bogofilter1.lock #|head -c 100000 | formail $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spamprobe: *^x-spamprobe: *spam /dev/null :Ec:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail $HDRFILT \ | spamprobe -Y -Hall train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam /dev/null :Ec:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null :0hcw:$SPAMMESSIDS.lock *!HASH??^^^^ |formail -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -D 122880 $SPAMMESSIDS; exit 0 :0: $PROCMAIL_TRASH } } FROM_MAILER_DAEMON MATCH :0w *!ORIGTRAP??^^^^ { TRAP=$ORIGTRAP ORIGTRAP } LOCKFILE :0w *SCORE??^[12]$ |formail -A "X-Precedence: junk-mail" -i "Priority: $PRIORITY" \ | procmail_hscore $SCORE :0fwh |formail -A "X-score: $SCORE" -A "X-nastiness: $NASTINESS" VERBOSE=no } :Efwh |formail -A "X-header-match: $FROM" :0hcw:$TRASHDIR/procmail_junk.messids.lock |formail -D 122880 $TRASHDIR/procmail_junk.messids; exit 0 :0hcw:$TRASHDIR/procmail_junk.messids.lock *!HASH??^^^^ |formail -I "Message-ID: <$HASH@unknown>" /dev/null REPEATED :0fwh |formail -i "Priority: $PRIORITY"