EnServe Guides
contents
How To...


Filter Spam Automatically

When the system processes your mail it will check for Spam. If it finds any (with version 2.63 of SpamAssassin) it will add some addition text and then deliver it to your mailbox.

You can setup your mail client, in this example, I will use Outlook Express (version 5 and 6) to 'Filter' the mail automatically and move it to a 'Spam' folder. You can then check it as time permits.

SpamAssassin does add some 'Headers' to the mail to indicate Spam, unfortunately, Outlook Express does not have the ability to act on them. Other mail client may be able to and in that case you should filter on 'X-Spam-Flag: YES' as this is a better test. An example is shown later.

Outlook Express

Tools -> Messages Rules -> Mail -> New

In Box 1 (What to look for in the mail)

  • Click 'Where the message body contains specific words'
  • Click 'Where the message has an attachment'

In Box 2 (What to do with it)

  • Click 'Move it to the specified folder'

In Box 3 (Specific details)

  • Click 'Contain Specific Words' - Enter 'Spam detection' then OK

  • Click 'specific folder' - Enter - New Folder - Spam - OK

In Box 4 (What to call the rule)

  • Give it a Name e.g. Spam Check

The above assumes, if, the text 'Spam detection' (added by the system) is present and the message contains an attachment then it will be tagged Spam. This is open to 'false positives', that is if someone mails you a genuine message meeting the criteria then it will be marked. There is no easy way to avoid that with Outlook Express.


Using the Mail Headers is much more reliable. In this example, we will use this header to accurately check the Spam Status.

Netscape Mail (Version 7.1)

Tools - Message Filters - New

  • Click beside 'Subject' and select Customize

  • In the New message header box enter 'X-Spam-Flag'
  • Now when you click subject there is a new option X-Spam-Flag, click it
  • Click 'Contains' and select 'is'
  • Click the box and enter 'YES'

    In the 'Perform these actions' box enter 'Move to folder' and select where you want it moved to.

There are a couple of Unix mail delivery options (deliver and procmail) that can perform the same actions as above and move the received mail to spam folders automatically. Please contact us if you would like details of mail filtering on the host rather than the client.


FAQ's