|
|
 |
 |
 |
Filtering Your Email with Pine
Pine is the Program for Internet News and Email. It is a powerful program
with built-in filtering capabilities. If you are a troi.cc.rochester.edu
or mail.u.rochester.edu user and have signed up for spam tagging, you can
easily use pine to filter spam messages out of your inbox.
With spam tagging enabled, all spam-identified messages will have a
subject that begins with:
Subject: ~SPAM=[SCORE]~
The SCORE here is the rating the spam detection software has given a
particular piece of email. This rating is based on an extensive scoring
system that assigns values certain aspects of email messages. For
instance, email messages that have words in all capitals will score higher
than email messages that do not include "lines of yelling". If you are
interested in the complete rules, check here: spam rules.
Pine filters can be set up to check for ~SPAM= in the subject line, or be
more selective and look for certain header values.
- To set up a simple subject filter with pine, log in to your troi or
mail account and follow these steps:
- Start the pine program by typing 'pine' at your prompt. Pine will
open at the Main Menu. If you are not at the Main Menu, type
'm' to go to the Main Menu.
- Next, type 's' for setup, then an 'r' for Rules.
- Pine will ask what type of rule you want to create. Type 'f'
for Filters.
- You can now Add a filter with 'a'. Hit enter to name
your filter, 'possible-spam' is probably a good, descriptive name. Press
enter again to save the name.
- Use the bottom arrow key to move down to the Subject pattern
line. Press enterto select and then type in ~SPAM=. Hit
enter to save.
- Using the arrow key, move down to Current Folder Type. This
should already be set at INBOX, but if it's not, change the
Specific option to read INBOX.
- Now go down to Filter Action. Here, you will want to "Move"
the matching messages to a folder. Highlight the to Folder option
and hit enter to select. Name the folder for your matched messages
to be stored in, perhaps possible-spam. Then press enter to save.
- Press 'e' to Exit Filter Setup.
- Type 'y' to save changes.
- Type 'y' to create the folder for the filter you just created.
- Type 'e' to Exit Pine Setup.
- Type 'y' to save changes.
- To create other filters, just follow the same general guidelines.
- Remember that pine contains thorough online help. Just highlight the
option you would like help with and press '?'.
- More complex filters can be set up using headers specially inserted by
the spam-tagging software.
- Once in pine, go to the Main Menu, press 's' for setup, then
'r' for Rules, and then 'f' for Filters.
- Type 'a' to Add a filter.
- Name your filter by hitting enter, typing in a name and then
pressing enter again.
- Type 'x' to let pine know you want to filter on an eXtra
header.
- The special header is called X-Spam-Level indicates a message's spam
score. Tell pine to filter on this header by entering X-Spam-Level
as the name of the header field to be added.
- With the cursor highlighting X-Spam-Level, hit enter to set the
pattern pine will match, probably somewhere between 8 and 20 asterisks:
**********
- Each asterisk represents a point awarded to a message by the spam
tagging software. The more asterisks the higher the score and the more
likely that the given message is spam.
- Hit enter to save the added *'s.
- Move down to Current Folder Type and select Email by
highlighting it and pressing enter.
- Scroll further down to Filter Action.
- The options here are pretty simple, either move matched messages to a
folder and specify a name for that folder (almost-certainly-spam,
perhaps), or delete.
- Before opting for delete, consider testing your filter and the level
of spam detection by saving messages into a folder and checking it for
incorrectly matched legitimate email.
- False positives are possible. Only the highest-scoring spam
should be deleted. Deleted messages are not recoverable and would be
permanently lost.
- For finer spam control, create several filters that match different
spam scores and file those messages accordingly.
- Filtering outside of pine with procmail
One downside of pine filtering is that it only works when pine is run at
the command line. If you use other clients (WebMail, Netscape, etc.) to
check your email, your spam will not be filtered.
Filtering email automatically upon receipt is possible with procmail. Procmail is a mail processing engine
currently being used to send incoming email to SpamAssassin so that spam
can be tagged. It can also be used to directly filter email by editing
it's control file, .procmailrc.
Here is a sampling of "recipes" that can be created in the .procmailrc file:
# Comments begin with '#' and are not read by programs
# Messages with a score of 20 or more are almost certainly spam.
# Send to almost-certainly-spam folder.
:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
almost-certainly-spam
# All mail tagged as spam (eg. with a
# score higher than the default of 5)
# is moved to potential-spam folder.
:0:
* ^X-Spam-Status: Yes
potential-spam
end .procmailrc example
As above with Pine filtering, you can use either or both of these filtering rules. For both, be sure to keep them in the order shown, or the X-Spam-Level rule will not be applied.
|