10.5: Create Spotlight-searchable Mail archives

Feb 11, '08 07:30:00AM

Contributed by: Anonymous

In Tiger, it was a pretty easy thing (albeit not well documented) to make archived/backup copies of your email messages in Mail.app. Doing so simply required you to drag the desired email folder to the Finder, which created an mbox archive, which in turn contained all the mail messages. The beauty of this was that you could then safely delete the mail messages from Mail.app, and still have a way to restore them back to the app (File » Import » Mail for Mac OS X), as well as have a Spotlight-searchable way of finding any desired email.

This all changed with Leopard. Leopard made its email archiving a documented feature by being able to archive your mail by using a secondary click on any folder and picking Archive Mail from the pop-up (or from the Mailbox menu). On first blush, it certainly looked the same as the 10.4 solution -- an mbox file was created wherever you wanted, but upon closer inspection, the similarities ended. The new Leopard mboxes contained two files: a table of contents file, and an mbox file. These two files are simply text files with your email messages encoded in them. In the case of the new mbox file, the file could be rather huge depending on how much email you were archiving. Tiger, on the other hand, created an mbox folder with an info.plist file, and a messages folder containing emlx files. The end result? Tiger's archives are Spotlight-searchable, while Leopard's are not.

So how do you make a Leopard-compatible Mail archive without re-hydrating the archive every time you want to search for an archived Mail item via Spotlight?

The answer lies in your user's Library folder. Leopard's Mail.app still keeps track of its mail the Tiger way (with a plist and emlx files in a folder). So navigate to your user's Library/Mail folder, and then choose whichever folder you want to archive, copy it, and put the copy somewhere else. Now you are free to delete the messages in Mail, and you can still restore all the messages as before, but now, the restorable copy is also Spotlight-searchable.

Comments (2)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20080204084457302