# @(#) pm-mykill.rc -- Procmail: Kill and return all idiotic messages # @(#) $Id: pm-mykill.rc,v 1.3 1998/08/28 09:20:59 jaalto Exp $ # # File id # # $Contactid: $ # Category : "my", a personal procmail recipe that is not part of # my procmail modules pm-code.shar # # Description # # Some idiot advertisers don't know when they should stop. These guys # keep sending me (many) messages every day. I could tolerate message # here and there and be catched by my UBE filter, but from spammer that # is particularly enthusiastic, I want to send the message back. # # This procmail modules acts as "kill file", a term known to Usenet # news readers. It's a file that deletes articles so that you don't # ever see them when you read the group. # # In procmail, kill file means that # # o You either dump the message to /dev/null # o You return the message back. Perhaps the address is forged # if that's from spammer, but at least it wakes up some # postmaster in the sending area. # # Requirements # # o You must have included pm-javar.rc before this module # to get definitions of common variables `FORMAIL' `EX_NOPERM' # etc. # o `VALID_BODY' is regexp to say "This is ok message" # o `BIFF' is file where to send a brief note that message was killed. # # Make sure you apply this module _AFTER_ filing your work, private, # daemon, mailing list, vacation etc. messages. It should be almost # last in your .procmailrc. # # Use it with # # RC_KILL = $PMSRC/pm-mykill.rc # # ...other recipes.. # # INCLUDERC = $RC_KILL # # Change Log: (none) # ....................................................... code start ... dummy = " (pm-mykill.rc) -- procmail KILL recipe start." # Keep separate Kill file procmail log. Redirect current log file MyKillSaved = $LOGFILE LOGFILE = $HOME/tmp/pm-kill.log # This is defined prior including modele. VALID_BODY = ${VALID_BODY:-"--Procmail-FIll-This--In--"} BIFF = ${BIFF:-"/dev/null"} kill # Clear this flag. It will be set if message should be killed. # .................................................. spam by headers ... # From: 11268030(_at_)msn(_dot_)com # Subject: ALERT - Internet Fraud and Spying # # X-From-Line: global37(_at_)yahoo(_dot_)com # To: Friend(_at_)public(_dot_)com # Subject: The Internet Success ToolBox # # To: ed_faulk(_at_)yahoo(_dot_)com # Subject: XXX Pics - Passwords & Backdoors NO :0 * ()\/(russb(_at_)discover-net(_dot_)net\ |Subject: ALERT - Internet Fraud\ |Subject:.*Dental\ |^From:.*(golf|ballman)\ |^To: carpediem(_at_)usa(_dot_)net\ |global39(_at_)yahoo(_dot_)com\ |ed_faulk(_at_)yahoo(_dot_)com\ ).* *$ ! B ?? $VALID_BODY { kill = "yes" match = $MATCH } # ..................................................... spam by body ... # EMAIL MARKETING WORKS!! # # Bull's Eye Gold is the PREMIER email address collection tool. :0 E * B ?? ^EMAIL MARKETING WORKS { kill = "yes" } # ...................................................... Handle kill ... :0 * kill ?? yes * ! ^FROM_DAEMON { :0 hw # Get the name where msg is returned TO=|$FORMAIL -rt -zxTo: :0 hwic: | echo " [exitcode $to; $MATCH]" >> $BIFF EXITCODE = $EX_NOPERM # Send "Permission denied" HOST # That's it. Stop procmail immediately } dummy = " (pm-mykill.rc) -- procmail KILL recipe end." LOGFILE = $MyKillSaved # restore redirected log file # pm-mykill.rc ends here