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

10.4: Remove some extraneous Mail mailboxes Apps
Tiger only hintThis hint wasn't found by me; I'm just sharing the wealth. Here's the original (in Swedish).

If you imported your 10.3 mail into 10.4, you've probably got some extra files you can delete to recover drive space. Apple describes the process in this tech note; it notes which files can be safely deleted.

Here's a more automated way to delete the files. Open the Terminal and use the following commands (after making a backup; I zipped my mailboxes to another location first):
find . -path "*.imapmbox/Cached*" -exec rm -f '{}' ';'
find . -path "*.mbox/mbox" -exec rm -fr '{}' ';'
find . -path "*.*mbox/content_index" -exec rm -fr '{}' ';'
find . -path "*.mbox/table_of_contents" -exec rm -fr '{}' ';'
find . -path "*.mbox/Info.plist" -exec rm -rfv '{}' ';'
find . -path "*.mbox/mbox.SKindex" -exec rm -rfv '{}' ';'
When done, you are likely to regain a lot of space. My mailbox disk usage shrunk from 620 MBs to 270 MBs.

[robg adds: I haven't tested this one, but if you're going to do so, heed the backup advice. I also noticed that the above version removes cache files, which are not referenced in Apple's hint. This shouldn't cause any issues, since they'll just be recreated, but it may slow Mail down a bit as it recreates the cache files.]
    •    
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[18,969 views]  

10.4: Remove some extraneous Mail mailboxes | 14 comments | Create New Account
Click here to return to the '10.4: Remove some extraneous Mail mailboxes' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Remove some extraneous Mail mailboxes
Authored by: aptenergy on Jul 12, '05 11:03:09AM

If I'm not mistaken, this one is a duplicate hint:
http://www.macosxhints.com/article.php?story=200505121139410

It would be helpful to combine the two hints and make the title clearer - it had taken me a while to find the older hint.



[ Reply to This | # ]
10.4: Remove some extraneous Mail mailboxes
Authored by: kyngchaos on Jul 12, '05 11:52:12AM

I had discovered this on my own (I didn't know about the technote) and cleaned out most of this, but I had wondered about the Info.plist files. Nice to know I can get rid of those.

One thing that will speed this up - by default, a Terminal opens in your Home, then the 'find .' will search your WHOLE home folder. First, cd Library/Mail before running all the finds.



[ Reply to This | # ]
10.4: Remove some extraneous Mail mailboxes
Authored by: pbooker on Jul 12, '05 12:04:39PM

So I shouldn't be worried that when I start up Mail I get the beachball and can't do anything? :(

I understand what Rob said about it having to rebuild the cache so I'm hoping that's what's going on. I can see that all my mail/mailboxes are there when I start up Mail but it sits and spins and the OS lists Mail.app as not responding.



[ Reply to This | # ]
10.4: Remove some extraneous Mail mailboxes
Authored by: sparty3 on Jul 12, '05 12:12:15PM

I skipped the Cached* step (I've seen Mail.app spend quite enough time building those caches, and I'd just as soon not rebuild all of them), and I still got a reduction from about 890MB to 490MB (according to du -h) on my POP accounts and local mailboxes; my Exchange (IMAP) account showed no change and remains at 1.9GB.

So 400MB recovered is kinda nice, and Mail.app did restart without any obvious problems.



[ Reply to This | # ]
10.4: Remove some extraneous Mail mailboxes
Authored by: aamann on Jul 12, '05 12:40:39PM
The folder "CachedMessages" was used by Panther mail to store the local copies of the messages, in Tiger the folder is now called "Messages" (identical to the one used for POP mailboxes). It is thus safe to delete "*.imapmbox/Cached*" folders and Mail will not have to rebuild anything.

Tiger Mail only requires the following (POP or IMAP boxes are the same):
  • Info.plist in the (imap)mbox folder (you can delete this since this only stores sorting order and such)
  • a "Messages" folder with a bunch of *.emlx files (these are the actual messages, one file per message)
  • the SQlite3 database used by Spotlight which contains all the indexing information for all mailboxes (~/Library/Mail/EnvelopeIndex)
I also believe that the "original" hint has been posted on the Apple discussion site (which is in English so it might be easier for most people to understand).

[ Reply to This | # ]
10.4: Remove some extraneous Mail mailboxes
Authored by: earthsaver on Jul 12, '05 01:12:48PM
The hint is missing a command for one type of file, which is listed in the Apple note: mbox.SKindex.isValid. The appropriate command, following the examples, would be: find . -path "*.mbox/mbox.SKindex.isValid" -exec rm -rfv '{}' ';'

---
- Ben Rosenthal
Q16 1.25 - Tiger

[ Reply to This | # ]

10.4: Remove some extraneous Mail mailboxes
Authored by: locklin on Jul 12, '05 06:12:50PM

Cool, from 2.96GB to 1.56GB!



[ Reply to This | # ]
10.4: Remove some extraneous Mail mailboxes
Authored by: orca on Jul 12, '05 08:18:34PM
If you want the list of files at once, here's a one-liner:

cd ~ && find Library/Mail -path "*.imapmbox/Cached*" -or -path "*.mbox/mbox" -or -path "*.*mbox/content_index" -or -path "*.mbox/table_of_contents" -or -path "*.mbox/Info.plist" -or -path "*.mbox/mbox.SKindex" -or -path "*.mbox/mbox.SKindex.isValid"

This might make it easier to construct the required backups before removing the files. For example, save the above command's output to a file to easily create an archive. (It's annoying that command line tools are still so completely inept at handling filenames with spaces.)

[ Reply to This | # ]
10.4: Remove some extraneous Mail mailboxes
Authored by: croasmun on Jul 13, '05 09:48:57AM

Is this why I get 3 or 4 duplicate hits for all my mail messages when searching in Spotlight? If not, does anyone know why this might be happening (or at least how to get Spotlight to show the directory location for a mail message that it finds so that I could do some detective work)?



[ Reply to This | # ]
10.4: Remove some extraneous Mail mailboxes
Authored by: joshforman on Oct 15, '05 06:50:06PM

You can drag the result from the Spotlight results (the big window) to any plain-text window (TextEdit text-only, Terminal, etc.) to see the path.

I currently get dupes of mail messages in my spotlight searches because my hard drive has a backup copy of my home folder (incl Mail).

---
Josh Forman

http://www.joshforman.com/



[ Reply to This | # ]
10.4: Remove some extraneous Mail mailboxes
Authored by: LC on Jul 13, '05 02:09:46PM
How about wildcarding the directory locations, and using the -delete primary ...
find Library/Mail/*.*mbox ... -delete

[ Reply to This | # ]
10.4: Remove some extraneous Mail mailboxes
Authored by: canoeberry on Oct 14, '05 01:36:02PM

This works for me.



[ Reply to This | # ]
10.4: Remove some extraneous Mail mailboxes
Authored by: canoeberry on Oct 14, '05 01:38:48PM

I did NOT try the above, actually. I pressed the wrong reply button...



[ Reply to This | # ]
10.4: Remove some extraneous Mail mailboxes
Authored by: canoeberry on Oct 14, '05 01:37:21PM

This works for me. I freed up 1.5Gb of disk space and everything seems to work just fine.



[ Reply to This | # ]