procmail
[Top] [All Lists]

Re: Looking for Tim's anti-spam recipe

1997-03-18 19:01:24
For some reason (braindead as I may be), I can't seem to find any other
reference to "Tim's absolutely great recipe" -- can someone point me
in the correct direction, or just email me a copy of the recipe and
associated files?

*blush*  I'm flattered, but the credit really belongs to Philip Guenther,
who crafted the design.

# You should define things like "$HOME", "$FORMAIL", "$PMDIR", "$PMDIRp",
# and "$EGREP" as appropriate for your system.

# The PROCMAIL working (and private) directories.

  PMDIR=$HOME/Procmail
  PMDIRp=$PMDIR/Private
  FORMAIL=/usr/local/nuglops/bin/formail
  EGREP=$HOME/Bin/grep
  FROM=`$FORMAIL -rt -xTo:`

# This recipe checks to see if this email is "From" a known lamer (i.e.,
# Is this lamer in my "list-of-bastards"?). If so, the email is bounced
# back via a SENDMAIL EXITCODE and the headers of the email are saved/
# GZIPped in a file so I can examine it later.  I used to bounce this
# stuff back with a generic nastygram, but with all the forged headers,
# I was getting a bunch of bounced emails.  I then set it up so email from
# certain domains got bounced to *specific* addresses, but that ended up
# being too much work.  PROCMAIL is supposed to make my life *easier* so
# I decided to go with this SENDMAIL EXITCODE bounce which seems to work
# quite nicely.  Oh, my "list-of-bastards" is kept private -- you don't
# really want all of NetCom to see *your* name in it, now do you :^}?
#
# From the sendmail source code:
#
#       /* 64 USAGE */          " 500 Bad usage",
#       /* 65 DATAERR */        " 501 Data format error",
#       /* 66 NOINPUT */        ":550 Cannot open input",
#       /* 67 NOUSER */         " 550 User unknown",
#       /* 68 NOHOST */         " 550 Host unknown",
#       /* 69 UNAVAILABLE */    " 554 Service unavailable",
#       /* 70 SOFTWARE */       ":554 Internal error",
#       /* 71 OSERR */          ":451 Operating system error",
#       /* 72 OSFILE */         ":554 System file missing",
#       /* 73 CANTCREAT */      ":550 Can't create output",
#       /* 74 IOERR */          ":451 I/O error",
#       /* 75 TEMPFAIL */       " 250 Deferred",
#       /* 76 PROTOCOL */       " 554 Remote protocol error",
#       /* 77 NOPERM */         ":550 Insufficient permission",
#       /* 78 CONFIG */         " 554 Local configuration error",
#
#
# NOTE:  This recipe will FAIL if you try and use the standard GREP/EGREP
#        on NetCom; it is unable to handle files of this length.  I have
#        GNU Grep v2.0 in my $HOME/Bin directory which CAN handle it and
#        EGREP is defined earlier (even though it's in my PROCMAIL PATH).
#
# NOTE #2:  SENDMAIL EXITCODES will not work properly unless the format
#           of your "~/.forward" file is written properly (e.g., you
#           must not allow PROCMAIL to "fail softly").  For the proper
#           format, check out "~bodysurf/.forward".
#
BASTARDLIST=$PMDIRp/list-of-bastards
:0
* ? echo "$FROM" | $EGREP -i -f $BASTARDLIST
{
        EXITCODE = 77
        :0h:
        | gzip -fc >> $PMDIRp/headers.gz
}

#
# Stop lamers who intentionally try to get by my PROCMAIL "bastard" list.
# This recipe bounces at the (should be obvious) "Received:", "From" and
# "Reply*" headers' level rather than merely the "From" level (as the
# prior recipe does).  As in the above recipe, the headers of these emails
# are saved and GZIPped for later review.
#
# NOTE:  I was considering EGREPping a list of domains as in the above
#        recipe, but I think I will keep things like this as for now.  It
#        seems to be easier to do this way.
#
# NOTE #2:  Put your list of "jerks" in the second line of the recipe
# below:
#
:0
* ^(Received|From|Re(ply|turn)).*jerk
{
        EXITCODE = 77
        :0h:
        | gzip -fc >> $PMDIRp/headers.gz
}

#
# Kill off emails from lamers who use the bulk-email program "Floodgate".
#
:0
* ^X-Mailer: Floodgate
{
        EXITCODE = 77
        :0h:
        | gzip -fc >> $PMDIRp/headers.gz
}

Thanks!

[snip]

Chris H. Kurtz (chk(_at_)primenet(_dot_)com)       Primenet Network Operations

[snip]

On Wed, 12 Feb 1997, Dave Robbins wrote:

I started using Tim's absolutely great recipe for bouncing unwanted trash
from spammers and bozos.  After seeing how well it worked, I gave it
to others.  One undergrad, however, created the recipe *without*
adding anything to the killfile (email.killfile, in this case).
This somehow matched all mail coming to the undergrad.

Lates!
---------------------------------------------------------------------------
Tim <bodysurf(_at_)pobox(_dot_)com>                          
mailto:bodysurf(_at_)pobox(_dot_)com
Finger bodysurf(_at_)pobox(_dot_)com for my PGP public key (Bits 1024/KeyID 
09DA5C49).
PGP Key FPrint (09/03/94): 4C 97 F1 FA 70 55 68 91  49 D1 AD F2 DD 63 0C 15
---------------------> Please PGP encrypt your email <---------------------

<Prev in Thread] Current Thread [Next in Thread>