spacer graphic spacer graphic x10icon graphic [Bar]


Queries for E-mail

 

As you know from last week's Tip, Attributes for E-mail Folders, each e-mail message is stored as a separate file in the Be file system. As you might have guessed from the discussion of showing e-mail attributes in Tracker windows, e-mail message files are stored with the most important e-mail headers added to the file as attributes (as well as being in the message file itself).

One result of this is that you can show the attributes in a Tracker window, as described last week. An even more exciting result is that this enables querying your e-mail messages on those attributes.

Finds performed in the Tracker have results windows which look and behave exactly like regular Tracker windows (and you can save these queries, see Tip 5, Reusing Your Queries). Because of this, BeOS queries can be used to create "custom mailboxes" for your mail, which are in some ways more powerful than the filters you'll find in other e-mail products.

For example, here's how to create a custom mailbox that contains all the mail you've received from an electronic mailing list, in this example Be's BeDevTalk list:

  1. Open the Find panel by choosing Find from the Be menu in the Deskbar.

  2. From the "find what" pop-up (which says "All files and folders" by default), choose "E-mail".

  3. From the "find by" pop-up (which says "by Name" by default) choose "by Attribute".

  4. In the Attribute Query definition area, choose "Reply To contains" from the attribute pop-up (which says "Name" by default).

  5. Type "bedevtalk@be.com" in the Contains text field.

  6. Click the Search button.

A Tracker window will open with the results of your Find, showing you all the mail messages with a Reply-To header that contains "bedevtalk@be.com". By changing the attributes displayed in this window (Attributes for E-mail Folders again), you can turn this into a custom mailbox that always contains all of your BeDevTalk mail, no matter where you've filed it on your system.

The query behind this window is "live". That is, as you receive more messages from the BeDevTalk list, they will automagically appear in this results window (as well as your In mail folder).

You can create more complicated Find requests to create more intelligent mailboxes. For example, you could create a Find request for all of your friends, to have a live mailbox that shows you your personal mail. Or you could create a Find request that catches mail from the most common spammers, and throw it all away:

  1. Repeat steps 1-3 in the above example.

  2. In the Attribute Query definition area, choose "From contains" from the attribute pop-up (which says "Name" by default).

  3. Type "@savetrees.com" in the Contains text field.

  4. Click the Add button to add another where clause definition line.

  5. Repeat steps 2-4 to add "@cyberpromo.com", "@mailexcite.com", "@pleaseread.com", and "@submitking.com" to the Find definition.

  6. Change all of the "And" pop-ups to "Or" (you want to find mail from "@cyberpromo.com" OR "@mailexcite.com", etc.).

  7. Click the Search button.

You will get a list of mail which you can immediately throw away. ;-)

You can query on any of the various e-mail attributes which the BeOS keeps track of (there's a list at the end of Attributes for E-mail Folders), to create custom mailboxes that show just the mail you need to look at. Once you've created the query, be sure to use the hint about Reusing Your Queries to rename them to something useful, like "Kill those Spammers".


Copyright © 1999 by Be, Inc. All rights reserved. Legal information (includes icon usage info).
Comments, questions, or confessions about our site? Please write the Webmaster.