Find Your Messages - Take Control of Apple Mail (1.0) (2014)

Take Control of Apple Mail (1.0) (2014)

Find Your Messages

OS X’s Spotlight search feature automatically indexes all your Mail messages for super-fast searching, and you can search for them either within Mail or using the system-wide Spotlight menu.

But Mail isn’t limited to simple text searches. With a flexible system of search tokens (which I explain in a moment), Boolean searches, and other options, you can find almost any message you can describe.

And, you can even save a search by converting it into a smart mailbox, as I describe at the end of this chapter in Work Smarter with Smart Mailboxes.

Perform a Basic Search

To find an email message, begin by (optionally) selecting one or more mailboxes in the sidebar in which you want to search. Then start typing in the Search field in Mail’s toolbar. (To jump right to the Search field, press Command-Option-F.) Mail begins displaying results in the message list immediately—sometimes even before you finish typing.

To hide the results and return to the message list, click the X icon in the Search box.

Note: Searches in Mail are insensitive to case and encompass accented characters. For example, searching for ipad will match iPad, and searching for creme brulee will match Crème Brûlée.

Use Suggestions and Tokens

As you type your search term, the Search field displays a drop-down list of suggestions—not of matching messages, but of text or other elements Mail thinks you might be looking for (Figure 11). If you see what you’re looking for in the list, you can save yourself a bit of typing by selecting it, either by clicking it or by pressing the arrow keys and then Return.

**Figure 11:** As you type a search term, suggested queries appear in a list. Use the Up or Down arrow key to select one and then press Return. If you select “Message contains” (as shown here), Mail searches message contents for whatever is in the Search field.

Figure 11: As you type a search term, suggested queries appear in a list. Use the Up or Down arrow key to select one and then press Return. If you select “Message contains” (as shown here), Mail searches message contents for whatever is in the Search field.

If you ignore the list of suggestions, or select the default choice at the top (“Message contains:”), Mail simply searches entire messages (including headers and metadata) for that literal text.

If Mail notices that whatever you’ve typed is part of a name, email address, date, subject, or other message header, it may display the corresponding full item in the list. Select one of those items (for example, a sender’s name) and Mail encapsulates it in a little gray bubble (Figure 12). That bubble is a search token—a unit that functions as a special, adjustable search term. Tokens are great because they make searching less error-prone and easier to manipulate.

**Figure 12:** Choose a person’s name from the “People” category of the suggestion list and a search token appears with that person’s name. Then click the tiny triangle to the left of the name to choose where to search for that name.

Figure 12: Choose a person’s name from the “People” category of the suggestion list and a search token appears with that person’s name. Then click the tiny triangle to the left of the name to choose where to search for that name.

When I say a token is “adjustable,” I mean you can change the context of where Mail searches for the term. For example, when searching for a person, you can narrow the search to messages from that person, to that person, or where the person’s name is mentioned anywhere in the message by clicking the little arrow on the left side of the token and choosing a context from the pop-up menu that appears.

Note: Mail knows who’s in your Contacts. So if you choose a person’s name and Mail turns it into a token, it actually searches for mail to or from any of the email addresses you may have for that person—even if you entered a different address as a search term!

Or, when the search token is a subject word (Figure 13), you can restrict the search to message subjects alone if you like.

**Figure 13:** Different tokens offer different choices of context.

Figure 13: Different tokens offer different choices of context.

You can’t force Mail to make a search token; you can only take what it offers. But names, email addresses, subject words, and certain date-like expressions (such as “yesterday” and “May 2012”) frequently produce tokens.

Tip: The suggestions in the Search field depend on where you’re searching. If you selected a single mailbox before starting your search, Mail offers suggestions based solely on the messages in that mailbox. If you search everywhere (more on this just ahead), you’re more likely to get a wider variety of tokens.

You’re not restricted to using just one token. You can add more tokens if you like, and you can also include additional text (Figure 14). Just remember that whatever you enter in the Search field, Mail searches for messages containing all those terms.

**Figure 14:** A search can include multiple tokens along with arbitrary text. Mail searches only for messages that match _all_ the search terms.

Figure 14: A search can include multiple tokens along with arbitrary text. Mail searches only for messages that match all the search terms.

Watch Out for Mail’s Search Logic

As you enter search terms, a match occurs only if the letters you entered are at the beginnings of words in the message or headers. (With “InterCapped” words like iTunes, Mail treats the uppercase letter as the beginning of a new word.) If you enter more than one string, it looks for messages that have words beginning with all the strings you entered—in any order. For example:

