MozillaZine

Saved Search

From MozillaZine Knowledge Base

This article was written for Thunderbird but also applies to Mozilla Suite / SeaMonkey (though some menu sequences may differ).

A Saved Search is like a mail folder, but it has a special icon and a special function. The icon depends on the theme you are using, but it typically includes a magnifying glass. (For examples, see: Icons_-_Thunderbird)

When you create a saved search folder, you specify folders to search and criteria to apply. When you look in a saved search folder, it displays a list of messages that match your criteria. For example, you could create a Saved Search folder that lists all the messages received from a certain person over the past 30 days, even if those messages are stored in different folders and subfolders.

A Saved Search folder is a "virtual folder" in the sense that it merely displays a set of messages that meet the search criteria, while the actual messages remain stored elsewhere. If you select and delete a message inside a Saved Search folder it will get deleted from its actual location, but if you delete a Saved Search folder itself all of the actual messages will remain intact. Moreover, unlike a normal folder, if you modify the search criteria for a Saved Search folder its virtual "contents" will be accordingly updated. Your Saved Search folders will remain in the folders pane even after you exit and restart Thunderbird, until you delete them, thus giving you quick and convenient access to your pre-defined searches.

Contents

Creating a Saved Search folder

You create a Saved Search folder through the "New Saved Search Folder" dialog (screenshot), which can be accessed in any of these different ways.

  • In Thunderbird go to the "Edit" menu and choose "Find -> Search Messages". Alternatively, get a context menu for a folder (for example, by right-clicking it) and choose: Search...  After you enter your search criteria and click the "Search" button, you can then save your search by clicking the "Save as Search Folder" button. (screenshot)
  • In SeaMonkey, choose Tools – Search Messages...   Alternatively, get a context menu for a folder (for example, by right-clicking it) and choose: Search Messages...   After you enter your search criteria and click the "Search" button, you can then save your search by clicking the "Save as Search Folder" button.
  • Go to the "File" menu and choose "New -> Saved Search...".
  • After doing a search via the Quick Search box, located above the message-list pane, choose "Save Search as a Folder" from the drop-down list to save the results of your Quick Search. (screenshot)
  • From the "View" drop-down list, located above the message-list pane, choose "Save Search as a Folder" to save your current setting for "View". (screenshot)

Once the "New Saved Search Folder" dialog pops up, you simply enter a name for the new Saved Search folder, select a location for it using the "Create as a subfolder of" drop-down list, then add or modify the search criteria that you want to be used (including the folders or subfolders to be searched), and click the "OK" button. This new Saved Search folder should now appear in the folders pane.

Note: Thunderbird is unable to create saved search folder (virtual folder) properly when "/" (slash) is in name. bug 286523

Searching subfolders: if you want to create a Saved Search folder that searches subfolders, the easiest way to do this is through the first method listed above ("Edit -> Find -> Search Messages"), since the "Search Messages" dialog provides a simple checkbox option to search subfolders. The other three methods listed above search only the currently selected folder, but not its subfolders, by default; if you want the Saved Search folder to include subfolders in its search results, click on the "Choose..." button in the "New Saved Search Folder" dialog and manually select the subfolders that you want to include.

Online vs. offline searching (for IMAP , News and RSS folders)

You can set up a Saved Search folder for IMAP , News or RSS folders to work in either offline or online modes. Just check/uncheck the box for "Search Online" in the "New Saved Search Folder" dialog according to your preference.

Online searching will give you more accurate results, since the search will be updated online every time you open the Saved Search folder. However, a Saved Search folder working in online mode will take longer to load.

With offline searching, the Saved Search folder will load more quickly, but its contents will not reflect changes to folders that you have not opened recently. For instance, if you send some messages using a IMAP account, a Saved Search folder working in offline mode may not get updated to include these messages in its results until you first open the Sent folder.

Changing the search criteria of an existing Saved Search folder

To modify the search criteria for a Saved Search folder that you created previously, either right-click on the folder and choose "Properties", or select the folder and then go to the "Edit" menu and choose "Folder Properties". The "Edit Saved Search Properties" dialog will then appear. Change the search criteria as you wish, and click the "OK" button.

If the virtual contents of the Saved Search folder do not get updated immediately, just click on any other folder and then click on the Saved Search folder again.

Searching across multiple accounts

Beginning with Thunderbird 1.5, you can create Saved Search folders that search across more than one account listed in the folder pane. To do so, you can either:

  • Create a new Saved Search folder via "File -> New -> Saved Search", then click on the "Choose" [folders to search] button, and select all the folders you want to be searched.
  • Edit an existing Saved Search folder: either right-click on the folder and choose "Properties", or select the folder and then go to the "Edit" menu and choose "Folder Properties", then click on the "Choose" [folders to search] button, and select all the folders you want to be searched.

Deleting a Saved Search folder

You can delete a Saved Search folder in the same way that you delete a normal folder: either right-click on the folder and choose "Delete Folder", or select the folder and go to the "Edit" menu and choose "Delete Folder". When you delete a Saved Search folder in this manner, no actual messages will be deleted. When you delete a Saved Search folder, it will be permanently deleted. It will not go to the Trash and cannot be recovered like a normal folder.

Other information

  • In the folder pane, you can drag a Saved Search folder from one folder to another in the same account. You cannot, however, drag a Saved Search folder into Local Folders from another account or from one account to another.
  • In your profile folder, the file that stores the settings for your Saved Search folders is called "virtualFolders.dat". If you rely heavily on Saved Search functionality it is recommended that you regularly back up this file.
  • Searching by flag (bug 272709) is possible beginning with Thunderbird version 1.5.