# Some global spam filtering # iemmc.org is a group run by spammers (some people may wish to kill # all mail with X-Advertisement header, I don't need to) :0: * ^X-Advertisement:.*\.iemmc\. $MAILDIR/spam-mail # UIDL is apparently a Unique IDentifier Label for POP. Only POP # mail readers should add it, but a bunch of spammers do. (Apparently # this causes problems for POP clients which try to reply....) # spam-output is a very high predjudice mailbox. :0: * ^X-UIDL: . $MAILDIR/spam-mail # Various spam engines & their signatures :0: * ^X-(Mailer|Sender):.*(MassE-Mail|netmailer|\|Floodgate|\ Extractor|Cold Fusion|Ready Aim) $MAILDIR/spam-mail # Other filtering to apply to all mail # Derived from era eriksson's recipe posted to procmail-list # This assignment must be flush against the margin. UNSUBSCRIBE="[ ]*((pl[easz]+|s)|(help( me)?|how do( (you|I)|es))\ .*[ ]+)?\ ((un)?sub?s?cr?ir?(be|ption)|(get|sign)( me | )?off|cancel sub|\ remove( +[^ ]+@[^ ]+\.[^ ]+|$))" :0: * ! ^FROM_MAILER * $ ^Subject: (uncl:? ?)?($UNSUBSCRIBE)$ $MAILDIR/spam-mail :0: * ! ^FROM_MAILER * <2000 * $ ^Subject: $UNSUBSCRIBE $MAILDIR/spam-mail # Idiot spelling errors in broadcast unsubscribes! # D == case sensitive, B == scan message body :0BHD: * ! ^FROM_MAILER * <2000 * ^([sS][uU][bB][jJ][eE][cC][tT]: *)?(PL[EASZ]++)?(UNSUB?SCR?IR?BE|SIGN ?OFF|REMOVE) $MAILDIR/spam-mail # More idiots :0B: * ! ^FROM_MAILER * <1600 * $ ^$UNSUBSCRIBE $MAILDIR/spam-mail # H == scan header (for no MAILER); B == scan message body :0EHB: * ! ^FROM_MAILER * B >> <2000 * $ $UNSUBSCRIBE $MAILDIR/junk-mail # Modification filtering (non-delivering) # Filter "Re[5]:"/"Re^3:" and the like out of Subject: :0fh * ^Subject: *((Re: ?)*Re[[^]|Re: *Re:) | perl -pe 's/^subject:\s*(re[][^\d]*:\s*)+/X-Subject: scrubbed\nSubject: Re: /i;' # Use a lock file on jmdigest, not because it modifies files, but # to keep too many of them from running at once and eating cpu time # unreasonably. LOCKFILE=jmd.lock # Extensive scoring. Doesn't redirect mail, just adds a new header # with the score it received. Slow and cpu expensive. :0B * $ `$HOME/bin/jmdigest -`^0 { } score=$= LOCKFILE :0fhw * score ?? ^^[1-9] | formail -A"JMDigest-Score: bad $score" :0Efhw | formail -A"JMDigest-Score: good $score"