Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: A simple Finder search to show all Mail messages Desktop
As noted here in previous hints, you can't find Mail messages in a normal Finder search -- you either have to search in Mail, or use the Spotlight window. However, I wanted to run a search in the Finder, so I could easily see the size of all my saved Mail messages, regardless of which folder they lived in.

The answer is simple, and is alluded to in the previous hints (which show how to modify some files to make Mail messages always show up). However, I though it worth posting directly, in case someone is looking for a simpler solution that doesn't require modifying files.

In the Finder, navigate to your user's Library » Mail folder then press Command-F. Make sure the Folder "Mail" button is highlighted in the search bar, and then click the Kind pop-up menu. Select Other, and then scroll down the monstrous list that appears and find Raw Query. For the query string, enter kMDItemContentType = "", and that's it. If you want to save the query for future use, click the Save button.

Once the query has run, you can press Command-A then Command-I to open the Get Info window and view the size of all the messages. I'm sure there are other ways to do this, but it was the easiest one I could come up with that accounted for all the various subfolders. You can easily build a Smart Mailbox in Mail to show all your stored email (I use Date Received - is after the date - 01/01/93), but I don't see any way to then display the total size of all the collected messages.
  • Currently 2.50 / 5
  You rated: 2 / 5 (6 votes cast)

10.4: A simple Finder search to show all Mail messages | 4 comments | Create New Account
Click here to return to the '10.4: A simple Finder search to show all Mail messages' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: A simple Finder search to show all Mail messages
Authored by: tj2001 on Jul 26, '07 08:45:21AM

As I attempted this, my super long list of choices didn't include "Raw Query"??
Any ideas as to why not or possibly how to add it?

Thank you.

--- ---
:: Super Me I Am ::

[ Reply to This | # ]
10.4: A simple Finder search to show all Mail messages
Authored by: jksellors on Jul 26, '07 09:15:17AM

Make sure that the 'Other' you select is in the first pull-down menu—i.e. change the Kind to Raw Query—

That should have the Raw Query not the second first pull-down menu—i.e. Kind/Other.

[ Reply to This | # ]
10.4: A simple Finder search to show all Mail messages
Authored by: Echidna on Jul 26, '07 08:50:08AM

Alternatively, you could simply select Get Info for the ~/Library/Mail folder. It will calculate the size of all the included items. Sure, it will also include the database that Mail uses to quickly display and find messages as well as a few other small maintenance items... but isn't that more accurate anyways?

[ Reply to This | # ]
Not complete!
Authored by: MattHaffner on Jul 26, '07 01:02:07PM

This hint unfortunately doesn't include some attachments for me, which may be the bulk of the size contribution to your Mail directories. Apple Mail seems to split some (larger?) attachments into files with .emlxpart extentions. mdimport doesn't seem to attach a content type to these, so you can't find them with this method. I didn't do a lot of testing, but it may only do this for large attachments or ones that are viewed inline.

Using the finder, the best idea is the one suggested above, using get info on the folder and letting it calculate the size for you. You can do this on any of your account sub-folders by drilling down a little into the Mail folder.

Using Terminal, I like to get a breakdown of the size of each of my subfolders once in a while. As an example:

$ cd ~/Library/Mail/IMAP-haffner@xyz/mail
$ du -shc *
 50M    Drafts.imapmbox
7.8M    Junk.imapmbox
751M    Sent.imapmbox
8.0K    Templates.imapmbox
 60M    Trash.imapmbox
.... (etc.)

The du stands for "disk usage". With out the -s (summary) switch, you'll get the size of every file below the current directory (probably not what you want for this purpose). -h gives the output in more "human-readable" forms using k, M, and G for sizes (instead of bytes). Without -h, it gives the number in unix block units (512 bytes). You can use -k instead of -h to get a numeric (only) output per file in kilobytes. Finally -c gives a grand total at the end.

[ Reply to This | # ]