Back in Mac 101’s long-ago days when we were first getting our feet wet with the Finder, I introduced you to smart searching—the process of creating a series of conditions that would display matching files in a list. For instance, you might set up a list of JPEG image files that were over a megabyte in size. As I explained at the time, the idea of stringing together conditions to filter the information you see is a concept that runs throughout Mountain Lion.
One area where this concept is apparent is in Mail’s rules. But rather than using such conditions to deal with files already on your Mac, more often than not, you employ rules to sort your email as it’s delivered to your Mac. Just as an example, let’s apply this idea to the real-life paper mail that we still receive from time to time.
When you open your physical mailbox at home, you find all your mail bunched together—catalogs, magazines, letters from your Auntie Di, bills, advertisements, and Netflix envelopes. Now imagine, instead, opening that mailbox and finding your most important mail (say, envelopes stuffed with money) right up front, personal correspondence that you care about in a little bin to the right side, your Netflix envelope in yet another bin to the left, magazines sitting in their own container near the back of the box, and any junk mail reduced to a bare few ashes. Far more convenient, yes?
Without giving your postal carrier a very generous holiday tip, that kind of thing just isn’t going to happen. But you can accomplish the equivalent in Mail.
Looking at rules
Launch Mail and choose Mail > Preferences (or press Command-comma). In the resulting window select the Rules tab. By default you should see a single entry: News From Apple. Let’s create a rule of our own by clicking the Add Rule button.
When you do, you get a sheet that includes a Description field, some pop-up menus, and Plus (+) and Minus (-) buttons. The sheet has two major sections. Under the Description field is the If area. The items here are the conditions that must be met for the rule to do something. For instance, an acceptable condition might be If From Contains firstname.lastname@example.org. With this If condition, any messages sent from that address will be manipulated by the actions you create beneath. For example, in the ‘Perform the following actions’ area, you could configure the action Set Color of Message of Text to Red.
Click OK, and Mail will ask if you’d like to apply this rule. Once you indicate your agreement by clicking Apply, any existing messages from Bubba will be colored red in the Message Browser, making them easy to identify. This is great, but better yet is that any future messages from Bubba will also be colored red. And that’s the power of rules—preemptively sorting your email so that you don’t have to do it manually.
That’s largely it: Create conditions that keep an eye peeled for specific existing and incoming messages, and then do something with the email that arrives.
Some helpful Mail rules
I don’t want to leave you entirely on your own at this point, so let’s make a few helpful rules.
Filtering mail to another folder: You’ll use a rule like this fairly frequently to file your email automatically so that it doesn’t junk up your inbox.
Start by choosing Mailbox > New Mailbox or by clicking the Plus (+) button at the bottom-left corner of the Mail window and choosing New Mailbox from the menu that appears. In the New Mailbox sheet that comes up, select On My Mac from the Location menu, type in a name such as
iTunes, and click OK.
Go to Mail’s Preferences, click the Rules tab, and click the Add Rule button. In the resulting sheet, name the rule
Shift iTunes Mail and configure the If section to read If From Contains iTunes. In the ‘Perform the following actions’ area, create this action: Move Message to mailbox iTunes. Click OK and choose to apply the rule.
If you’re signed up for email alerts from the iTunes Store, you’ll find that your inbox no longer contains those alerts. Instead, they’ve all moved to the iTunes folder you created.
You can use a rule like this to do more than ferret out promotional email. For example, in the From field you might add your company’s domain—If From Contains macworld.com, in my case. I’d then create a new folder for these Macworld messages and have the rule move any messages that meet this condition to that folder. This setup provides me a way to quickly scan through messages from my colleagues.
Filtering groups of senders: There’s a measure of power in Mail’s relationship with the Contacts app. For example, you can ask Mail to filter messages by who is and isn’t in a particular group you’ve created in Contacts.
For instance, suppose you’ve created a group that includes the members of your Keggling Club team. You may wish for mail from any of these members to be marked or moved so that you can find it more easily. Simply create a rule like this:
If Sender is member of Group Keggling Club, Move Message to mailbox Kegglers.