Setting up Mail Filters in Pine

Pine is a full featured email client for *nix operating systems. This document will describe how you can create a basic mail rule to filter SPAM delivered to your account. You can click on any icon in this document to see view a larger picture.

[ Pine Main Screen ]

The first step is to create a new folder for your local mail delivery. This can be done from your mail folder list. From the main menu, select option [L] to bring up your current folder list.

[ Add new folder ]

From your folder menu, you can use option [A] to add a new folder. For the purposes of this document, we will name the new folder spam, but you can name it anything you like.

[ Pick Filter ]

After you have added the spam folder, you can proceed and create the filter which will do the work.

Return to the main menu, and select option [S] for setup. Once you are in the Setup menu, select option [R] for rules. From the rules selection menu, you will want to select option [F] for filters.

[ Filter Name ]

If you currently have no filters defined, the only option you will have is to "Add a new filter". Otherwise, you will be given a choice of options. If you have no filters, select [ Add a new filter ] otherwise select option [A] to add a new filter.

The first step will be to select a name for the new filter. Hit enter on the Nickname option and type in a name for this filter. For the purposes of this document, we will use the filter nickname of spam.

[ Subject Filter ]

The next step is to configure the pine filter as to what condition will trigger it to run. Our SpamAssassin filtering software modifies the subject field of any message it believes is spam, so we will use the Subject pattern for our filter trigger.

Highlight the option Subject pattern and press enter. When it asks for the text to be added, enter *****SPAM*****. It is important to make sure you have 5 asterisks ("*'s"), followed by the word SPAM in upper case, followed by 5 additional asterisks. If you type in the incorrect value for the subject condition, the filter will not properly trigger.

[ Select the right folder ]

The only other change you will need to make to the filter is to specify what pine should do with your spam. After this step, you do not need to make any other changes to the filter to make it work.

Pine has a few different options for what you can have it do with your mail.

You can have the filter leave it in your inbox, but change it's mail status. However, this is already done by SpamAssassin, so you probably don't want to do that.

You can also have Pine delete your mail. But, I don't recommend that option because it is possible that some valid email may be mistakenly identified as a "false-positive" by SpamAssassin and accidently deleted.

We recommend that you have pine automatically move the message to the "spam" folder. This will allow you to periodically check the spam folder for false-positives that were accidently moved.

Move down to the [ Filter Action ] section, and select Move. If you highlight the option Folder List and then press ^T (control-t), you are given a list of all of your mail folders. Choose the folder you wish your spam to be moved into.

Between SpamAssassin and mail filters, it should be possible to ignore the majority of SPAM that clogs up our email. Unfortunately, no automatic mail filtering system is perfect, but this combination provides the best compromise.


Last Updated: December 11, 2002, Ken Sallot