wiki:faq/email/sa-filter-spam

Version 6 (modified by Dana, 7 years ago) (diff)

--

How do I use Spam Assassin to filter email with my email client?

Note: this page specifically addresses using filters to deal with unwanted bulk email. Filters can be used for many purposes. If you use our webmail program (Horde/Imp or SquirrelMail) we have written specific directions for filtering spam with these programs. We also have specific directions for users of Thunderbird/Icedove. For all other email programs, please read on.

To use Spam Assassin, you create a filter to catch Spam Assassin's "flags".

You can do this two ways, depending on the email client or webmail program you are using.

All email clients let you create a filter for the Subject line. So you create a filter with

*****SPAM*****

as the filter's trigger -- the box that will say something like "contains" or "text". Email filters catch all email in the subject line that contains the trigger phrase so, since the subject is going to change with each email, you just include the part you are sure will appear in all spam. That's what we just wrote above.

Some email programs also let you create a filter for "any header" and if yours does, you can make a filter with the flag line

X-Spam-Flag: YES

as the filter's trigger and have your program send the affected email to a special box (either trash or, if you want, a box you create -- you can call it "spam" for example). This method is the preferred method. It is better than the subject line method because someone might forward you a message with '*SPAM' in the subject line (maybe because they are pointing out that a message you sent them was tagged as spam). This message will get moved to your spam box even though it isn't spam. Using the X-Spam-Flag approach ensures that only messages that are tagged as spam will get filtered.

The basic idea is that you are telling your email program to filter all messages that have the trigger line. In this way, you're using Spam Assassin as a kind of detective.