Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > Search the long headers of emails in Mail?

Search the long headers of emails in Mail?
Thread Tools
xia
Fresh-Faced Recruit
Join Date: Nov 2008
Status: Offline
Reply With Quote
Sep 7, 2011, 08:43 AM
 
Is there a way to search a particular text (e.g., an IP address) from the long headers of all emails in a mail box inside Mail? I found that one could open one email at a time and showed the long headers; but not sure how to search the box for a match.

Thanks.
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Sep 7, 2011, 02:43 PM
 
Originally Posted by xia View Post
Is there a way to search a particular text (e.g., an IP address) from the long headers of all emails in a mail box inside Mail? I found that one could open one email at a time and showed the long headers; but not sure how to search the box for a match.

Thanks.

How about grepping through your offline cache at the file system level?
     
xia  (op)
Fresh-Faced Recruit
Join Date: Nov 2008
Status: Offline
Reply With Quote
Sep 7, 2011, 07:25 PM
 
There must be a way to search the long headers in all emails. They are just simple text. In fact, you can use a text editor to open each one in the Mail folder to look at them. But I just do not know how to search them one box at a time; not one email at a time.
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Sep 7, 2011, 09:04 PM
 
I just gave you a way, no?
     
Moderator
Join Date: Jun 2000
Location: We come from the land of the ice and snow...
Status: Offline
Reply With Quote
Sep 7, 2011, 09:40 PM
 
Perhaps you could explain it a bit more indepth?

Is grep an app, or do you need to do the command line thing in Terminal? Where do you find the cache?
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Sep 7, 2011, 09:47 PM
 
Sure!

Grep is a command line based search tool you can use in your Terminal. The cache for OS X Mail is in your home directory -> Library -> Mail. To search for some headers in all of your email accounts, try:

grep -r "text to search" ~/Library/Mail

if you want to search a specific email account you can add this to the end of that path. Spaces will need to be entered like this:

"~/Library/Mail/My\ account" (with quotes)
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
Sep 8, 2011, 06:38 AM
 
Or use the excellent Textwrangler, which includes grep, to do the same thing without the Terminal.
The low-end Mac Pro is the most overpriced Mac since the IIvx
     
xia  (op)
Fresh-Faced Recruit
Join Date: Nov 2008
Status: Offline
Reply With Quote
Sep 8, 2011, 07:19 AM
 
Thanks besson3c and all! grep works, although not very 'conveniently'. I guess that some hex/binary editors should also work.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 04:38 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2