Message Filters

From MozillaZine Knowledge Base
Jump to navigationJump to search

Message filters are useful if you routinely want to perform certain actions on messages, according to criteria that you've specified. For instance, you can have incoming mail automatically sorted into different folders, with certain messages labelled, marked as Junk, or even deleted. Filters can be applied automatically to incoming mail, or you can run them manually when desired.

Creating filters

This tutorial has clear, step-by-step instructions (with screenshots) for how to set up message filters in Thunderbird. You can also create a new filter from any message by right-clicking on the hyperlinked email address of the sender, where it appears above the message pane, and choosing "Create Filter From Message...."

Important: filters must be set up on a per-account basis, and they likewise operate on a per-account basis. There is not currently any option to create "global filters" that will operate on all your accounts. If you are using the Global Inbox with multiple POP mail accounts, you can create filters for Local Folders but these filters will not be applied automatically to incoming mail. You must run the filters for Local Folders manually. You can, however, create filters for any specific account that uses the Global Inbox, and these account-specific filters will operate automatically on incoming mail.

Running filters

Filters that are enabled will be run automatically, in the order in which they are listed in the "Message Filters" dialog ("Tools -> Message Filters..."). Note that if you set up a filter to move an incoming message to a specified folder, subsequent filters will not be automatically applied to that message once it has been moved from the Inbox. As noted above, filters for Local Folders will not be run automatically on incoming mail. Also, there is currently no option to have filters be applied automatically to outgoing mail.

To run filters manually on the currently opened folder, select "Tools -> Run Filters on Folder". To manually run only some of your filters rather than all of them, go to "Tools -> Message Filters...", select the filters you want to run, and click the "Run Now" button.

Other information

  • The file that stores your filter settings in called "msgFilterRules.dat". Each account will have its own "msgFilterRules.dat" file, stored in the account subfolder in the "Mail" or "ImapMail" folder in your profile folder. (In the case of filters for Local Folders, "msgFilterRules.dat" will be found inside the "Local Folders" folder itself.)
  • If you want to duplicate filters from one account to another without manually recreating each individual filter, you can copy "msgFilterRules.dat" from one account subfolder to another.
  • Also note that if you filter based on custom headers you will need to copy the user_pref("mailnews.customHeaders","") line from the prefs.js in the other profile into your new one.
  • Automatically filtering for the Global Inbox (Local Folders) is in the works for Thunderbird version 1.5.

See also