Slow Mail application (continued)

Posted by Pierre Igot in: Mail
July 2nd, 2009 • 10:27 am

When I wrote about the new problems I was experiencing with Mac OS X’s Mail a few days ago, several readers chimed in to suggest that I try trashing the “Envelope Index” file in the “Mail” folder and force Mail to rebuild it.

Long-time readers of this blog might remember that I am in fact quite familiar with this procedure, in particular because I was part of the AppleSeed program for the testing of prerelease builds of Mac OS X 10.4 (those were the days) and that I had to do a fair amount of troubleshooting in Mail during those early days of the Spotlight architecture.

So why didn’t I mention the procedure in my post about my recent troubles in Mail?

Well, in a nutshell, the answer is that I could not get it to work, and I was going to try and do more investigating before mentioning it again.

Quitting Mail, trashing the “Envelope Index” file in the “Mail” folder (in the home folder’s library) and relaunching Mail triggers a behaviour where Mail attempts to repeat the procedure that it first used when the user upgraded his system from Mac OS X 10.3 to Mac OS X 10.4, and thus from Mail 1.x to Mail 2.0.

That transition to the new Mail 2.0 required a complete conversion of all existing mailboxes to the new granular file system used in Mail since version 2.0, i.e. a system where each message is saved as a separate file, in order to be compatible with the Spotlight architecture.

When a user first launches Mail 2.0 (or a subsequent version) on a system where the “Mail” folder in his home library is still in the Mail 1.x format, Mail 2.0 gleefully announces that all the existing mailboxes have to be “imported” in order to work with its new file architecture. The user has no choice but to approve the procedure and sit back and watch while Mail 2.0 attempts to convert all existing mailboxes to the new file format.

The reason that I am mentioning all this is that trashing the “Envelope Index” file in an existing “Mail” folder that already uses the new file format triggers the same kind of behaviour. The next time you launch Mail, it tells you that it “needs to import your messages” and gives you no choice but to proceed or to quit the application:

Mail - Reimport messages

If you click on “Continue,” Mail starts reimporting your existing message files and folders, effectively rebuilding the “Envelope Index” file in the process.

It’s not exactly the most intuitive interface, but this a troubleshooting procedure, so I guess we have to take what we get.

My problem with this procedure on my machine right now is that it systematically fails. Mail starts importing my thousands and thousands of messages, and completes approximately one half of the importing, and then it suddenly, unexpectedly quits.

In other words, Mail never manages to complete the reimporting procedure, including the rebuilding of the “Envelope Index” file, and I am unable to use Mail at all—until I restore the “Envelope Index” file backup that I have kept elsewhere on my hard drive, just in case.

To make matters worse, even after I restore the “Envelope Index” file from a backup and am able to use Mail again, there are some new problems that I have to fix first. For example, this aborted troubleshooting procedure tends to cause Mail to forget all my e-mail account passwords, for whatever reason. So I have to reenter them manually one by one, and even then, sometimes it takes several attempts before Mail actually agrees to remember these passwords properly without asking me to reenter them each and every time it checks for new mail.

The aborted troubleshooting procedure also tends to cause all kinds of problems in my mailboxes themselves. They seem intact and I can see individual messages is them, but when I double-click on the messages to open them, Mail displays a window whose contents are totally empty. I then have to select the affected mailbox, and use the “Rebuild” command. After that, things work normally and I am able to read my messages again. But I have hundreds of mailboxes and I don’t fancy having to rebuild each and every one of them.

Finally, the aborted troubleshooting procedure also seems to cause all kinds of problems with Spotlight. When I try searches on the “Entire message” in Mail, typically I only get an incomplete list of results. There are many items that do contain the searched string that are simply not there in the list of results. This problem seems somewhat connected to the previous one, in that, after I rebuild the mailbox containing the items missing from the list of search results, and repeat the search, then they finally appear in the list of results.

All this is to say that, unfortunately, at this point in time, the troubleshooting procedure consisting of trashing the “Envelope Index” file is not working too well for me. In fact, it’s not working at all, so I don’t know whether it would help fix the sudden sluggishness in Mail.

The only other thing that I have tried is to use a third-party utility tool (OnyX for Leopard) to rebuild Mail’s Envelope Index. OnyX has an option just for this, and I have tried it. But I am not sure exactly what it did and what it repaired, because it did not take very long (only a fraction of the time it would take for Mail itself to rebuild it) and the “Envelope Index” file does not seem to have changed much. It is still the same size and still has an old creation date.

(I am also not sure whether what OnyX did had anything to do with the other problems that I experienced in Mail while attempting to troubleshoot my sluggishness problem, i.e. the blank window messages, the password issue, and the lack of Spotlight search results.)

So until I find a reliable way to rebuild the “Envelope Index” file, I am afraid I won’t be able to fully verify whether that is what it takes to fix Mail’s sudden sluggishness and get rid of these pesky “Loading…” messages. For now, I have no choice but to continue to use my (possibly corrupted) existing “Envelope Index” file and hope for the best…


Comments are closed.