6. spamassassin

6.1. About spamassassin

Spamassassin identifies possible spam and flags it up with by adding this header to the original message:

X-Spam-Flag: YES
   

6.2. procmailand spamassassin

spamassassinmust inspect and modify each message before it arrives in evolution's mailbox. One way of doing this is to intercept the mail with procmail. procmail can easily be configured to run spamassassin (see figure 6).

This is how you start procmail. Put a hidden file called procmail in the user's root home directory. The presence of this file causes procmail to start and to follow any instructions contained in the procmail configuration file. procmail will run spamassassin if .procmailrc contains these two lines.

:0fw 
| spamassassin 
   

The next step is to set up a filter in evolution. The filter will move all messages with an X-Spam-Flag set to a folder called Spam instead of the normal inbox.

Menu bar
   Tools
      Filters
Filters dialog
   Incoming 
      Filter rules
        (New)
Edit Rule dialog
   Rule name: Move to Spam folder
   If box 
      Specific header X-Spam-Flag contains YES
   Then box
      Move to folder
         Click here to select a folder
            New
               Create new folder dialog
                  Folder name: Spam
                  Folder type: Mail
                  Specify where to create the folder: Inbox
            OK
OK
   

6.3. Local mail

Local mail still collects in /var/mail/local-user. Previously, you would have read local mail using mail's mail command. It is best not to do this now because mail read in this way would end up in /home/local-user/mbox. You can filter on the name of local computer and divert it into a new folder called Local. (Substitute the name of your computer for local-host. You can check what this is using the command hostname .)

Menu bar
   Tools
      Filters
Filters dialog
   Incoming 
      Filter rules
        Add
Edit Rule dialog
   Rule name: Move to local folder
   If box 
      Recipients contains @local-host
   Then box
      Move to folder
         Click here to select a folder
            New
               Create new folder dialog
                  Folder name: Local
                  Folder type: Mail
                  Specify where to create the folder: Inbox
            OK
OK
   

6.4. Putting it all together

Congratulations. You have now built the whole system! (See figure 7.)