Find Your Messages

macOS’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.

You can search using natural language rather than relying on special keywords or formulations. However, if you want to do complex searches, you can. 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 Natural Language Search

Here’s a novel idea: when you’re searching for email, just describe what you’re looking for in your own words. You can use plain English (or plain whatever-language-you-speak) in Mail’s Search field, as well as in system-wide Spotlight searches, to find email messages.

There’s no rulebook, no list of approved words or phrases. You just describe what you want. Here are some examples:

  • emails from John Smith

  • messages to John Smith

  • messages with “split pea” in the subject

  • email with “split pea” in the body

  • email from John Smith in the last week

  • mail from Morgen including photographs

  • mail I ignored from Adam

  • unread messages from this week

  • messages from bruce about security

There are countless other ways to search using natural language, but the point is: don’t try to outthink Spotlight. Just ask the question that you’re thinking.

Having said that, I should point out a few things I’ve noticed about natural-language searches in macOS Mail:

  • Results aren’t always exhaustive. For example, if I ask for unread messages, Mail shows me only recent unread messages. You should not assume that because a message doesn’t show up in a natural-language search, it doesn’t exist.

  • Mail doesn’t care about your wording. Notice how, in the examples above, I interchangeably used email, emails, mail, and messages. Mail knows those all mean the same thing. So, don’t get hung up on picking exactly the right term.

  • Mail is smart, but it can’t read your mind. If you search for messages from “Bob,” you may have a particular person in mind, but Mail doesn’t know which of the many Bobs in your saved mail you’re interested in. Be more specific if the results aren’t what you want.

  • Searches may take a while. Although Mail starts returning search results immediately, it continues to search until it’s gone through all your mail; sometimes that can take a while. So if you don’t see the messages you’re looking for right away, give it a few seconds (or more).

If a natural-language search doesn’t turn up what you’re looking for, you can always fall back to the old-fashioned way. For starters, you can perform a conventional search (discussed next); for even greater power, you can Search for a Phrase, Use Boolean Expressions, or Search by Date Range. And, even in a natural-language search, you can use the techniques discussed later in this chapter to narrow the search field.

Perform a Conventional Search

To find a message in the conventional way (without any pretenses of natural language), 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 ⌘-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.

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 22).

Figure 22: 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 nothing (as shown here), Mail searches message contents for whatever is in the Search field.
Figure 22: 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 nothing (as shown here), Mail searches message contents for whatever is in the Search field.

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.

If you ignore the list of suggestions, Mail simply searches entire messages (including headers and metadata) for the text you entered.

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 23). 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 23: 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 23: 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.

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

Figure 24: Different tokens offer different choices of context.
Figure 24: Different tokens offer different choices of context.

Over the past few years, Mail has gotten smarter about how to make tokens. For instance: “yesterday” makes a date token, but in the El Capitan version of Mail, “three days ago” didn’t. Now it does! (You can also make tokens by typing “the day before yesterday,” “2 weeks ago,” “May 2017,” and so on—as well as names, email addresses, and subject words.) Even so, you can’t force Mail to make a search token; you can only take what it offers, and if it doesn’t recognize the word or phrase you type as something it can make into a token, you’ll have to try something else.

As a shortcut to creating search tokens, you can type the keyword from, to, or subject followed by a colon and a search term. For example, you could type from:[email protected] and press Return to make an instant search token for messages from Adam Engst, without having to choose something from the menu. But in contrast to using the terms Mail suggests in its menu, this approach isn’t guaranteed to produce tokens that match any messages.

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 25). Just remember that whatever you enter in the Search field, Mail searches for messages containing all those terms.

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

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 26) to provide controls for restricting or expanding the range of the search (for example, just one mailbox or all mailboxes).

Figure 26: The Favorites bar lets you narrow (or expand) the scope of the search.
Figure 26: 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.

  • 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.

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.

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 plus sign (+) as a shortcut for AND, or 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.”

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/15/16-12/31/16. (Don’t expect tokens to appear, however—those happen only for common units such as a whole month.) You can also 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.” (Notice the + symbol; in this context, you’ll need either that or the word AND. When a search includes both a date range and text, Mail for some reason acts as though there’s an OR between the two.)

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 (⌘-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.

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, including 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 27) appears showing your search criteria in a more structured form that you can further edit.

    Figure 27: The easiest way to create a smart mailbox is to save a search, and then modify the search criteria (if you like) here.
    Figure 27: The easiest way to create a smart mailbox is to save a search, and then modify the search criteria (if you like) 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 specific people: First, create a new Contacts group with all the names you want to include. Then, in Mail, create a smart mailbox. Choose Any from the pop-up menu at the top. Add the condition [Sender Is a Member of Group] [some-Address-Book-group] (to catch all mail from people in the group). Then add [Any Recipient] conditions for each person in the group individually (to catch all mail to people in the group).

    Make sure you select “Include messages from Sent” to pick up your messages to these people. For even better results, choose View > Organize by Conversation to display your exchanges in threaded conversations.

  • 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 without using Mail Drop (or where the size of the attachments is too small to trigger Mail Drop), 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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset