Spam filtering with Apple Mail.app

Users of Apple's Mail.app can use the Lab's SpamAssassin installation score their e-mail and then use Mail.app's filter rules to remove spam.

To setup MacOS Mail.app to filter mail using the header information added by the SpamAssassin service you need to do two things. First, you must create a folder into which suspected spam messages will be transferred. And second, you must create a filter rule which will check the Spamassasin headers and perform the filtering.

Create the Spam folder

Since Mail.app has its own Spam mail filtering system, you may already have a mailbox (usually named "Junk") into which suspected spam could be filtered. If this folder does not exist, then you must create it.

To create a folder to hold suspected spam (assuming that you don't have one already)...

A dialogue box will appear that contains a field allowing you to name the new mailbox, and pop-up menu allowing you to specify where the mailbox should be created - on your local machine or on your staffmail account (there may be other options available if you have more email accounts). It's recommended that you don't use a mailbox on your local machine - at least until you are happy that the filtering is working correctly.

Creating a filter to deal with suspected spam

You need to create a filter which will check whether messages are likely to be spam. This filter will work by checking for information added to the message headers by the SpamAssassin service. Specifically you will be checking the value of the X-Spam-Flag header.

To create the filter...

Add rule menu Message Headers Finish Rule

Now that you have told the rule which messages to select, you use the pop-up menus on the lower part of the sheet to tell the rule what to do with these messages.