2

I would like to search within an individual email message using OS X Mail version 5.3 or above (Lion, Mountain Lion). I would like this search to include the email header.

Using the menu item Edit > Find > Find… or Command-F via the keyboard I am able to search the entire message, exclusive of the header. I would like to search the header, also.

An example of how this would be used: An email message is sent to hundreds of recipients which you want to search to find a specific email address.

2 Answers 2

2

After months of assuming there was no solution to my inquiry, I stumbled on a way to search the entire contents of an individual OS X Mail Message, including headers.

First open the email message you want to search in it's own window. Before initiating your search, select the menu item View > Message > Raw Source or alternately Option-Command-U from the keyboard. This will bring forward a new menu with the entire plain-text content of your message, including extraneous information such as headers.

If you search this Raw Source version of your message using Command-F or Edit > Find > Find… from the menu, the search will include everything in the message, including the headers.

Note: Although I'm currently using OS X Mail version 6.5, I verified that this technique also works at least back to version 5.3.

2
  • An update for Mail Version 7.1 (1827) Mavericks 10.9.1: It is no longer possible to search the Raw Source window with Command-F or Edit>Find>Find… However, you can copy the entire window and paste it into a word processor or TextEdit where you can do a search of the entire message, including headers. Not sure why Apple took this capability out of the Raw Source window, but hopefully it will be fixed in future versions.
    – GrowlTiger
    Commented Jan 15, 2014 at 5:04
  • Well, it's now back with Yosemite and El Capitan (Mail versions 8 and 9). You can once again use the search function when viewing the Raw Source of an email message!
    – GrowlTiger
    Commented Jun 29, 2016 at 21:10
1

The search bar in Mountain Lion's mail allows you to do a very minimal amount of searching in the headers (for example, you can search on to:, but not cc: or reply-to:). As a result, I think that you're firmly in AppleScript territory to accomplish this task.

Depending on how specific your goal is, you might find some existing AppleScripts that already meet your needs. The archives of the AppleScript users mailing list is probably a good starting point, there are plenty of Apple Mail scripts there.

If this is really important to you, you might want to consider trying out Outlook:Mac. It has a significantly better AppleScript dictionary than Mail.app, and you might be able to meet your goal in that application better than in Mail.app.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .