Duke University
Center for the Study of Aging and Human Development

     
       
Home Page

Computing & Statistics Lab

How to Filter Spam on the Center for Aging Email System 


General information on spam filtering

	In the interest of giving users more control over filtering 
unwanted email messages, the computing staff has installed a program 
called SpamAssassin. (http://www.spamassassin.org) This program augments 
the headers of incoming email by adding several additional lines. It does 
not change the way that email is delivered in any way, but the addition 
of these new headers gives users the opportunity to filter their incoming 
mail according to their own standards.

	These additional headers provide a score for each message, which 
estimate the likelihood that this particular piece of email is spam. Below 
is an example of what an augmented header looks like:

X-Spam-Flag: YES
X-Spam-Status: Yes, hits=22.6 required=8.0        
X-Spam-Level: **********************

	 SpamAssassin uses several heuristics to determine if a piece of 
mail is spam. Typically a value of hits greater than 8.0, as seen in the 
X-Spam-Status line, is spam. Accordingly we have set the system-wide 
default to be 8.0. This number can be adjusted by each user. You can also 
create your own 'white_list' or 'black_list' to accept or reject all 
messages from a particular address.

How to filter spam 

	In order to take advantage of this filtering, you can do one of 
several things - mark a message as SPAM in the Subject field, move spam 
to a folder or delete the message. We suggest that you start by either 
marking the message as spam or moving it to a folder and reviewing the 
messages to make sure the filter is working as you expect. Over a period 
of time you can 'tweak' the filter by adjusting the numeric threshhold 
and creating white lists and black lists. If you become confident that no 
legitimate messages are being marked as spam, you can set up your email 
program to delete those messages, but be sure this is what you want, 
because once the message is deleted, it's gone.

	To change the threshhold of number of hits required for a message 
to be considered spam:
1. Log on to the UNIX system.
2. Edit the file ~/.spamassassin/user_prefs to add these lines at the end 
   of the file:

   # How many hits before a mail is considered spam.
   required_hits           5.0

The first line is a comment. The second line sets the threshhold at 5.0.

Setting up mail clients to filter spam

Netscape Messenger

1. In version 4, do Edit  -> Message Filters -> New
   In version 6, do Tools -> Message Filters -> New
2. In the Filter Rules window, name the filter X-Spam-Flag
3. Click the 'Advanced...' button
4. In the 'New Message Header' box enter 'X-Spam-Flag' and click Add, then 
   click OK.
5. When returned to the Filter Rules window, select "Match any of the
   following." 
6. From the pulldown menu directly above the "More" button, select 
   X-Spam-Flag. 
7. In the field to the right of "Contains", type YES. 
8. In the box next to the word "then" choose the action you want to take.
9. Click OK in the Filter Rules window and click OK in the Message Filters 
   window.


Pine

Start from pine's main menu.
1. Press S for Setup. 
2. Press R for Rules; then press F for Filters. 
3. Press A for Add. 
4. Press Enter/Return, then set the nickname to "Spam Filter". Press
   Enter again to save the name.
5. Check the CURRENT FOLDER CONDITIONS BEGIN HERE section. Make sure that 
   the Specific option is set and the Folder List is "INBOX". If not, make 
   the required changes so that that is the configuration. 
6. Cursor to th section FILTERED MESSAGE CONDITIONS BEGIN HERE and type 
   'x' for (X)tra header. In the space provided type 'X-Spam-Flag'. Press
   Enter. Press 'C' to change the value to 'YES'. Press Enter.
7. Scroll down to 'Message is New?' and type a * on Yes. 
8. Scroll down to the ACTIONS BEGIN HERE section. Make sure the 'Filter 
   Action' option is set to Move. Put the cursor on 'Folder List =' and 
   hit Enter. Type in the name of the folder where you want to put 
   possible spam, such as "PossibleSpam" to remind yourself that it could 
   contain false positives. 
9. Press E for Exit Setup; press Y to save the changes; press Y to create 
   the spam folder.
9. Press E again to Exit Setup and press Y to save.

Eudora

1.  Go to the Tools: menu and select Filters to open the Filters window.
2.  To add a new filter, click NEW.
3.  Select the option to Match Incoming messages.
4.  In the 'Header:' field type in X-Spam-Flag.
5.  The next drop down field should have the word 'contains'.
6.  In the field to the right of the word 'contains' type in YES.
7.  Under Action, move the mouse over the arrow next to None and click.
    Not all actions are available in the free version of Eudora.
8.  Select 'Transfer to' near the bottom of the list. When you do this a 
    field with the word 'In' will appear.
9.  Click on 'In' and select 'New...'
10. Enter Spam for the name of the new mailbox to which your messages
    identified as spam will be transferred. Click OK.

For more information, including screen shots, see the following web page: 
http://www.eudora.com/techsupport/tutorials/win_filters.html 

Outlook 2002
0.  On the UNIX system, edit the file ~/.spamassassin/user_prefs to add
    these lines at the end of the file:

    # Rewrite the Subject: field to identify the message as spam
    rewrite_subject 1

1.  Select Rules Wizard from the Tools menu. 
2.  Select your Inbox folder for the "Apply changes to this folder" field. 
3.  Click the New button. 
4.  Select "Start from a blank rule". 
5.  Select "Check messages when they arrive". 
6.  Click "Next." 
7.  Checkmark the Condition "with specific words in the subject". 
8.  Click "specific words" in the Rule description field to edit it. 
    Type ***SPAM*** in the "Specify words or phrases..." field. 
9.  Click "Add" and then click "OK". 
10. Click "Next." 
11. Checkmark "move it to the specified folder" from the "What do you want 
    to do..." list. 
12. Click "Specified" in the Rule description field to edit it. 
13. Click "New" to create a new folder. 
14. Type 'Spam' in the Name field 
15. Click  in the "Select where to place the folder" field and click 
    INBOX then "OK." 
16. Click "Finish" to create the rule. 
17. Click "OK" to exit. 

Outlook Express 6

NOTE: Outlook Express 6 can only filter local folders used by a POP3 
protocol connection. If you are using an IMAP protocol connection, you 
must use another mail client to filter mail identified as spam by
SpamAssassin. 

	Please contact Irv Eisen, irv at geri.duke.edu with questions or 
to arrange a time to help you set up filtering.
  
About Us | Weekly Bulletin | Center Report | People | Research | Education | Service | Pepper Grant | Links | DUMC | Duke
Copyright 2004 Duke University Center for the Study of Aging and Human Development

Questions or Comments? Contact Webmaster