· If you enter car, Mail will match “car repair” or “carry a tune”—but not “Icarus,” “reduced scarring,” or “living vicariously.” (But, if you enter bits, Mail will also match “TidBITS” and “AgileBits,” since the “bits” parts of those names start with a capital letter.)

· If you enter in case, Mail will match “case in point” or “an iPad in its case”—but not “tiny briefcase” or “Casey’s new single.”

Also, be aware that even when you search entire messages, Mail ignores headers that are ordinarily invisible (such as Content-Type, Message-ID, and Return-Path).

Adjust Search Scope

Besides offering search suggestions, Mail makes another change to its interface as you begin typing a search term. The Favorites bar changes subtly (Figure 15) to provide controls for restricting or expanding the range of the search (for example, just one mailbox or all mailboxes).

**Figure 15:** The Favorites bar lets you narrow (or expand) the scope of the search.

Figure 15: The Favorites bar lets you narrow (or expand) the scope of the search.

The options you can select are as follows:

· All: Click here to search messages in all mailboxes (including Sent and Drafts) for the text you entered.

Note: When you select All, Mail can optionally include the Trash and Junk mailboxes and the contents of any encrypted messages you’ve received, if Trash, Junk, and Encrypted Messages, respectively, are checked under “When searching all mailboxes, include results from” in Mail > Preferences > General.

· Mailbox Name: If you had a single mailbox selected when you started searching, that mailbox’s name appears in the Favorites bar. Click it to restrict the search to that mailbox. You can also select the name of any mailbox or smart mailbox already on the Favorites bar.

· Selected Mailboxes: If you had more than one mailbox selected, click this to search all (and only) those mailboxes.

· Save: Click this button, which sits at the far right of the Favorites bar, to Create a Smart Mailbox.

Note: If you select All, Mail defaults to All the next time you search. If you search in a single mailbox, the next time you search, Mail defaults to searching whichever mailbox is selected at that time.

Search for a Phrase

To search for an exact sequence of words, such as “dark green shirt,” put quotation marks around the phrase, like so: "dark green shirt". Without the quotation marks, Mail matches messages containing all three of those words, anywhere in the message—for example, “Mr. Green put on his red shirt after dark” would match.

If Searches Aren’t Working Right

If you are sure that a search should be finding items that it is not finding, consult Fix Searching Errors, near the end of this book, for advice on solving the problem.

Use Boolean Expressions

A Boolean search is one that uses the logical operators AND, OR, and NOT, along with optional parentheses, to help narrow the results in different ways (for example, messages containing either “Jack” or “Jill,” both “Jack” and “Jill,” or “Jack” but not “Jill”). Mail can perform Boolean searches—but only in message contents, not in headers (such as Subject, From, or Date).

When using Boolean operators, always use uppercase AND, OR, and NOT (so Mail doesn’t search for the word “and,” for example). You can use a minus sign (-) as a shortcut for AND NOT—so, if you type Jack -Jill in the Search field, you’ll see a list of all the messages that contain “Jack” but not “Jill.”

Tip: To learn more about Spotlight searching generally—including tokens and Boolean expressions—read Sharon Zardetto’s Take Control of Spotlight for Finding Anything on Your Mac.

Search by Date Range

To search for messages in a range of dates, enter the dates in the form of M/D/Y-M/D/Y—for example, 12/26/11-4/15/12. (Don’t expect tokens to appear, however—those happen only for common units such as a whole month.) You can, of course, combine dates with other text—for example, 3/1/2012-4/11/2012 backups finds messages dated between 3/1/2012 and 4/11/2012 containing the word “backups.”


For even greater searchability, try MailTags, a plug-in that adds Spotlight-searchable metadata to your email messages, such as comments, categories, and due dates—either manually or using a rule.

You can search that data using Spotlight or make it part of a smart mailbox. MailTags even stores this metadata on IMAP servers so that you can access the same metadata from multiple computers.

Search within the Current Message

If you want to find text within a selected message or conversation (as opposed to finding messages themselves), you can choose Edit > Find > Find (Command-F) to display an inline search field just above the message contents. As you type in this field, Mail instantly highlights all matching terms in the current message or conversation. You can use the arrow buttons to move from one match to the next; click Done to dismiss the search field.

To do a find and replace (which is possible only in messages you’re composing, not in incoming messages), check the Replace box next to the inline search field to display additional controls.

Work Smarter with Smart Mailboxes

