www.ntnu.no *
INFOWEB >  email >  general  > Using procmail for spam filtering
Artikkelen er utdatert
Forfatteren mener at denne artikkelen er utdatert siden oktober, 2006. Av hensyn til fullstendighet og referanser er artikkelen gjengitt nedenfor, men husk at vi ikke kan garantere nøyaktigheten av den.
Verktøy
Du kan legge til kommentarer
Eller sende denne artikkelen
Les artikler skrevet av skolmli
Brukervurdering
Hvor mye hjelp var det i denne artikkelen?
Mye Noe Lite
Forhåndsvisning
Du trenger ikke en 'utskriftsvennlig side' for å skrive ut denne siden. Forklaring
Innhold

Using procmail for spam filtering

The IT-section at NTNU, ITEA (the link only exists in Norwegian), has implemented a system on the e-mail servers to check all incoming e-mail to determine how probable it is that it is spam. This article shows you how to use procmail to filter out messages that has been tagged by the spam filtering system.

Setup

  1. Connect to your home directory
  2. Download the finished .procmailrc file and save it on M:
  3. Log on to login.stud.ntnu.no and run the command mv procmailrc.txt .procmailrc (remember the dot). You cannot change this in Windows Explorer
  4. Check your spam folder once in a while to delete spam (thus freeing some space) and to find legitimate e-mail which has been filtered wrongly

A warning when using procmail: If .procmailrc contains syntax errors e-mail will still be delivered, but it can be hard to predict where the e-mail will be delivered. To check whether your filtering rules work correctly, you may download an e-mail to your home area, execute the command cat e-mail.txt | procmail there, and check if it was delivered correctly. To check effectively you should edit e-mail.txt so that it is caught by the last rule you added.

procmail looks for filtering rules in the file .procmailrc in your home area to determine where e-mails should be delivered. The file could for example look like this:

kode #1
MAILDIR=$HOME/mail
LOGFILE=$MAILDIR/.procmail-log
DEFAULT=$MAILDIR/INBOX

# Checking the spam headers
:0 H:
* ^X-Spam-level: \*\*\*\*\*
spam
Explanation of the contents:

  1. MAILDIR is the main directory for e-mails
  2. LOGFILE is the file which procmail logs to
  3. DEFAULT defines which folder the email should be put in if none of the rules in the file apply to it
  4. # starts a comment line
  5. :0 H: means that a rule is starting, and the "H" means that procmail should only check the header for matches
  6. * is the start of a rule line
  7. ^X-Spam-level: \*\*\*\*\* matches a line starting with the text "X-Spam-level: " followed by five asterisks ("*"). To filter out more spam you may decrease the number of occurences of \*, and to lower the amount of wanted e-mails that are filtered as spam you may increase it.
  8. The last line defines which folder the e-mail should be delivered to if it matches the rule.

Språk: en flag_no Kommentarer: 0 Aid: 250 Brukervurdering:
 
 
Sist oppdatert: 2007-06-25 Forfatter: skolmli Lest: 2889 ganger