How do I use Mozilla Thunderbird to filter mail using the SpamAssassin score?
Mozilla Thunderbird allows you to create custom filters to handle mail. You can use the filters to organize email by moving, deleting, copying or forwarding it. Filters are applied to different email accounts and more than one filter can be used.
In the example below, we show how you can move messages that have a high SpamAssassin score into a "Junk" folder.
1. Open the "Message Filters" window
Start Thunderbird and click Tools, then Message Filters:
2. Choose the mail account
Use the menu to select the mail account you want to create a rule for, then click New:
3. Add a the SpamAssassin header
Select the first drop down menu beneath the text that says "For incoming messages that:" and select Customize which is the last option.
Enter X-Spam-Level and click Add. This will add "X-Spam-Level" to the list (which will probably be empty).
Then click OK.
4. Create the filter rule
The "Filter Rules" window appears.
Enter a name for the SpamAssasin filter. In the example below we've called this "Spam Assassin", but you can choose any name you like.
Look at the area under "For incoming messages that:".
The top box allows you to choose which part of the message you would like to filter on. Choose the X-Spam-level header, since this is used by SpamAssassin to indicate how "suspicious" the message is. The more stars present in this header, the higher the SpamAssassin score.
The next menu allows you to specify the criteria that must be met. Choose Contains and then add some asterisks to the text area next to it. In our experience, a message with a score of 7 or more is almost always spam so you will probably want to add 7 asterisks to start with. If you find that this is not catching enough spam, you may wish to reduce the number of asterisks.
Now we need to define an action to be performed when a message meets the criteria we have just specified. Choose Move Message To, then select where you want to move it. In the example below, we have moved it into a folder called "Junk".
Click OK to save the changes.
The SpamAssassin filter should now be applied to any new messages that you receive.