Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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.

share|improve this answer
    
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 Jan 15 at 5:04
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.