Gmail/Filters
From Wikibooks, the open-content textbooks collection
File:Screenshotgmailfilter.png
Filters are Gmail's ace-in-the-hole as you would expect from a search company. For example, Hotmail limits the number of filters while Gmail (to my knowledge) doesn't and allows much more fine tuning. Filters can filtrade your incoming mails, and put them into labels or archive them automatically.
[edit] Create a filter
When you are going to make a filter you click the little "Create Filter button" beside the search bar. Now you see a big yellow box, where you can choose what the massages have to contain or be like, if it are going to be filtered. If you click the test search button you can see what massages it will filter. When you have chosen the options you click the "Next Step" button.
Now there comes a new box, here you choose the action of the filter. Here is a description of the actions:
- "Skip the inbox" The message will be archived (Gmail version of "archived" - see below)
- "Star it" Give the message a star.
- "Apply the label" Puts the message into a label.
- "Forward it to" Forward the mail to another Mail account.
- "Move to deleted items" Delete the message.
Note: when you "archive" a message, all this means is the messages has its "Inbox" label removed. It does not changes its read/unread status etc. So using "Skip the Inbox" with "Apply the Label:[ ]" would move incoming mail matched by the filter automatically into a seperate "folder" in Outlook speak. If the message is left unread, then the label will the appear in bold with the number next of unread messags next to it, just like the Gmail "Folders" behave (e.g Spam, Trash).
Of course you can choose more than one action, so you can eks: Star and archive a message at the same time. 
[edit] Advanced filters
The titles that gmail gives each filter are in fact the "script" that it uses to parse each email. In other words, if you cut and pasted the entire title into the "Has the words" box, you would get the exact same filter. This obviously is silly--the interface generated that filter in a much easier fashion. But, it opens up new possibilities. For example, you now can do AND's and OR's to generate complex filters. So something like (subject:(biking)) AND (from:(foo) OR from:(bar)) would match all messages about biking that came from either foo or bar.
The symbol | (found on the same key as \), means OR. So you could write biking | helmet, which would be similar to (biking) OR (helmet), in the preceding paragraph.
Here are a few "super" filters.
- Create label bookmarks, in the to: box type in, youremail@gmail.com, and in the from: box, type in youremail@gmail.com, apply label bookmarks, archive now. Now, when you email yourself you won't clutter your inbox.
- Create label attachments. Check the Has attachments, label it attachments, archive it (if preferred). Now any email you have that has attachments, get labeled attachments. Making it easier to stay organized.
- Use gmail as a multimedia holder. do the following: create filter, in the has words box, type filename:mp3, apply label music, check the latest updates
If you have another format and don't want to make a separate filter, do the following: filename:mp3 | filename:wav. Refer to 2nd paragraph (above) for what | means.
Google offers a range of documented and undocumented search and filter operators that can be used to fine-tune a filter.
[edit] Weakness in filter pattern matching
One weakness is that gmail filters on match on ASCII letters. In fact, only case-insensitive ASCII. So for example, I get a bunch of messages that nicely have a subject that starts with [Bike]. One would hope that matching on [Bike] in the subject line would grab these emails and nothing else. But, matching on [Bike] is exactly the same as matching on bike. So it matches, BIKE, Bike, bike, and obviously the intended [Bike].


