FAQ Maintainers Mailing List
My Procmail solution, was Re: [faq-maintainers] FAQ-based spam...

---------

From: Nick Zitzmann (nickzman@eskimo.com)
Date: Mon Nov 19 2001 - 21:05:31 CST


On Monday, November 19, 2001, at 04:55 PM, Boyd Lynn Gerber wrote:

> I would like to know what you did?

I've had a few requests for this from my last message, so to
prevent redundancy, I'll broadcast my solution to the group...

Here's the procmail recipe I use. Since I last reset my spam
mailbox on November 7, it caught 82 pieces of spam for me, which
I deleted.

First, an explanation: Don't tell this to the spam software
writers. (Heck, please don't publish this beyond the list; I
don't want to give the spam software writers any ideas. Thank
you.) The vast majority of spam I've received over the years
uses forged headers which include a "To:" header that is not
addressed directly to you.

Also, I assume anyone trying to follow this knows how to
activate and set up Procmail and Procmail recipes. If you don't
know how to activate Procmail on your system, then please go ask
your system administrator. Procmail is mostly a Unix beast. I
don't know if Procmail is available for other non-Unix platforms.

This script moves away all mail that is not directly addressed
to you into a separate mailbox, which I called "spambox". There
is an exception written into the rule that allows you to receive
mail that originates from the mailing list servers you use.
However! This exception _will_ fail if you subscribe to any
mailing lists that originate from the host you are using. (If
you put in your own host's mail server as an exception, unless
your host uses different servers for mailing lists and user
mail, then it will defeat the entire recipe! Remember that your
host will always appear in any message's Received header.) Of
course, there's a workaround for that, so don't panic. Read on.

You will need to make some modifications to the script for it to
work. First of all, replace all instances of "nickzman" with the
name of your Unix mail account (mine is "nickzman" as you can
see in my message header, so replace it with yours). This must
be at the top of the recipe. It basically allows messages that
are directly addressed to you to ignore this rule.

Now, to set up the exceptions. In the section that starts with
"!^(From|Message-Id|Received)[ :].*(\", you will need to add a
line for _every_ site that sends you mailing lists. This will
allow mail from the designated hosts to make it to you, even if
you are not stated as a direct recipient. Follow the format
exactly as I have given several examples. Finally, there's the
exceptions from the local hosts. As I said earlier, putting in
your mail host as an exception will defeat the rule, so don't do
it. For any mailing lists you subscribe to on your local host,
put the name of the list in where I put the examples
"divinity-guild" and "smartlist-users". If you don't subscribe
to any mailing lists on your own server, then you can take those
three lines out. Don't forget to update this list whenever you
subscribe to new mailing lists.

Oh, by the way, do not delete the Dummy line at the end. It's
there to keep the script from easily breaking due to human error.

At the bottom is the name of the mailbox where the mail should
be placed. I used "spambox" just in case someone tried to send
me a real message and it somehow got hit by this filter. (If you
use Pine as a mailer and have Procmail configured to put out
mailboxes where Pine can read them, then you can type "pine -f
spambox" from a Unix command line to open the box up.) But if
you don't want the "spambox" mail folder, and you just want to
remove every message that doesn't meet the conditions of this
rule, just replace the line with "/dev/null" to delete all
incoming mail that fails to meet any of the preconditions made
in this recipe. That's kind of dangerous, though. I make no
warranty for this recipe; you use it at your own risk, and if it
deletes anything important or breaks something else or whatever,
then I am not to blame.

If you do let the mail collect in a "spambox" mail folder, then
don't forget to go in from time to time, look at the mail
folder, and delete everything that doesn't look like it
accidentally triggered the rule. Otherwise, if you let the file
grow too large, your administrator will most likely delete it
for you...!

Actually, you could even make the rule stricter, by putting in a
line like "* ^:Subject:.*ADV" to filter out all messages that
have an ADV in the Subject line. Some spammers use an ADV in the
subject line because some places in this world have anti-spam
laws that require all advertisements to be marked as
advertisements with that text. Of course, that could backfire
and move stuff you don't want moved. YMMV as usual.

Once again, this is not a silver bullet. However, it's been very
effective at weeding out the vast majority of spam I receive.
And as a fellow FAQ maintainer (for alt.games.final-fantasy), I
get lots of spam, just like most of you probably do.

Here we go:

:0
* !^To:.*nickzman
* !^Cc:.*nickzman
* !^To:.*divinity-guild
* !^To:.*smartlist-users
* !^Cc:.*smartlist-users
* !^(From|Message-Id|Received)[ :].*(\
         squaresoft\.com|\
         barebones\.com|\
         connectix\.com|\
         metrowerks\.com|\
         cnn\.com|\
         apple\.com|\
         ti\.com|\
         landfield\.com|\
         add\.yahoo\.com|\
         DummyLineSoIDontForgetAboutThatPipeBar\
    )
spambox

I hope this helps some of you.

Nick Zitzmann
ICQ: 22305512

"Democracy is a very delicate tool, and if you try to impose
democracy without the basic civil society that supports it, you
get yourself into a serious problem." - Edward Walker, former US
Assistant Secretary of State for Near Eastern Affairs (2000-2001)

*************************************************************
  To unsubscribe send a message to majordomo@faqs.org as

  unsubscribe faq-maintainers fill-in-your-email-address-here
*************************************************************



[ FAQ Archive | Search FAQ Mail Archive | Authors | Usenet References ]
[ 1993 | 1994 | 1995 | 1996 | 1997 | 1998 | 1999 | 2000
]

---------

faq-admin@faqs.org

© Copyright The Internet FAQ Consortium, 1997-2000
All rights reserved