#Copyright (C) 2013 Robert MAINADDR=robertnixprog@github.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="" FROM=`formail -ztrx To:` :0w *FROM??^^\/.+ { FROM=$MATCH } :0w *FROM??^foo@bar$ { FROM="" } #FROM=|printenv FROM|perl -w -e '@_=<>;$_=join("",@_);while (s/\n$//) {};s/.*\n//g;print;' IFBOUNCESSNEAK="" :0w *^from:.*\|[^0-9a-z]*[0-9a-z]+@(sneakemail|snkmail)\.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: -I X-Sneakemail-Tag:" } #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 Status: \ -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: -I X-YahooFilteredBulk \ -I X-HASH-Message-Id -I X-Mime-File: -I X-Sonic- -I X-BeenThere:" :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: $EXTRAFILTEROUT EXTRAFILTEROUT :0w *!HASH??^^^^ { OLDHASH=$HASH HASH } PLACESSUB="s,\<3rd\>,third,gI" :0w *$^(x-loop|old-(delivered|envelope)-to): *(mailer-daemon|$MAINADDR) *B??.*(x-ifbounce|received): { LOCKFILE=$GLOBLOCKFILE LOG=`formail -x X-SBRule: -x X-SBNote: -x X-Spam-Report: -x X-YahooFilteredBulk` :0Bw *^to: { LOG=`formail -f -b -Y -q- -I ''|/bin/grep -i '^to: '|sed -e 's,^, ,'` } :0Bw *^subject: { LOG=`formail -f -b -Y -q- -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 -f -b -Y -q- -I ""|(printenv SUBJECT;\ sed -e '/^-----BEGIN PGP SIGNATURE-----$/d;/^-----END PGP SIGNATURE-----$/d')\ |head -c 100000|fuzzysum -b 74` SUBJECT } LENGTH="0" :0Bw *.*x-content-length: *x\/.* { LENGTH=$MATCH } :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 /tmp/dccproc ] \ && mkdir /tmp/dccproc; \ cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | dccproc -l /tmp/dccproc; \ cat >/dev/null :0Wc *?which ifile |cat >/dev/null; \ cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | formail -f -b -Y -q- -I "From " -I X-Spam-MessageSniffer-Rules: \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases -r $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -c -q \ | /bin/grep ^spam 1>&2 :ecw:$HOME/.idata.lock *?which ifile |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | formail -f -b -Y -q- -I "From " -I X-Spam-MessageSniffer-Rules: \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases $HOME/.idata.phrases | ifile -S -k -w -m 100000 -u spam \ && cat >/dev/null :0cw:$HOME/.dbacl.lock *?which dbacl |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | dbacl -w 2 -q 4 -T email -l $HOME/.dbacl/spam \ && cat >/dev/null :0Bc *^x-bogosity: *^x-bogosity: *spam.*spamicity=(1|0\.99) /dev/null :EBcw:$HOME/.bogofilter.lock *?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-spam-status: *yes /dev/null :EBc *^x-spamprobe: *^x-spamprobe: *spam *0\.(7[89]|[89]) /dev/null :Ecw:$HOME/.spamprobe.lock *?which spamprobe |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | formail -f -b -Y -q- -I X-Spamprobe: -a "X-Content-Length: x$LENGTH" \ | spamprobe -h -v -Y -l 0.67 -H all train-spam \ && cat >/dev/null :0Bc *^x-dspam *^x-dspam[^:]*:.*\/dev/null :0Bc *^x-spambayes *^x-spambayes[^:]*: *spam; *1 /dev/null :Ecw:$HOME/.hammiedb.lock *?which sb_filter.py |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | formail -f -b -Y -q- -a "X-Content-Length: x$LENGTH" \ | sb_filter.py -s \ && cat >/dev/null #:0cw:$HOME/.crm114.lock #*?test -d $HOME/.crm114 -a -x /usr/share/crm114/mailreaver.crm -a -e $HOME/.crm114/mailfilter.cf #|cd $HOME/.crm114&&cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ # | /usr/share/crm114/mailreaver.crm --config=$HOME/.crm114/mailfilter.cf --spam --dontstore \ # && cat >/dev/null :0w *?which fuzzysum { IFBOUNCEDFILE="`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" SUBJECT=`formail -f -q- -x Subject: < $IFBOUNCEDFILE|cut -c2-71` HASH=`formail -f -b -Y -q- -I "" < $IFBOUNCEDFILE|(printenv SUBJECT;\ sed -e '/^-----BEGIN PGP SIGNATURE-----$/d;/^-----END PGP SIGNATURE-----$/d')\ |head -c 100000|fuzzysum -b 74` IFBOUNCEDFILE SUBJECT } :0hcw:$SPAMMESSIDS.lock |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | formail -D 122880 $SPAMMESSIDS; \ formail -D 122880 $SPAMMESSIDS; exit 0 } :EBw *^received: { NEWHEAD=`formail -f -b -Y -q- -I "" \ | sed -n 's,^Subject: Re: ,Subject: ,I;/^return-path: /I,/^$/{p;b;};/^received: /I,/^$/p' \ | formail -f -q- $HDRFILT` SUBJECT=`formail -f -b -Y -q- -I "" \ | sed -n 's,^Subject:,,p'|cut -c2-71` HASH=`formail -f -b -Y -q- -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 74` :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 /tmp/dccproc :0Wbc *?which ifile |printenv NEWHEAD \ | (head -c 100000; cat >/dev/null) \ | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases -r $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -c -q \ | /bin/grep ^spam 1>&2 :ebcw:$HOME/.idata.lock *?which ifile |printenv NEWHEAD \ | head -c 100000 \ | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases $HOME/.idata.phrases | ifile -S -k -w -m 100000 -u spam \ && cat >/dev/null :0Bbcw:$HOME/.dbacl.lock *?which dbacl |printenv NEWHEAD \ | head -c 100000 \ | dbacl -w 2 -q 4 -T email -l $HOME/.dbacl/spam \ && cat >/dev/null :0c *^x-bogosity: *^x-bogosity: *spam.*spamicity=(1|0\.99) /dev/null :Ebcw:$HOME/.bogofilter.lock *?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-spam-status: *yes /dev/null :EBc *^x-spamprobe: *^x-spamprobe: *spam *0\.(7[89]|[89]) /dev/null :Ebc:$HOME/.spamprobe.lock *?which spamprobe |printenv NEWHEAD \ | head -c 100000 \ | formail -f -b -Y -I X-Spamprobe: -a "X-Content-Length: x$LENGTH" \ | spamprobe -h -v -Y -l 0.67 -H all train-spam \ && cat >/dev/null :0Bc *^x-dspam *^x-dspam[^:]*:.*\/dev/null :0Bc *^x-spambayes *^x-spambayes[^:]*: *spam; *1 /dev/null :Ebc:$HOME/.hammiedb.lock *?which sb_filter.py |printenv NEWHEAD \ | head -c 100000 \ | formail -f -b -Y -a "X-Content-Length: x$LENGTH" \ | sb_filter.py -s \ && cat >/dev/null #:0cw:$HOME/.crm114.lock #*?test -d $HOME/.crm114 -a -x /usr/share/crm114/mailreaver.crm -a -e $HOME/.crm114/mailfilter.cf #|cd $HOME/.crm114&&printenv NEWHEAD \ # | head -c 100000 \ # | /usr/share/crm114/mailreaver.crm --config=$HOME/.crm114/mailfilter.cf --spam --dontstore \ # && 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 -f -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -f -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!OLDHASH??^^^^ |formail -f -I "Message-ID: <$OLDHASH@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... :Ec *^x-yahoofilteredbulk: /dev/null :Ec *^x-spam-status: *yes /dev/null :Ew *$^subject: cron[ ]*(:.*|<)$LOGNAME *^from: *[^@]*$ { PRIORITY="C" } :Ew *^from data@(sneakemail|snkmail)\.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 } :0hc *?which dccproc |[ ! -d /tmp/dccproc ] && mkdir /tmp/dccproc; cat >/dev/null # 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" VERBOSE=off LOCKFILE } :0w *HASH??^^^^ *?which fuzzysum { SUBJECT=`formail -f -q- -x Subject:|cut -c2-71` HASH=`formail -f -b -Y -I ""|(printenv SUBJECT;\ sed -e '/^-----BEGIN PGP SIGNATURE-----$/d;/^-----END PGP SIGNATURE-----$/d')\ |head -c 100000|fuzzysum -b 74` SUBJECT } LENGTH=`wc -c | xargs -i echo 'scale=0;i=l({});i' | bc -l` :0w *PRIORITY??^[^ABC]$ *NASTINESS??^^^^ { LOCKFILE=$GLOBLOCKFILE VERBOSE=on :0w *!^FROM_DAEMON { :0Wihc:$SPAMMESSIDS.lock *!HASH??^^^^ |[ -f $SPAMMESSIDS ] && \ strings -1 $SPAMMESSIDS|/bin/fgrep -x "<$HASH@unknown>" :aciW |set -xv;/bin/fgrep -i -x -e "$FROM" $NOBOUNCE \ || ([ "$FROM1" ] && /bin/fgrep -i -x -e "$FROM1" $NOBOUNCE) \ || ([ "$FROM2" ] && /bin/fgrep -i -x -e "$FROM2" $NOBOUNCE) :ew { VERBOSE=off LOG=" junk: repeated hash spam $HASH " :0c *?which razor-report |formail -b -Y -q- $HDRFILT | razor-report $RAZORFLAGS :0c *?which pyzor |formail -b -Y $HDRFILT | pyzor report 2>/dev/null; cat >/dev/null :0c *?which dccproc |formail -b -Y -q- $IFBOUNCESSNEAK | dccproc -l /tmp/dccproc :0Wc *?which ifile |(head -c 100000; cat >/dev/null) \ | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases -r $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -c -q \ | /bin/grep ^spam 1>&2 :ecw:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases $HOME/.idata.phrases \ | ifile -S -k -w -m 100000 -u spam \ && cat >/dev/null :0cw:$HOME/.dbacl.lock *?which dbacl |head -c 100000 | formail -b -Y $HDRFILT \ | dbacl -w 2 -q 4 -T email -l $HOME/.dbacl/spam \ && cat >/dev/null :0c *^x-bogosity: *^x-bogosity: *spam.*spamicity=(1|0\.99) /dev/null :EcW *?which bogofilter |(head -c 100000;cat >/dev/null) | formail -b -Y $HDRFILT | bogofilter --multi-token-count=2 -o 0.99 :ecw:$HOME/.bogofilter.lock *?which bogofilter |head -c 100000 | formail -b -Y $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 :0Wc:$HOME/.spamprobe.lock *?which spamprobe |(head -c 100000; cat >/dev/null) | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT | spamprobe -h -Y -H all -l 0.67 -R score :ecw:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | spamprobe -h -v -Y -l 0.67 -H all train-spam \ && cat >/dev/null :0cw:$HOME/.dspam.lock *?which dspam |head -c 100000 | formail -b -Y $HDRFILT \ | dspam --user $LOGNAME --stdout --source=corpus --class=spam \ && cat >/dev/null # avoid overtraining spambayes -- 10/27/07 #:0cw:$HOME/.hammiedb.lock #*?which sb_filter.py #|head -c 100000 | formail -f -b -Y $HDRFILT \ # | sb_filter.py -s \ # && cat >/dev/null :0hcw:$SPAMMESSIDS.lock *!HASH??^^^^ |formail -f -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!OLDHASH??^^^^ |formail -f -I "Message-ID: <$OLDHASH@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??^^^^ { 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 -f -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 $HASH " :0hcw:$TRASHDIR/procmail_junk.messids.lock *^message-id: |formail -D 122880 $TRASHDIR/procmail_junk.messids; exit 0 REPEATED=yes :0hfw |formail -f -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 -f -b -Y -q- -I 'Message-ID: <$HASH@unknown>' ?From )([^>]*[^(.%@a-z0-9=])?\ (pineapp-notify|Post(ma?(st(e?r)?|n)|office)|(send)?Mail(er)?\ |sysadmin|daemon|mmdf|n?uucp\ |ops|re(quest|sponse)|bbs\.smtp(error)?|echo\ |s(erv(ices|ystem)|mtp(error)?|ystem)\ |A(dmin(istrator)?|MMGR)|notify@yahoogroups\.com)(([^).!:a-z0-9][-_a-z0-9]*)?\ [%@>\t ][^<)]*(\(.*\).*)?)?$([^>]|$))\ |^TO\/mailer-daemon@|^\/x-(sbpass|spam-report):.*[^a-z](mailer[-_]daemon)) { LOG=`printenv MATCH | sed -e 's,^, ,'; cat >/dev/null` :0Bw *.*x-loop: *mailer-daemon { VERBOSE=off LOG=`formail -f -q- -x X-SBRule: -x X-SBNote: -x X-Spam-Report: -x X-YahooFilteredBulk` :0Bw *^to: { LOG=`formail -f -b -Y -q- -I ''|/bin/grep -i '^to: '|sed -e 's,^, ,' && echo ""` } :0Bw *^subject: { LOG=`formail -f -b -Y -q- -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 -f -q- -x X-SBRule: -x X-SBNote: -x X-Spam-Report: -x X-YahooFilteredBulk` LOG=" " :0Bw *^to: { LOG=`formail -f -b -Y -q- -I ''|/bin/grep -i '^to: '|sed -e 's,^, ,'` } :0Bw *^subject: { LOG=`formail -f -b -Y -q- -I ''|/bin/grep -i '^subject: '|sed -e 's,^, ,'` } LENGTH="0" :0Bw *.*x-content-length: *x\/.* { LENGTH=$MATCH } :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 -f -q- -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 /tmp/dccproc; \ cat >/dev/null :0Wc *?which ifile |cat >/dev/null; \ cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | formail -f -b -Y -q- -I "From " -I X-Spam-MessageSniffer-Rules: \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases -r $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -c -q \ | /bin/grep ^spam 1>&2 :ecw:$HOME/.idata.lock *?which ifile |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | formail -f -b -Y -q- -I "From " -I X-Spam-MessageSniffer-Rules: \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases $HOME/.idata.phrases \ | ifile -S -k -w -m 100000 -u spam \ && cat >/dev/null :0cw:$HOME/.dbacl.lock *?which dbacl |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | dbacl -w 2 -q 4 -T email -l $HOME/.dbacl/spam \ && cat >/dev/null :0Bc *^x-bogosity: *^x-bogosity: *spam.*spamicity=(1|0\.99) /dev/null :Ecw:$HOME/.bogofilter.lock *?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-spam-status: *yes /dev/null :EBc *^x-spamprobe: *^x-spamprobe: *spam *0\.(7[89]|[89]) /dev/null :Ecw:$HOME/.spamprobe.lock *?which spamprobe |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | formail -f -b -Y -q- -I X-Spamprobe: -a "X-Content-Length: x$LENGTH" \ | spamprobe -h -v -Y -l 0.67 -H all train-spam \ && cat >/dev/null :0Bc *^x-dspam *^x-dspam[^:]*:.*\/dev/null :0Bc *^x-spambayes *^x-spambayes[^:]*: *spam; *1 /dev/null :Ecw:$HOME/.hammiedb.lock *?which sb_filter.py |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | formail -f -b -Y -q- -a "X-Content-Length: x$LENGTH" \ | sb_filter.py -s \ && cat >/dev/null #:0cw:$HOME/.crm114.lock #*?test -d $HOME/.crm114 -a -x /usr/share/crm114/mailreaver.crm -a -e $HOME/.crm114/mailfilter.cf #|cd $HOME/.crm114&&cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ # | /usr/share/crm114/mailreaver.crm --config=$HOME/.crm114/mailfilter.cf --spam --dontstore \ # && cat >/dev/null :0w *?which fuzzysum { IFBOUNCEDFILE="`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" SUBJECT=`formail -f -q- -x Subject: < $IFBOUNCEDFILE|cut -c2-71` HASH=`formail -f -b -Y -q- -I "" < $IFBOUNCEDFILE|(printenv SUBJECT;\ sed -e '/^-----BEGIN PGP SIGNATURE-----$/d;/^-----END PGP SIGNATURE-----$/d')\ |head -c 100000|fuzzysum -b 74` IFBOUNCEDFILE SUBJECT } :0hcw:$SPAMMESSIDS.lock |cat "`dirname $PROCMAIL_TRASHDIR`/$IFBOUNCESDIR/procmail_junk.$IFBOUNCESFILE" \ | formail -D 122880 $SPAMMESSIDS; \ formail -D 122880 $SPAMMESSIDS; exit 0 } :EBw *^received: { LOG=" junk: mailer-daemon spam with received: " NEWHEAD=`formail -f -b -Y -q- -I "" \ | sed -n 's,^Subject: Re: ,Subject: ,I;/^return-path: /I,/^$/{p;b;};/^received: /I,/^$/p' \ | formail -f -b -Y $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 /tmp/dccproc :0Wbc *?which ifile |(printenv NEWHEAD; echo ""; sed -n 's,^>,,p;/^Return-Path: /,$p;/^Received: /,$p') \ | (head -c 100000; cat >/dev/null) \ | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases -r $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -c -q \ | /bin/grep ^spam 1>&2 :ebcw:$HOME/.idata.lock *?which ifile |(printenv NEWHEAD; echo ""; sed -n 's,^>,,p;/^Return-Path: /,$p;/^Received: /,$p') \ | head -c 100000 \ | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases $HOME/.idata.phrases \ | ifile -S -k -w -m 100000 -u spam \ && cat >/dev/null :0bcw:$HOME/.dbacl.lock *?which dbacl |(printenv NEWHEAD; echo ""; sed -n 's,^>,,p;/^Return-Path: /,$p;/^Received: /,$p') \ | head -c 100000 \ | dbacl -w 2 -q 4 -T email -l $HOME/.dbacl/spam \ && cat >/dev/null :0c *^x-bogosity: *^x-bogosity: *spam.*spamicity=(1|0\.99) /dev/null :Ebcw:$HOME/.bogofilter.lock *?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-spam-status: *yes /dev/null :EBc *^x-spamprobe: *^x-spamprobe: *spam *0\.(7[89]|[89]) /dev/null :Ebc:$HOME/.spamprobe.lock *?which spamprobe |(printenv NEWHEAD; echo ""; sed -n 's,^>,,p;/^Return-Path: /,$p;/^Received: /,$p') \ | head -c 100000 \ | formail -f -b -Y -I X-Spamprobe: -a "X-Content-Length: x$LENGTH" \ | spamprobe -h -v -Y -l 0.67 -H all 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; *1 /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 \ | formail -f -b -Y -a "X-Content-Length: x$LENGTH" \ | sb_filter.py -s \ && cat >/dev/null #:0cw:$HOME/.crm114.lock #*?test -d $HOME/.crm114 -a -x /usr/share/crm114/mailreaver.crm -a -e $HOME/.crm114/mailfilter.cf #|cd $HOME/.crm114&&(printenv NEWHEAD; echo ""; sed -n 's,^>,,p;/^Return-Path: /,$p;/^Received: /,$p') \ # | head -c 100000 \ # | /usr/share/crm114/mailreaver.crm --config=$HOME/.crm114/mailfilter.cf --spam --dontstore \ # && cat >/dev/null :0w *?which fuzzysum { SUBJECT=`formail -f -b -Y -q- -I "" \ | sed -n 's,^Subject:,,p'|cut -c2-71` HASH=`formail -f -b -Y -q- -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 74` 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 -f -q- -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -f -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!OLDHASH??^^^^ |formail -f -I "Message-ID: <$OLDHASH@unknown>" /dev/null } :0: $PROCMAIL_TRASH } TRASHMAILER=no :0w *RESPOND??^^^^ *SAVE_TO??^$ { TRASHMAILER=yes } :EBw *RESPOND??^^^^ *$!^from:.*[^_a-z0-9]($MAINADDR) { TRASHMAILER=yes } :0w *JUSTEVALUATE??^^^^ *!TRASHMAILER??no { VERBOSE=off LOG=`formail -f -q- -x X-Spam-Report: -x X-SpamBayes -x X-YahooFilteredBulk -x X-Bogosity -x X-SpamProbe` LOG=" `formail -f -b -Y -q- -I ''|/bin/grep -i '^to: '` " LOG=" `formail -f -b -Y -q- -I ''|/bin/grep -i '^subject: '` " LOG=" junk: mailer-daemon spam " :0c *?which razor-report |formail -b -Y -q- $HDRFILT | razor-report $RAZORFLAGS :0c *?which pyzor |formail -b -Y $HDRFILT | pyzor report 2>/dev/null; cat >/dev/null :0c *?which dccproc |formail -b -Y -q- $IFBOUNCESSNEAK | dccproc -l /tmp/dccproc :0Wc *?which ifile |(head -c 100000; cat >/dev/null) \ | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases -r $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -c -q \ | /bin/grep ^spam 1>&2 :ecw:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases $HOME/.idata.phrases \ | ifile -S -k -w -m 100000 -u spam \ && cat >/dev/null :0cw:$HOME/.dbacl.lock *?which dbacl |head -c 100000 | formail -b -Y $HDRFILT \ | dbacl -w 2 -q 4 -T email -l $HOME/.dbacl/spam \ && cat >/dev/null :0c *^x-bogosity: *^x-bogosity: *spam.*spamicity=(1|0\.99) /dev/null :Ecw *?which bogofilter |(head -c 100000;cat >/dev/null) | formail -b -Y $HDRFILT | bogofilter --multi-token-count=2 -o 0.99 :ecw:$HOME/.bogofilter.lock *?which bogofilter |head -c 100000 | formail -b -Y $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Acw:$HOME/.bogofilter1.lock #|head -c 100000 | formail -b -Y $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spam-status: *yes /dev/null :Ec *^x-spamprobe: *^x-spamprobe: *spam *0\.(7[89]|[89]) /dev/null :EWc:$HOME/.spamprobe.lock *?which spamprobe |(head -c 100000; cat >/dev/null) | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT | spamprobe -h -Y -H all -l 0.67 -R score :ecw:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | spamprobe -h -v -Y -l 0.67 -H all train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam; *1 /dev/null :Ecw:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null #:0cw:$HOME/.crm114.lock #*?test -d $HOME/.crm114 -a -x /usr/share/crm114/mailreaver.crm -a -e $HOME/.crm114/mailfilter.cf #|cd $HOME/.crm114&&head -c 100000 | formail -b -Y $HDRFILT \ # | /usr/share/crm114/mailreaver.crm --config=$HOME/.crm114/mailfilter.cf --spam --dontstore \ # && cat >/dev/null :0hcw:$SPAMMESSIDS.lock *!HASH??^^^^ |formail -f -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!OLDHASH??^^^^ |formail -f -I "Message-ID: <$OLDHASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -D 122880 $SPAMMESSIDS; exit 0 :0: $PROCMAIL_TRASH } VERBOSE=on FROM_MAILER_DAEMON=yes TRASHMAILER } :0w *NASTINESS??^^^^ { NASTINESS=0 } :0w *PROBE??^^^^ *!^x-spam-status: *yes *?which spamprobe { PROBE="`lockfile -l2248 $HOME/.spamprobe.lock;head -c 100000| formail -b -Y -a 'X-Content-Length: x'$LENGTH $HDRFILT | spamprobe -h -Y -H all -R score;/bin/rm -f $HOME/.spamprobe.lock`" #*PROBE??spam *\/0*\.(8|9[1-8]).* #|formail -q- -i "X-SpamProbe: UNSURE $MATCH" #:Efhw :0hfw *!PROBE??^^^^ *^Old-X-SpamProbe: |formail -i Old-X-SpamProbe: :0hfw *!PROBE??^^^^ |formail -i "X-SpamProbe: $PROBE" #*^x-spamprobe: *good *\/[.0-9]+ #*?set -xv;echo $MATCH'*1000'|bc|sed -e 's,\..*,,'|xargs -t -i test '{}' -ge 300 } :0w *DSPAM??^^^^ *!^x-(spam-status: *yes|spamprobe: *spam) *?which dspam { DSPAM="`head -c 100000 | formail -b -Y $HDRFILT | dspam --user $LOGNAME --stdout --mode=notrain --classify`" :0fhw *!DSPAM??^^^^ *^Old-X-DSPAM |formail -i Old-X-DSPAM :0fhw *!DSPAM??^^^^ |formail -i "$DSPAM" } #*x-(spam-status: *yes|spamprobe: *spam|spambayes[^:]*: *spam|dspam[^:]*:.*\/dev/null; cat >/dev/null :0c *?which dccproc |formail -b -Y -q- $IFBOUNCESSNEAK | dccproc -l /tmp/dccproc :0Wc *?which ifile |(head -c 100000; cat >/dev/null) \ | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases -r $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -c -q \ | /bin/grep ^spam 1>&2 :ecw:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases $HOME/.idata.phrases \ | ifile -S -k -w -m 100000 -u spam \ && cat >/dev/null :0cw:$HOME/.dbacl.lock *?which dbacl |head -c 100000 | formail -b -Y $HDRFILT \ | dbacl -w 2 -q 4 -T email -l $HOME/.dbacl/spam \ && cat >/dev/null :0c *^x-bogosity: *^x-bogosity: *spam.*spamicity=(1|0\.99) /dev/null :Ecw:$HOME/.bogofilter.lock *?which bogofilter |head -c 100000 | formail -b -Y $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Acw:$HOME/.bogofilter1.lock #|head -c 100000 | formail -b -Y $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spam-status: *yes /dev/null :Ec *^x-spamprobe: *^x-spamprobe: *spam *0\.(7[89]|[89]) /dev/null :EWc:$HOME/.spamprobe.lock #*?which spamprobe #|(head -c 100000; cat >/dev/null) | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT | spamprobe -h -Y -H all -l 0.67 -R score #:ecw:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | spamprobe -h -v -Y -l 0.67 -H all train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam; *1 /dev/null :Ecw:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null #:0cw:$HOME/.crm114.lock #*?test -d $HOME/.crm114 -a -x /usr/share/crm114/mailreaver.crm -a -e $HOME/.crm114/mailfilter.cf #|cd $HOME/.crm114&&head -c 100000 | formail -b -Y $HDRFILT \ # | /usr/share/crm114/mailreaver.crm --config=$HOME/.crm114/mailfilter.cf --spam --dontstore \ # && 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 -f -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!OLDHASH??^^^^ |formail -f -I "Message-ID: <$OLDHASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -D 122880 $SPAMMESSIDS; exit 0 :0: $PROCMAIL_TRASH } #:Ew #*!^x-((sbclass|spam-status):) #{ # VERBOSE=off # LOG=" #junk: suspected undirected spam: #" # :0: # $PROCMAIL_TRASH #} # special keyword... :Ew *JUSTEVALUATE??^^^^ *FROM_MAILER_DAEMON??yes *^x-(spam-status: *yes|(bogosity|spamprobe|spambayes[^:]*): *spam|dspam[^:]*:.*\/dev/null) \ | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases -r $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -c -q \ | /bin/grep ^spam 1>&2 :ecw:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases $HOME/.idata.phrases \ | ifile -S -k -w -m 100000 -u spam \ && cat >/dev/null :0cw:$HOME/.dbacl.lock *?which dbacl |head -c 100000 | formail -b -Y $HDRFILT \ | dbacl -w 2 -q 4 -T email -l $HOME/.dbacl/spam \ && cat >/dev/null :0c *^x-bogosity: *^x-bogosity: *spam.*spamicity=(1|0\.99) /dev/null :Ecw:$HOME/.bogofilter.lock *?which bogofilter |head -c 100000 | formail -b -Y $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Acw:$HOME/.bogofilter1.lock #|head -c 100000 | formail -b -Y $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spam-status: *yes /dev/null :Ec *^x-spamprobe: *^x-spamprobe: *spam *0\.(7[89]|[89]) /dev/null :EWc:$HOME/.spamprobe.lock #*?which spamprobe #|(head -c 100000; cat >/dev/null) | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT | spamprobe -h -Y -H all -l 0.67 -R score #:ecw:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | spamprobe -h -v -Y -l 0.67 -H all train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam; *1 /dev/null :Ecw:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null #:0cw:$HOME/.crm114.lock #*?test -d $HOME/.crm114 -a -x /usr/share/crm114/mailreaver.crm -a -e $HOME/.crm114/mailfilter.cf #|cd $HOME/.crm114&&head -c 100000 | formail -b -Y $HDRFILT \ # | /usr/share/crm114/mailreaver.crm --config=$HOME/.crm114/mailfilter.cf --spam --dontstore \ # && cat >/dev/null :0: $PROCMAIL_TRASH } # special keyword... } #:0fhw #|formail -f -I Priority: -R To: Old-To: -R X-to: To: #:0w #|formail -f -b -Y -q- -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 -w -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 -w -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 -w -e '@_=<>;$_=join("",@_);while (s/\n$//) {};s/.*\n//g;print;' # SCORE1=`expr $SCORE2 + $SCORE` # SCORE=$SCORE1 # :0fwh # |formail -f -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 -w -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 -w -e '@_=<>;$_=join("",@_);while (s/\n$//) {};s/.*\n//g;print;' SCORE1=`expr $SCORE2 + $SCORE` SCORE=$SCORE1 :0fwh |formail -A "X-match: $SAVE_MATCH" } PLACES #*^x-(spamprobe: *spam|dspam[^:]*:.*\/dev/null; cat >/dev/null :0c *?which dccproc |formail -b -Y -q- $IFBOUNCESSNEAK | dccproc -l /tmp/dccproc :0Wc *?which ifile |(head -c 100000; cat >/dev/null) \ | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases -r $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -c -q \ | /bin/grep ^spam 1>&2 :ecw:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases $HOME/.idata.phrases \ | ifile -S -k -w -m 100000 -u spam \ && cat >/dev/null :0cw:$HOME/.dbacl.lock *?which dbacl |head -c 100000 | formail -b -Y $HDRFILT \ | dbacl -w 2 -q 4 -T email -l $HOME/.dbacl/spam \ && cat >/dev/null :0c *^x-bogosity: *^x-bogosity: *spam.*spamicity=(1|0\.99) /dev/null :Ecw:$HOME/.bogofilter.lock *?which bogofilter |head -c 100000 | formail -b -Y $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Acw:$HOME/.bogofilter1.lock #|head -c 100000 | formail -b -Y $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spam-status: *yes /dev/null :Ec *^x-spamprobe: *^x-spamprobe: *spam *0\.(7[89]|[89]) /dev/null :EWc:$HOME/.spamprobe.lock #*?which spamprobe #|(head -c 100000; cat >/dev/null) | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT | spamprobe -h -Y -H all -l 0.67 -R score #:ecw:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | spamprobe -h -v -Y -l 0.67 -H all train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam; *1 /dev/null :Ecw:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null #:0cw:$HOME/.crm114.lock #*?test -d $HOME/.crm114 -a -x /usr/share/crm114/mailreaver.crm -a -e $HOME/.crm114/mailfilter.cf #|cd $HOME/.crm114&&head -c 100000 | formail -b -Y $HDRFILT \ # | /usr/share/crm114/mailreaver.crm --config=$HOME/.crm114/mailfilter.cf --spam --dontstore \ # && cat >/dev/null # this is wrong -- shouldn't be marked as non-spam #:0hcw:$TRASHDIR/procmail_junk.messids.lock #*!HASH??^^^^ #|formail -f -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!HASH??^^^^ |formail -f -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!OLDHASH??^^^^ |formail -f -I "Message-ID: <$OLDHASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -D 122880 $SPAMMESSIDS; exit 0 :0: $PROCMAIL_TRASH } :0w *SCORE??^[12]$ { :0w *FROM_MAILER_DAEMON??yes { :0w *^x-spam-report:.*[^a-z]mailer_daemon { LOG=`formail -f -q- -X X-Spam-Report: \ | sed -e 's,^, ,'; cat >/dev/null` } :0w *^x-bogosity: *spam *?which bogofilter *B??^subject: *B??^(received|return-path): { BOGOHEAD=`formail -b -Y -q- -I "" \ | sed -n '/^return-path: /I,${p;b;};/^received: /I,$p' \ | head -c 100000 \ | formail -b -Y $HDRFILT \ | bogofilter --multi-token-count=2 -v` :0fhw *!BOGOHEAD??^^^^ |formail -i "$BOGOHEAD" :0w *RESPOND??^^^^ *!^x-bogosity: *spam { :0Bw *^subject: { SAVE_MATCH=`formail -f -b -Y -q- -I ""|/bin/grep -i '^subject:'|head -1 \ | perl -w -e '@_=<>;$_=join("",@_);while (s/\n$//) {};s/.*\n//g;s/^subject: *//i;print;'` } :0fwh *!SAVE_MATCH??^^^^ |formail -A "X-header-match: $SAVE_MATCH" SCORE1=$SCORE } BOGOHEAD } #:0w #*RESPOND??^^^^ #*^(x-(spam-status: *yes|(bogosity|spambayes[^:]*): *spam|dspam[^:]*:.*\/dev/null; cat >/dev/null # :0c # *?which dccproc # |formail -b -Y -q- $IFBOUNCESSNEAK | dccproc -l /tmp/dccproc # :0Wc # *?which ifile # |(head -c 100000; cat >/dev/null) \ # | formail -f -b -Y -q- -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ # | phrases -r $HOME/.idata.phrases \ # | ifile -k -S -w -m 100000 -c -q \ # | /bin/grep ^spam 1>&2 # :ecw:$HOME/.idata.lock # *?which ifile # |head -c 100000 | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ # | phrases $HOME/.idata.phrases \ # | ifile -S -k -w -m 100000 -u spam \ # && cat >/dev/null # :0c # *^x-bogosity: # *^x-bogosity: *spam # /dev/null # :Ecw:$HOME/.bogofilter.lock # *?which bogofilter # |head -c 100000 | formail -b -Y $HDRFILT \ # | bogofilter --multi-token-count=2 -s \ # && cat >/dev/null # #:Acw:$HOME/.bogofilter1.lock # #|head -c 100000 | formail -b -Y $HDRFILT \ # # | bogofilter -d $HOME/.bogofilter1 -s \ # # && cat >/dev/null # :0c # *^x-spamprobe: # *^x-spamprobe: *spam *0\.9 # /dev/null # :Ecw:$HOME/.spamprobe.lock # *?which spamprobe # |head -c 100000 | formail -b -Y $HDRFILT \ # | spamprobe -h -v -Y -H all train-spam \ # && cat >/dev/null # :0c # *^x-dspam: # *^x-dspam[^:]*:.*\/dev/null # :0c # *^x-spambayes # *^x-spambayes[^:]*: *spam; *1 # /dev/null # :Ecw:$HOME/.hammiedb.lock # *?which sb_filter.py # |head -c 100000 | formail -b -Y $HDRFILT \ # | sb_filter.py -s \ # && cat >/dev/null # :0hcw:$SPAMMESSIDS.lock # *!HASH??^^^^ # |formail -f -I "Message-ID: <$HASH@unknown>" /dev/null # :0hcw:$SPAMMESSIDS.lock # |formail -D 122880 $SPAMMESSIDS; exit 0 # :0: # $PROCMAIL_TRASH #} ##VERBOSE=on PRIORITY="C" } :0c *^x-bogosity: *!^x-bogosity: *spam /dev/null :Ec *^x-spambayes[^:]*: *!^x-spambayes[^:]*: *spam /dev/null :Ew *JUSTEVALUATE??^^^^ *^(x-(spam-status: *yes|spamprobe: *spam|dspam[^:]*:.*\/dev/null; cat >/dev/null :0c *?which dccproc |formail -b -Y -q- $IFBOUNCESSNEAK | dccproc -l /tmp/dccproc :0Wc *?which ifile |(head -c 100000; cat >/dev/null) \ | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases -r $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -c -q \ | /bin/grep ^spam 1>&2 :ecw:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases $HOME/.idata.phrases \ | ifile -S -k -w -m 100000 -u spam \ && cat >/dev/null :0cw:$HOME/.dbacl.lock *?which dbacl |head -c 100000 | formail -b -Y $HDRFILT \ | dbacl -w 2 -q 4 -T email -l $HOME/.dbacl/spam \ && cat >/dev/null :0c *^x-bogosity: *^x-bogosity: *spam.*spamicity=(1|0\.99) /dev/null :Ecw:$HOME/.bogofilter.lock *?which bogofilter |head -c 100000 | formail -b -Y $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Acw:$HOME/.bogofilter1.lock #|head -c 100000 | formail -b -Y $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spam-status: *yes /dev/null :Ec *^x-spamprobe: *^x-spamprobe: *spam *0\.(7[89]|[89]) /dev/null :EWc:$HOME/.spamprobe.lock #*?which spamprobe #|(head -c 100000; cat >/dev/null) | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT | spamprobe -h -Y -H all -l 0.67 -R score #:ecw:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | spamprobe -h -v -Y -l 0.67 -H all train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam; *1 /dev/null :Ecw:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null #:0cw:$HOME/.crm114.lock #*?test -d $HOME/.crm114 -a -x /usr/share/crm114/mailreaver.crm -a -e $HOME/.crm114/mailfilter.cf #|cd $HOME/.crm114&&head -c 100000 | formail -b -Y $HDRFILT \ # | /usr/share/crm114/mailreaver.crm --config=$HOME/.crm114/mailfilter.cf --spam --dontstore \ # && cat >/dev/null # this is wrong; should be non-spam #:0hcw:$TRASHDIR/procmail_junk.messids.lock #*!HASH??^^^^ #|formail -f -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!HASH??^^^^ |formail -f -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!OLDHASH??^^^^ |formail -f -I "Message-ID: <$OLDHASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -D 122880 $SPAMMESSIDS; exit 0 :0: $PROCMAIL_TRASH } :0w *NASTINESS??^0 *!NOBOUNCE??^^^^ *PRIORITY??^[^AB]$ { NASTINESSTMP="/tmp/procmail_junk.$$.nastiness" PREVTRAP="" :0w *!TRAP??^^^^ { PREVTRAP="; $TRAP" } TRAP="/bin/rm -f $NASTINESSTMP$PREVTRAP" PREVTRAP :0w *NASTINESS??^0 *^x-\/(spam-report:.*[^a-z]((rbl|osiru|habeas|listed *in *(razor|dcc))[^a-z])) { LOG=" $MATCH " NASTINESS=1 } :0w *NASTINESS??^0 *^x-\/(helo-warning:|spam-status:.*[^a-z](from_(missing|malformed)|many_froms)|yahoofilteredbulk) { LOG=" $MATCH " NASTINESS=1 } # set the nastiness level #:0hi #*NASTINESS2??^0 #NASTINESS1=|formail -f -X ""|/bin/fgrep -if $NASTIESFILE1|wc -l|sed -e 's,$,+'$NASTINESS2','|bc NASTINESS1=$NASTINESS :0w *! FROM??^[a-z0-9][-_.a-z0-9=+]*@([-a-z0-9]+\.)*[a-z]?[a-z]?[a-z][a-z]$ { NASTINESS=`expr $NASTINESS + 1` VERBOSE=off LOG=" junk: bogus From ($FROM): increasing nastiness to $NASTINESS " VERBOSE=on NASTINESS1=$NASTINESS } :0w *^received: .*\/\(may be forged\) { NASTINESS=`expr $NASTINESS + 1` VERBOSE=off :0hfw |formail -f -A "X-header-match: forged" VERBOSE=on } :0w *NASTINESS??^0 { NASTINESS=`formail -f -q- -X "" \ |formail -f -I Subject: $HDRFILT \ |fgrep -if $NASTIESFILE|tee $NASTINESSTMP\ |wc -l|sed -e 's,^ *,,'` :0hfw *!NASTINESS??^0 |formail -f -A "X-header-match: nastiesfile: `cat $NASTINESSTMP`" } :0w *NASTINESS??^0 *?which ifile { :0Wc |(head -c 100000; cat >/dev/null) \ | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | iconv -c -f utf8 -t ascii//TRANSLIT \ | ifile -h -k -S -m 100000 -c -q \ | /bin/grep ^spam 1>&2 :aw { NASTINESS=1 } } # this only currently works for exim4 #:0hw #*?which rblcheck #NASTINESS1=|formail -f -c -X Received: | sed -n 's,.*[[(]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[])].*,\1,gp'|xargs -r rblcheck -c -s dev.null.dk -s dews.qmail.org -s blackholes.five-ten-sg.com -s blackholes.five-ten-sg.com -s relays.visi.com -s blackholes.2mbit.com -s spammers.v6net.org|/bin/grep -v '^not '|wc -l|sed -e 's,^ *,,;s,$,+'$NASTINESS','|bc :0c *^x-(bogosity: *ham|spamprobe: *good|(spambayes|dspam)[^:]*: *ham) /dev/null :EWc *!^x-spam-status: *NASTINESS??^0 *?which dccproc |dccproc -Q -cCMN,50 -l /tmp/dccproc :ew { NASTINESS=1 :0hfw |formail -f -A "X-header-match: dccproc" NASTINESS1=$NASTINESS } :0c *^x-(bogosity: *ham|spamprobe: *good|(spambayes|dspam)[^:]*: *ham) /dev/null :Ewc *NASTINESS??^0 *!^x-spam-status: *?which razor-check |formail -b -Y -q- $HDRFILT | razor-check :aw { NASTINESS=1 :0hfw |formail -f -A "X-header-match: razor" NASTINESS1=$NASTINESS } :0c *^x-(bogosity: *ham|spamprobe: *good|(spambayes|dspam)[^:]*: *ham) /dev/null :Ewc *NASTINESS??^0 *!^x-spam-status: *?which pyzor |formail -b -Y -q- $HDRFILT | pyzor check :aw { NASTINESS=1 :0hfw |formail -f -A "X-header-match: pyzor" NASTINESS1=$NASTINESS } :0c *^x-(bogosity: *ham|spamprobe: *good|(spambayes|dspam)[^:]*: *ham) /dev/null :EWic *NASTINESS??^0 *!^x-spam-status:.*dkim_(signed|valid) *!FIRSTEXIP??^^^^ *!FIRSTEXIP??^000\.000\.000\.000$ *!FROMEMAIL??^^^^ *!FIRSTEXHELO??^^^^ *!FIRSTEXHELO??^host\.example\.com$ *?which spfquery |set -xv;spfquery -ip="$FIRSTEXIP" -sender="$FROMEMAIL" -helo="$FIRSTEXHELO" 1>&2 :ew { SPFRET=$? :0w *!SPFRET??^[0-2]$ { VERBOSE=off :0hfw |formail -f -A "X-header-match: spf" VERBOSE=on NASTINESS=1 } SPFRET } :0c *^x-(bogosity: *ham|spamprobe: *good|(spambayes|dspam)[^:]*: *ham) /dev/null :Ew *NASTINESS??^0 { RBLTMP="/tmp/procmail_junk.$$.rbl" NASTINESS=`formail -f -q- -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$' \ |sed -e 's,\(.*\),\1.dev.null.dk \1.dews.qmail.org \1.spamguard.leadmon.net \1.blackholes.intersil.net \1.spamsources.fabel.dk \1.blackholes.uceb.org \1.vox.schpider.com \1.ohps.bl.reynolds.net.au \1.omrs.bl.reynolds.net.au \1.osps.bl.reynolds.net.au \1.osrs.bl.reynolds.net.au \1.owfs.bl.reynolds.net.au \1.owps.bl.reynolds.net.au \1.rdts.bl.reynolds.net.au \1.ricn.bl.reynolds.net.au \1.rmst.bl.reynolds.net.au \1.t1.bl.reynolds.net.au \1.bl.deadbeef.com \1.relays.nether.net \1.unsure.nether.net \1.bulk.rhs.mailpolice.com \1.porn.rhs.mailpolice.com \1.bl.csma.biz \1.dnsbl.cyberlogic.net \1.rbl.rangers.eu.org \1.intruders.www.docs.uu.se \1.dnsbl.www.kempt.net \1.dynablock.njabl.org \1.psbl.surriel.com \1.access.redhawk.org \1.query.senderbase.org \ \1.rbl.snark.net \1.spamsources.dnsbl.info \1.dnsbl.jammconsulting.com \1.0spam.fusionzero.com \1.dnsbl.wpbl.pc9.org \1.no-more-funn.moensted.dk \1.psbl.surriel.com,'\ |xargs -t -P10 -n1 host -W 1 \ |/bin/grep ' A '\ |tee $RBLTMP\ |wc -l\ |sed -e 's,^ *,,;s,$,+'$NASTINESS1','|bc` :0hfw *!NASTINESS??^0 |formail -f -A "X-header-match: rblcheck"|/bin/grep -v '^$'&&sed -e 's,^,X-header-match: rbl: ,' $RBLTMP;echo '' PREVTRAP="" :0w *!TRAP??^^^^ { PREVTRAP="; $TRAP" } TRAP="/bin/rm -f $RBLTMP$PREVTRAP" PREVTRAP RBLTMP NASTINESS1=$NASTINESS } # rfc-ignorant.org is now in SpamBouncer #:0hw #*NASTINESS??^0 #NASTINESS=|formail -f -q- -c -X Received:|/bin/fgrep ' from '|sed -n 's,.* from *\([a-zA-Z0-9][-_a-zA-Z0-9]*\.[-_.a-zA-Z0-9]*\).*,\1,p;t;s,.*(HELO *\([a-zA-Z0-9][-_a-zA-Z0-9]*\.[-_.a-zA-Z0-9]*\).*,\1,p'|sed -e 's,\(.*\),\1.dsn.rfc-ignorant.org \1.postmaster.rfc-ignorant.org \1.bandwidth-pigs.monkeys.com \1.sender-domain.sjesl.monkeys.com \1.helo-domain.sjesl.monkeys.com \1.client-domain.sjesl.monkeys.com \1.in.dnsbl.org,'|xargs -n1 nslookup -sil -timeout=1|/bin/grep '^Name: '|wc -l|sed -e 's,^ *,,;s,$,+'$NASTINESS1','|bc #NASTINESS1=$NASTINESS # this check is now done in spambouncer #:0w #*NASTINESS??^0 #*^return-path: #{ # NASTINESS=`formail -f -q- -c -zx Return-Path:|head -1\ # |sed -e 's,.*@,,;s,>.*$,,;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 -f -q- -A "X-header-match: rblcheck1" # NASTINESS1=$NASTINESS #} # spamcop is in spamassassin #:0hw #*NASTINESS??^0 #NASTINESS=|formail -f -q- -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 NASTINESSTMP } #:0w #*SAVE_TO??^$ #*NASTINESS??^[1-9] #{ # VERBOSE=off # :0hw # LOG=|formail -f -q- -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 /tmp/dccproc ] \ # && mkdir /tmp/dccproc; \ # dccproc -l /tmp/dccproc # :0: # $PROCMAIL_TRASH #} #deal with totally forged e-mail addresses :0w *^x-forged-from: { VERBOSE=off LOG=`formail -f -q- -x X-forged-from: \ -x X-Spam-Report: -x X-HELO-Warning:` LOG=" junk: directed forged address spam: " :0c *?which razor-report |formail -b -Y -q- $HDRFILT | razor-report $RAZORFLAGS :0c *?which pyzor |formail -b -Y $HDRFILT | pyzor report 2>/dev/null; cat >/dev/null :0c *?which dccproc |formail -b -Y -q- $IFBOUNCESSNEAK | dccproc -l /tmp/dccproc :0Wc *?which ifile |(head -c 100000; cat >/dev/null) \ | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases -r $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -c -q \ | /bin/grep ^spam 1>&2 :ecw:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases $HOME/.idata.phrases \ | ifile -S -k -w -m 100000 -u spam \ && cat >/dev/null :0cw:$HOME/.dbacl.lock *?which dbacl |head -c 100000 | formail -b -Y $HDRFILT \ | dbacl -w 2 -q 4 -T email -l $HOME/.dbacl/spam \ && cat >/dev/null :0c *^x-bogosity: *^x-bogosity: *spam.*spamicity=(1|0\.99) /dev/null :Ecw:$HOME/.bogofilter.lock *?which bogofilter |head -c 100000 | formail -b -Y $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Acw:$HOME/.bogofilter1.lock #|head -c 100000 | formail -b -Y $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spam-status: *yes /dev/null :Ec *^x-spamprobe: *^x-spamprobe: *spam *0\.(7[89]|[89]) /dev/null :EWc:$HOME/.spamprobe.lock #*?which spamprobe #|(head -c 100000; cat >/dev/null) | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT | spamprobe -h -Y -H all -l 0.67 -R score #:ecw:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | spamprobe -h -v -Y -l 0.67 -H all train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam; *1 /dev/null :Ecw:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null #:0cw:$HOME/.crm114.lock #*?test -d $HOME/.crm114 -a -x /usr/share/crm114/mailreaver.crm -a -e $HOME/.crm114/mailfilter.cf #|cd $HOME/.crm114&&head -c 100000 | formail -b -Y $HDRFILT \ # | /usr/share/crm114/mailreaver.crm --config=$HOME/.crm114/mailfilter.cf --spam --dontstore \ # && cat >/dev/null # this is wrong -- shouldn't be marked as non-spam #:0hcw:$TRASHDIR/procmail_junk.messids.lock #*!HASH??^^^^ #|formail -f -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!HASH??^^^^ |formail -f -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!OLDHASH??^^^^ |formail -f -I "Message-ID: <$OLDHASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -D 122880 $SPAMMESSIDS; exit 0 :0: $PROCMAIL_TRASH } :0Whc *!NASTINESS??^0 |set -xv;formail -f -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 -r -t -n1 host \ |/bin/grep ' A ' 1>&2 :aw { :0hfw |formail -f -A "X-header-match: bondedsender" NASTINESS=0 } HAMCOUNT=0 #*^x-(sbpass: .*(nobounce|whitelist|legitimate)|sbrule: .*local) # FIRSTEXIP, FROMEMAIL, and FIRSTEXHELO come from SpamBouncer, if available :0w *^x-sbclass: *ok { HAMCOUNT=`expr $HAMCOUNT + 1` } :0w *BOGOHEAD??^^^^ *?which bogofilter { BOGOHEAD="`head -c 100000 | formail -b -Y $HDRFILT | bogofilter --multi-token-count=2 -v`" :0fhw *^Old-X-Bogosity: |formail -i Old-X-Bogosity: :0fhw *!BOGOHEAD??^^^^ |formail -i "$BOGOHEAD" } :0w *BOGOHEAD??ham { HAMCOUNT=`expr $HAMCOUNT + 1` :0fhw *!^x-bogosity: |formail -A "X-header-match: bogofilter" } :0w *IFILETMP??^^^^ *?which ifile { :0Bw *FROM_MAILER_DAEMON??yes *^subject: *^received: { :0bWc |formail -f -b -Y -q- -I "" \ | sed -n '/^return-path: /I,${p;b;};/^received: /I,$p' \ | (head -c 100000; cat >/dev/null) \ | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases -r $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -c -q \ | /bin/grep ^spam 1>&2 :ew { HAMCOUNT=`expr $HAMCOUNT + 1` IFILETMP=`formail -f -b -Y -q- -I "" \ | sed -n '/^return-path: /I,${p;b;};/^received: /I,$p' \ | head -c 100000 \ | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases -r $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -q` } } :Ew { :0Wc |(head -c 100000; cat >/dev/null) \ | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases -r $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -c -q \ | /bin/grep ^spam 1>&2 #|(ifile -S -k -o -w -m 100000 -q || true) | head -1 | /bin/grep ^spam :ew { HAMCOUNT=`expr $HAMCOUNT + 1` IFILETMP=`head -c 100000 \ | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases -r $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -q` } } :0fhw *!IFILETMP??^^^^ |formail -A "X-header-match: ifile: `echo $IFILETMP`" IFILETMP } :0Bw *!BAYESHEAD??ham *FROM_MAILER_DAEMON??yes *?which sb_filter.py *^subject: *^received: { BAYESHEAD="`formail -b -Y -q- -I '' \ | sed -n '/^return-path: /I,${p;b;};/^received: /I,$p' \ | (head -c 100000; cat >/dev/null) \ | formail -b -Y -a 'X-Content-Length: x'$LENGTH $HDRFILT \ | sb_filter.py -f \ | formail -f -X X-SpamBayes`" :0fhw *!BAYESHEAD??^^^^ |formail -i "$BAYESHEAD" LOG=" $BAYESHEAD " } :Ew *BAYESHEAD??^^^^ *?which sb_filter.py { BAYESHEAD="`(head -c 100000; cat >/dev/null) \ | formail -b -Y -a 'X-Content-Length: x'$LENGTH $HDRFILT \ | sb_filter.py -f \ | (formail -f -X X-SpamBayes; cat >/dev/null)`" :0fhw *!BAYESHEAD??^^^^ |formail -i "$BAYESHEAD" } :0w *BAYESHEAD??ham { HAMCOUNT=`expr $HAMCOUNT + 1` :0fhw *!^x-spambayes |formail -A "X-header-match: spambayes" } :0Bw *!PROBE??good *FROM_MAILER_DAEMON??yes *?which spamprobe *^subject: *^received: { PROBE=`lockfile -l2248 $HOME/.spamprobe.lock;formail -b -Y -q- -I '' \ | sed -n '/^return-path: /I,${p;b;};/^received: /I,$p' \ | (head -c 100000; cat >/dev/null) \ | formail -b -Y $HDRFILT \ | spamprobe -h -Y -H all -R score;/bin/rm -f $HOME/.spamprobe.lock` :0fhw |formail -i "X-SpamProbe: $PROBE" } :Ew *PROBE??^^^^ *?which spamprobe { PROBE="`lockfile -l2248 $HOME/.spamprobe.lock;head -c 100000 | formail -b -Y -a 'X-Content-Length: x'$LENGTH $HDRFILT | spamprobe -h -Y -H all -R score;/bin/rm -f $HOME/.spamprobe.lock`" :0hfw *!PROBE??^^^^ |formail -i "X-SpamProbe: $PROBE" } :0w *PROBE??good *0*\.[0-4] { HAMCOUNT=`expr $HAMCOUNT + 1` :0fhw *!^x-spamprobe: |formail -A "X-header-match: spamprobe" } :0Bw *!DSPAM??\/dev/null) \ | formail -b -Y $HDRFILT \ | dspam --user $LOGNAME --mode=notrain --classify` :0fhw *!DSPAM??^^^^ |formail -i "$DSPAM" } :0w *DSPAM??\/dev/null; cat >/dev/null :0c *?which dccproc |formail -b -Y -q- $IFBOUNCESSNEAK | dccproc -l /tmp/dccproc :0Wc *?which ifile |(head -c 100000; cat >/dev/null) \ | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases -r $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -c -q \ | /bin/grep ^spam 1>&2 :ecw:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases $HOME/.idata.phrases \ | ifile -S -k -w -m 100000 -u spam \ && cat >/dev/null :0cw:$HOME/.dbacl.lock *?which dbacl |head -c 100000 | formail -b -Y $HDRFILT \ | dbacl -w 2 -q 4 -T email -l $HOME/.dbacl/spam \ && cat >/dev/null :0c *^x-bogosity: *^x-bogosity: *spam.*spamicity=(1|0\.99) /dev/null :Ecw:$HOME/.bogofilter.lock *?which bogofilter |head -c 100000 | formail -b -Y $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Acw:$HOME/.bogofilter1.lock #|head -c 100000 | formail -b -Y $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spam-status: *yes /dev/null :Ec *^x-spamprobe: *^x-spamprobe: *spam *0\.(7[89]|[89]) /dev/null :EWc:$HOME/.spamprobe.lock #*?which spamprobe #|(head -c 100000; cat >/dev/null) | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT | spamprobe -h -Y -H all -l 0.67 -R score #:ecw:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | spamprobe -h -v -Y -l 0.67 -H all train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam; *1 /dev/null :Ecw:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null #:0cw:$HOME/.crm114.lock #*?test -d $HOME/.crm114 -a -x /usr/share/crm114/mailreaver.crm -a -e $HOME/.crm114/mailfilter.cf #|cd $HOME/.crm114&&head -c 100000 | formail -b -Y $HDRFILT \ # | /usr/share/crm114/mailreaver.crm --config=$HOME/.crm114/mailfilter.cf --spam --dontstore \ # && cat >/dev/null # this is wrong; shouldn't be non-spam #:0hcw:$TRASHDIR/procmail_junk.messids.lock #*!HASH??^^^^ #|formail -f -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!HASH??^^^^ |formail -f -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!OLDHASH??^^^^ |formail -f -I "Message-ID: <$OLDHASH@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) #{ # VERBOSE=off # LOG=`formail -f -q- -x X-SBRule: -x X-SBNote: \ # -x X-Spam-Report:` # LOG=" #junk: definite undirected non-ok spam: #" # :0c # *?which razor-report # |formail -f -b -Y -q- $HDRFILT | razor-report $RAZORFLAGS # :0c # *?which pyzor # |formail -f -b -Y $HDRFILT | pyzor report 2>/dev/null; cat >/dev/null # :0c # *?which dccproc # |formail -f -b -Y -q- $IFBOUNCESSNEAK | dccproc -l /tmp/dccproc # :0hcw:$SPAMMESSIDS.lock # *!HASH??^^^^ # |formail -f -I "Message-ID: <$HASH@unknown>" /dev/null # :0: # $PROCMAIL_TRASH #} #:Ew #*!^x-((sbclass|spam-status):) #{ # VERBOSE=off # LOG=" #junk: suspected unlabelled multi-directed spam: #" # :0: # $PROCMAIL_TRASH #} :Ew *JUSTEVALUATE??^^^^ *NASTINESS??^[1-9] { VERBOSE=off LOG="LOCALIP=$LOCALIP " LOG=`formail -f -q- -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 -x X-YahooFilteredBulk` LOG=" junk: nasty undirected spam: nastiness=$NASTINESS " :0c *?which razor-report |formail -b -Y -q- $HDRFILT | razor-report $RAZORFLAGS :0c *?which pyzor |formail -b -Y $HDRFILT | pyzor report 2>/dev/null; cat >/dev/null :0c *?which dccproc |formail -b -Y -q- $IFBOUNCESSNEAK | dccproc -l /tmp/dccproc :0Wc *?which ifile |(head -c 100000; cat >/dev/null) \ | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases -r $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -c -q \ | /bin/grep ^spam 1>&2 :ecw:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases $HOME/.idata.phrases \ | ifile -S -k -w -m 100000 -u spam \ && cat >/dev/null :0cw:$HOME/.dbacl.lock *?which dbacl |head -c 100000 | formail -b -Y $HDRFILT \ | dbacl -w 2 -q 4 -T email -l $HOME/.dbacl/spam \ && cat >/dev/null :0c *^x-bogosity: *^x-bogosity: *spam.*spamicity=(1|0\.99) /dev/null :Ecw:$HOME/.bogofilter.lock *?which bogofilter |head -c 100000 | formail -b -Y $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Acw:$HOME/.bogofilter1.lock #|head -c 100000 | formail -b -Y $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spam-status: *yes /dev/null :Ec *^x-spamprobe: *^x-spamprobe: *spam *0\.(7[89]|[89]) /dev/null :EWc:$HOME/.spamprobe.lock #*?which spamprobe #|(head -c 100000; cat >/dev/null) | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT | spamprobe -h -Y -H all -l 0.67 -R score #:ecw:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | spamprobe -h -v -Y -l 0.67 -H all train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam; *1 /dev/null :Ecw:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null #:0cw:$HOME/.crm114.lock #*?test -d $HOME/.crm114 -a -x /usr/share/crm114/mailreaver.crm -a -e $HOME/.crm114/mailfilter.cf #|cd $HOME/.crm114&&head -c 100000 | formail -b -Y $HDRFILT \ # | /usr/share/crm114/mailreaver.crm --config=$HOME/.crm114/mailfilter.cf --spam --dontstore \ # && cat >/dev/null # this is wrong; shouldn't be non-spam #:0hcw:$TRASHDIR/procmail_junk.messids.lock #*!HASH??^^^^ #|formail -f -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!HASH??^^^^ |formail -f -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!OLDHASH??^^^^ |formail -f -I "Message-ID: <$OLDHASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -D 122880 $SPAMMESSIDS; exit 0 :0: $PROCMAIL_TRASH } } # sneakemail's fall thru... :0c *^from:.*[^0-9a-z][0-9a-z]+@(sneakemail|snkmail)\.com /dev/null :Ew *JUSTEVALUATE??^^^^ *PRIORITY??^[^C]$ *!^x-(spam-report:.*[^a-z]((habeas|listed *in *(razor|dcc))[^a-z])) *!FROM_MAILER_DAEMON??yes *!^to: .*, *!^cc: *[^ ] *^from: *!SAVE_TO??^$ *FROM??^[a-z0-9][-_.a-z0-9=+]*@([-a-z0-9]+\.)*[a-z]?[a-z]?[a-z][a-z]$ *RESPOND??^^^^ { #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 -f -rtD 12288 $TRASHDIR/procmail_junk.auto :aWhc:$TRASHDIR/procmail_junk.auto.1.lock |formail -f -rtD 12288 $TRASHDIR/procmail_junk.auto.1 :aw { AGAIN=" again" STILL=" still" } :aWhc:$TRASHDIR/procmail_junk.auto.2.lock |formail -f -rtD 12288 $TRASHDIR/procmail_junk.auto.2 :aWhc:$TRASHDIR/procmail_junk.auto.3.lock |formail -f -rtD 12288 $TRASHDIR/procmail_junk.auto.3 :aWhc:$TRASHDIR/procmail_junk.auto.4.lock |formail -f -rtD 12288 $TRASHDIR/procmail_junk.auto.4 :aWhc:$TRASHDIR/procmail_junk.auto.5.lock |formail -f -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 -f -b -Y $HDRFILT \ > $PROCMAIL_TRASHDIR/procmail_junk.$IFBOUNCESFILE HDRTMP="/tmp/procmail_junk.$$.hdr" :0hcw:$HDRTMP.lock |formail -f -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 \ -X X-YahooFilteredBulk \ >> $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 :0hcW:$TRASHDIR/procmail_junk.messids.lock |formail -f -rD 122880 $TRASHDIR/procmail_junk.messids :0hcW:$TRASHDIR/procmail_junk.messids.lock |formail -f -rtD 122880 $TRASHDIR/procmail_junk.messids # nasty ones eventually get trashed :0w *NASTINESS??^[1-9] { VERBOSE=off LOG=`formail -f -q- \ -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 \ -x X-YahooFilteredBulk` 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 -f -b -Y -q- $HDRFILT \ # >> $TRASHDIR/download_mail.spam/2.`date +%h.%d` # -I "Subject: please try sending your message again" \ :0whc |(formail -f -R To: X-from: \ | formail -f -i X-from: \ -a "X-Content-Length: x$LENGTH" \ -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 -f -b -Y -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 -f -R To: X-from: \ | formail -f -i X-from: \ -a "X-Content-Length: x$LENGTH" \ -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 -f -q- \ -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 \ -x X-YahooFilteredBulk` LOG=" junk: suspected directed spam `formail -f -q- -X From:` `formail -f -q- -X Subject:` " } HDRTMP } :Ew { VERBOSE=off LOG=" junk: directed over-responded-to spam: " :0c *?which razor-report |formail -b -Y -q- $HDRFILT | razor-report $RAZORFLAGS :0c *?which pyzor |formail -b -Y $HDRFILT | pyzor report 2>/dev/null; cat >/dev/null :0c *?which dccproc |formail -b -Y -q- $IFBOUNCESSNEAK | dccproc -l /tmp/dccproc :0Wc *?which ifile |(head -c 100000; cat >/dev/null) \ | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases -r $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -c -q \ | /bin/grep ^spam 1>&2 :ecw:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases $HOME/.idata.phrases \ | ifile -S -k -w -m 100000 -u spam \ && cat >/dev/null :0cw:$HOME/.dbacl.lock *?which dbacl |head -c 100000 | formail -b -Y $HDRFILT \ | dbacl -w 2 -q 4 -T email -l $HOME/.dbacl/spam \ && cat >/dev/null :0c *^x-bogosity: *^x-bogosity: *spam.*spamicity=(1|0\.99) /dev/null :Ecw:$HOME/.bogofilter.lock *?which bogofilter |head -c 100000 | formail -b -Y $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Acw:$HOME/.bogofilter1.lock #|head -c 100000 | formail -b -Y $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spam-status: *yes /dev/null :Ec *^x-spamprobe: *^x-spamprobe: *spam *0\.(7[89]|[89]) /dev/null :EWc:$HOME/.spamprobe.lock #*?which spamprobe #|(head -c 100000; cat >/dev/null) | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT | spamprobe -h -Y -H all -l 0.67 -R score #:ecw:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | spamprobe -h -v -Y -l 0.67 -H all train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam; *1 /dev/null :Ecw:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null #:0cw:$HOME/.crm114.lock #*?test -d $HOME/.crm114 -a -x /usr/share/crm114/mailreaver.crm -a -e $HOME/.crm114/mailfilter.cf #|cd $HOME/.crm114&&head -c 100000 | formail -b -Y $HDRFILT \ # | /usr/share/crm114/mailreaver.crm --config=$HOME/.crm114/mailfilter.cf --spam --dontstore \ # && cat >/dev/null :0hcw:$SPAMMESSIDS.lock *!HASH??^^^^ |formail -f -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!OLDHASH??^^^^ |formail -f -I "Message-ID: <$OLDHASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -D 122880 $SPAMMESSIDS; exit 0 :0: $PROCMAIL_TRASH } PRIORITY="D" SCORE=2 } :Ew *JUSTEVALUATE??^^^^ *NASTINESS??^[1-9] { VERBOSE=off :0w *!SAVE_TO??^$ { LOG="`formail -f -q- -x X-SBRule: -x X-SBNote: \ -x X-SBClass: -x X-Spam-Report: \ -x X-Spam-Flag: \ -x X-Spam-Status: \ -x X-header-match: \ -x X-SpamBayes \ -x X-Bogosity: \ -x X-SpamProbe \ -x X-DSPAM \ -x X-YahooFilteredBulk` " LOG="junk: nasty directed spam: nastiness=$NASTINESS " } :Ew { LOG=" junk: nasty undirected spam: nastiness=$NASTINESS " } :0c *?which razor-report |formail -b -Y -q- $HDRFILT | razor-report $RAZORFLAGS :0c *?which pyzor |formail -b -Y $HDRFILT | pyzor report 2>/dev/null; cat >/dev/null :0c *?which dccproc |formail -b -Y -q- $IFBOUNCESSNEAK | dccproc -l /tmp/dccproc :0Wc *?which ifile |(head -c 100000; cat >/dev/null) \ | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases -r $HOME/.idata.phrases \ | ifile -k -S -w -m 100000 -c -q \ | /bin/grep ^spam 1>&2 :ecw:$HOME/.idata.lock *?which ifile |head -c 100000 | formail -f -b -Y -I "From " -I X-Spam-MessageSniffer-Rules: $HDRFILT \ | sed -e "$PLACESSUB" | iconv -c -f utf8 -t ascii//TRANSLIT \ | phrases $HOME/.idata.phrases \ | ifile -S -k -w -m 100000 -u spam \ && cat >/dev/null :0cw:$HOME/.dbacl.lock *?which dbacl |head -c 100000 | formail -b -Y $HDRFILT \ | dbacl -w 2 -q 4 -T email -l $HOME/.dbacl/spam \ && cat >/dev/null :0c *^x-bogosity: *^x-bogosity: *spam.*spamicity=(1|0\.99) /dev/null :Ecw:$HOME/.bogofilter.lock *?which bogofilter |head -c 100000 | formail -b -Y $HDRFILT \ | bogofilter --multi-token-count=2 -s \ && cat >/dev/null #:Acw:$HOME/.bogofilter1.lock #|head -c 100000 | formail -b -Y $HDRFILT \ # | bogofilter -d $HOME/.bogofilter1 -s \ # && cat >/dev/null :0c *^x-spam-status: *yes /dev/null :Ec *^x-spamprobe: *^x-spamprobe: *spam *0\.(7[89]|[89]) /dev/null :EWc:$HOME/.spamprobe.lock #*?which spamprobe #|(head -c 100000; cat >/dev/null) | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT | spamprobe -h -Y -H all -l 0.67 -R score #:ecw:$HOME/.spamprobe.lock *?which spamprobe |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | spamprobe -h -v -Y -l 0.67 -H all train-spam \ && cat >/dev/null :0c *^x-dspam: *^x-dspam[^:]*:.*\/dev/null :0c *^x-spambayes *^x-spambayes[^:]*: *spam; *1 /dev/null :Ecw:$HOME/.hammiedb.lock *?which sb_filter.py |head -c 100000 | formail -b -Y -a "X-Content-Length: x$LENGTH" $HDRFILT \ | sb_filter.py -s \ && cat >/dev/null #:0cw:$HOME/.crm114.lock #*?test -d $HOME/.crm114 -a -x /usr/share/crm114/mailreaver.crm -a -e $HOME/.crm114/mailfilter.cf #|cd $HOME/.crm114&&head -c 100000 | formail -b -Y $HDRFILT \ # | /usr/share/crm114/mailreaver.crm --config=$HOME/.crm114/mailfilter.cf --spam --dontstore \ # && cat >/dev/null :0hcw:$SPAMMESSIDS.lock *!HASH??^^^^ |formail -f -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock *!OLDHASH??^^^^ |formail -f -I "Message-ID: <$OLDHASH@unknown>" /dev/null :0hcw:$SPAMMESSIDS.lock |formail -D 122880 $SPAMMESSIDS; exit 0 :0: $PROCMAIL_TRASH } :Ew *JUSTEVALUATE??^^^^ { VERBOSE=off LOG="`formail -f -q- -x X-SBRule: -x X-SBNote: \ -x X-SBClass: -x X-Spam-Report: \ -x X-Spam-Flag: \ -x X-Spam-Status: \ -x X-header-match: \ -x X-SpamBayes \ -x X-Bogosity: \ -x X-SpamProbe \ -x X-DSPAM \ -x X-YahooFilteredBulk` " LOG=" junk: suspected undirected spam: " VERBOSE=on } } FROM_MAILER_DAEMON MATCH # don't clobber TRAP -- 3/20/2012 #:0w #*!ORIGTRAP??^^^^ #{ TRAP=$ORIGTRAP } ORIGTRAP LOCKFILE :0w *JUSTEVALUATE??^^^^ *SCORE??^[12]$ |formail -f -b -Y -q- -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" FIRSTEXIP FIRSTEXHELO FROMEMAIL LENGTH :0hcw:$TRASHDIR/procmail_junk.messids.lock *JUSTEVALUATE??^^^^^ |formail -D 122880 $TRASHDIR/procmail_junk.messids; exit 0 :0fhw *!HASH??^^^^ |formail -i "X-HASH-Message-Id: <$HASH@unknown>" :ahcw:$TRASHDIR/procmail_junk.messids.lock *JUSTEVALUATE??^^^^ |formail -f -I "Message-ID: <$HASH@unknown>" /dev/null :0hcw:$TRASHDIR/procmail_junk.messids.lock *JUSTEVALUATE??^^^^ *!OLDHASH??^^^^ |formail -f -I "Message-ID: <$OLDHASH@unknown>" /dev/null :0fhw |formail -i "Priority: $PRIORITY"