Smart mailboxes appear in your sidebar along with the ordinary mailboxes. But they aren’t truly mailboxes, because they hold no data. A smart mailbox merely lists messages stored in other mailboxes that match its particular search criteria. You set up search conditions, and you get a dynamic folder that always displays the messages matching those conditions—regardless of the messages’ actual locations.

Create a Smart Mailbox

Mail provides two ways to create smart mailboxes—the easiest way is to save a search, as I describe here. However, you can start building a smart mailbox from scratch by choosing Mailbox > New Smart Mailbox, or clicking the plus button at the bottom of the sidebar and choosing New Smart Mailbox from the pop-up menu.

Follow these steps to set up a smart mailbox:

1. Enter search text in the Search field at the upper right of the Viewer window. Use any of the usual search criteria Mail supports except for Boolean operators; select where to look (one or more particular mailboxes or All; unfortunately, Smart Mailboxes don’t work with Selected Mailboxes selected in the Favorites bar) and which parts of the message to search (a certain header or Entire Message).

2. Click the Save button on the right side of the Search/Favorites bar.

A dialog (Figure 16) appears showing your search criteria in a more structured form that you can further edit.

**Figure 16:** The easiest way to create a smart mailbox is to save a search, and then modify the search criteria (if you wish) here.

Figure 16: The easiest way to create a smart mailbox is to save a search, and then modify the search criteria (if you wish) here.

3. Enter a name for the smart mailbox (or keep the name Mail fills in automatically).

4. To add a new condition, click the plus button to the right of an existing condition and then configure the new condition.

For example, you might fill in any of the following:

[From] [Contains] some-email-address

[Subject] [Begins with] Fwd:

[Date Received] [Is in the last] 2 [Days]

[Any Attachment Name] [Ends with] .exe

(To delete a condition, click the minus button next to it.)

5. If your smart mailbox has only one condition, skip this step. Otherwise, you must choose Any or All from the “that match” pop-up menu near the top of the dialog:

§ Any, like a Boolean OR, means that if any one of the conditions matches, the message appears. For example, to display any message from your mother or brother or sister in a Family smart mailbox, you should specify the appropriate three conditions (such as[From] [Contains] person’s address) and choose Any from the pop-up menu.

§ All, like a Boolean AND, works if you want messages to appear only if all your conditions are met. An example is displaying a message only if it is from your stockbroker and is unread and was received today.

6. Decide whether you want the smart mailbox to list messages found in your Trash or Sent folders, and select or deselect the relevant checkboxes.

7. Click OK.

Mail adds a new smart mailbox to your sidebar with the name and criteria you selected. If you click that mailbox icon, it should initially display exactly the same messages as your search. As you receive and delete messages that meet your criteria, the list will change.

Smart Mailbox Suggestions

Here are my favorite suggestions for making smart mailboxes:

· Show all correspondence with a specific person: Choose Any from the pop-up menu at the top. Add two conditions, [From] and [Any Recipient], both of which include the other person’s email address. (To show conversations with more than one person, create a new Contacts group with all the names you want to include, and instead of [From], choose [Sender Is a Member of Group] [some-Address-Book-group]. Then add [Any Recipient] conditions for each person in the group individually.)

Make sure you select Include Messages from Sent to pick up your messages to this person. For even better results, choose View > Organize by Conversation to display all your exchanges in a threaded conversation.

· Display recent unread messages: If you use rules to move messages into different mailboxes, you might enjoy seeing all your unread messages—wherever they may be—in a single place. If you like, limit these to messages received in the last day (or few days).

· Locate attachments in Sent mail: If you often send photos or other large attachments, their copies in your Sent mailbox can take up a lot of space, and you probably have the originals. Make a smart mailbox with two conditions: [Contains Attachments] and [Message is in Mailbox] [Sent]. From time to time, check this mailbox; to remove attachments from these messages, select them and choose Message > Remove Attachments.

· What to do if All and Any aren’t smart enough: If you use the [Message is in Mailbox] condition, the contents of one smart mailbox can depend on another smart mailbox. This is handy when you have so complex a set of conditions that Any and All are too limited. For example, you might have one smart mailbox that lists messages from any (“Any”) of several friends, and another that lists messages that are both in the first smart mailbox and (“All”) marked as high priority.

· Look for group members: Use the [Sender is a Member of Group] option to search for messages from people in one of your Contacts groups. And yes, you can even refer to smart groups, so that as your contacts’ information changes, the contents of the smart mailbox track the automatic changes in smart group contents.