Happy Thursday, 2010 September 09 09:01 EDT
This page has been visited 5 times today.
  >   home   >   resources   >   spamfilter
Simple Spam Filtering

By using two popular anti-spam techniques, you can block nearly all incoming email spam. It does not require setting up or maintaining any software, only creating a set of filters in your existing mail client or mail delivery agent. It does not require complicated spam-keyword matching, which would be prone to mistakes.

How it works: unsolicted spam is almost always sent Bcc (blind carbon copy). Ordinary mailing lists also use Bcc. So if you set up a "white list" filter for your mailing lists, what remains is more than likely spam.

The following examples use Procmail, a mail delivering and filtering program that is commonly available on UNIX or Linux based servers. But the same concepts may be used in your mail client (for example, Outlook or Mozilla) if Procmail is not available to you. In the following examples, the commented text describes how to set up the equivilant rules in Mozilla Mail or Outlook Express.

First, set up a "white list". Create rules for each mailing list that you are on. For example (~/.procmailrc)


# New York Times bulletins

:0:

# From contains 'nytdirect@nytimes.com'

* ^From.*nytdirect@nytimes.com

# Move to folder 'news'

news


# PBS Previews

:0:

# From contains 'previews@pbs.org'

* ^From.*previews@pbs.org

# Move to folder 'news'

news

Next, forward all mail that isn't To or Cc your personal address(es) to a "spam" folder. (And this must be after the white list ruleset). For example:


# If it isn't sent directly to me, I probably don't want it

:0:

# To or cc does not contain 'guym@guymcarthur.com'

* !(To|Cc):.*guym@guymcarthur.com

# To or cc does not contain 'guym@arizona.edu'

* !(To|Cc):.*guym@arizona.edu

# Move to folder 'spam'

spam

This has the following results:
A) Anything Bcc you and not from from a known-good list goes into the spam folder. In practice, this catches about 95% of all spam.
B) Everything sent directly to (or cc) your address(es) goes to your inbox. This could included unsolicited spam send directly to you, but most likely it will be opt-in spam, which presumably can be unsubscribed from.

It's very effective. The only drawback could be if you have a personal contacts who occasionally Bcc you: then you may want to add white list rules for them. But that situation is very atypical.