Accounts » E-Mail

ID #1038

How can I filter spam?

Introduction to SpamAssassin:

SpamAssassin is a filter for examining and testing email messages for SPAM content. It will then give each message a score. Messages with a "high" score will be moved to a file in your home directory titled "probably-spam"

When using this filter keep the following things in mind:

1) Good messages will sometimes be scored as SPAM.
Some legitimate mail will always end up moved into "probably-spam", so periodically you will need to look in "probably-spam" and do some housekeeping.

2) SPAM messages will somtetimes end up in your INBOX.
The rules and heuristics used to guess at a message being SPAM will never substitute for human filtering, so the filter will get occasionally tricked. If this happens often for your mix of messages, send <support@cs.ucsb.edu> a note and we can tune your filtering to your personal situation.

How to enable SpamAssassin filtering:

This filter will run through all your newly received mail before you read it with a mail reader. So, it applies to all computer platforms: UNIX/Linux, Windows, MacOS, etc.

a) Create a file in your HOME directory and name it ".procmailrc"

b) Cut and paste the text below into this file. (Current procmail users: prepend these rules to your existing .procmailrc)

# SpamAssassin sample procmailrc

# INSTRUCTIONS:
# a) Place a copy of this file in your HOME directory
# b) Rename it .procmailrc
# b.1) (procmail users: prepend the below rules, starting at BEGIN, to your existing procmailrc)
# c) Enable PROCMAIL filtering by updating your .forward file
# .forward example:
# "| procmail"
#
# d) Questions send to support@cs.ucsb.edu

# SUMMARY: Run all messages smaller than 250KB through SpamAssassin
# (spamc) one at a time
# Adapted from: [http://spamassassin.org/dist/procmailrc.example]
#
# Revision:
# 1.0 -- A. Boschke

# --BEGIN--

# Run spamc through monty.cs.ucsb.edu
:0fw: spamassassin.lock
* < 256000
| spamc -d monty

# All mail tagged as spam (eg. with a score higher than the set threshold)
# is moved to "probably-spam".
:0:
* ^X-Spam-Status: Yes
probably-spam

# Work around procmail bug: any output on stderr will cause the "F" in "From"
# to be dropped. This will re-add it.
:0
* ^^rom[ ]
{
LOG="*** Dropped F off From_ header! Fixing up. "

:0 fhw
| sed -e '1s/^/F/'
}

# --END--


c) Enable PROCMAIL filtering by updating your .forward file.

.forward example:

# Use PROCMAIL
"| procmail"

d) Questions, please send to support@cs.ucsb.edu

Tags: -

Related entries:

Last update: 2008-01-24 09:44
Author: A. Boschke
Revision: 1.3

Digg it! Print this record Send to a friend Show this as PDF file
Propose a translation for Propose a translation for
Please rate this entry:

Average rating: 0 out of 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry