Configuring pine to filter out spam

Mail arriving at Imperial is passed through a spam analyser before it reaches the central MS Exchange servers. The analyser (Spam Assassin version 2.60) examines the envelope, the mail headers and body content of every message, applying several hundred tests to rate the likelihood of the message to contain spam (otherwise known as UCE, or Unsolicited Commercial Email). It then inserts the results of its analysis into the the mail header, a part of the mail message that is normally hidden to users and contains important information about the message that is used by mail software to route the message to its destination.

Many mail clients will allow you to set up filters or rules to intercept incoming mail and process them according to a defined set of actions and pine is no exception.

Configuring pine's filter rules

  1. Start up pine in the usual way by typing pine at the UNIX prompt

  2. Now select the S SETUP option using your cursor keys (or type the letter S)

  3. and you will be presented with the setup menu

  4. scroll down the menu with your cursor key to see the rules option if you wish (as it is normally hidden out of view near the bottom of the configuration menu) or simply type the letter R to select it.

  5. After pressing R you will be prompted for the type of rule you want to set up:

  6. Now press F to add a new filter rule

  7. Press A to add a new rule:

  8. Now you'll see the Nickname option highlighted; press return or type C to give your new filter rule a name - something like 'spam filter' would be a good choice:

    and press return to confirm the name of your new rule.

  9. Now move the cursor to any of the pattern lines below the nickname configuration option

  10. and press X to add an extra pattern to the header:

  11. Type in the phrase X-Spam-Status pattern

  12. and press return to confirm your new header.

  13. With the X-Spam-Status pattern you have just added still highlighted, press C to change the value to Yes:

  14. and press return to confirm.

  15. Now scroll down the configuration menu (accepting all the default settings along the way) until you reach the section entitled Filter Action = and select the Move option by pressing *

  16. Now move down one line to the to Folder = option

  17. and pressing either C or return...

  18. and press return to confirm.

  19. Now press E to exit from setup ...

  20. ...answering yes when prompted.

pine will now detect any messages whose X-Spam-Status flag is set to 'yes' and automatically move the message to the 'spam' folder. Once you are sure that the system is correctly detecting and removing spam from your inbox, you can if you wish return to the pine rules configuration menu and change the filter action so that it deletes all messages marked as spam:

Andy Thomas

UNIX/Linux support,
Faculty of Natural Sciences

last updated: 1.03.2006