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

A possible fix for a slow Mail.app Apps
If Mail.app is running slowly for you (time for searches, time for loading Smart Mailboxes, time between clicking on a mailbox and having its index displayed), you may have ghost messages from old accounts in your message index. I worked a summer internship at the National Institutes of Health (NIH), and connected to their Exchange servers with Mail.app during that time. Mail was running slowly, but I didn't really notice so much; it quickly became a way of life. After leaving NIH, I deleted the Exchange server from my accounts, and Mail continued to run slowly. Just recently, I created a Smart Mailbox to search for all unread messages. It returned a huge number of messages that had been on shared folders on the NIH Exchange server. It urns out that deleting that account hadn't done much for the index of messages stored in a file named Envelope Index, which you'll find in your user's Library/Mail folder.

That file was about 200 MB. I thought "what the heck," closed Mail, moved that file to myDesktop, and restarted Mail. Mail then went through its "importing messages" routine (re-creating that file). After it finished, I found that the file is now down to about 2MB, Mail.app runs like a breeze, and all of my messages are intact. If you have problems with Mail.app's performance and you've been adding/deleting accounts, it might be worth the couple of minutes to re-generate that index.

[robg adds: I tested this on my 25.9MB index file. After reimporting, the index dropped to 4.5MB. About the only downside I had was that my 'all unread messages' Smart Mailbox then showed 600+ unread messages, all of them old. I simply marked them all read, and everything was back to normal. I did, however, make a fresh backup of the entire Mail folder prior to trying this, just in case something went wrong.]
    •    
  • Currently 2.67 / 5
  You rated: 3 / 5 (6 votes cast)
 
[71,056 views]  

A possible fix for a slow Mail.app | 23 comments | Create New Account
Click here to return to the 'A possible fix for a slow Mail.app' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A possible fix for a slow Mail.app
Authored by: peragrin on Feb 06, '06 09:24:57AM

I have to check myself, but doesn't mail.app have a compact mailbox option?

It's a trick of modern mail applications that store data in a single file(one real file per folder). They don't delete messages well in the middle of the file. They get marked for deletion but actually aren't until you force them to.

either way I when I get home I will check my gmail folder and see what that can do.

---
I thought once I was found but it was only a dream



[ Reply to This | # ]
A possible fix for a slow Mail.app
Authored by: MtnBiker on Feb 06, '06 09:47:03AM

How does compare to what Mail > Mailbox > Rebuild does?

And Rob did you notice a speed up?

---
Hermosa Beach, CA USA



[ Reply to This | # ]
A possible fix for a slow Mail.app
Authored by: AlexCh on Feb 06, '06 10:09:22AM
This didn't work for me.

I got an increase in unread messages, but when I clicked on read messages that I already had locally, I'd get a message like, "You need to take this account online to read this message."

Luckily I made a backup of /Library/Mail.

[ Reply to This | # ]

A possible fix for a slow Mail.app
Authored by: dille on Feb 06, '06 10:57:53AM

Maybe it's me and my preference for IMAP servers, but I don't see this Envelope thingy file. Tiger, fully updated.

Then again, Mail isn't exactly slow either, so I'm not complaining =]



[ Reply to This | # ]
A possible fix for a slow Mail.app
Authored by: PancakeMan on Feb 06, '06 11:17:43AM

Great tip for me. Worked as indicated. My Envelope Index is now smaller and I don't get bizarre half-downloaded junk showing up in my searches.

When restarting Mail, I got a Welcome to Mail screen that asked to import my mail. When it was complete, everything was fixed. (I didn't even have to mark any mail as read, as robg described.)

Thanks again!



[ Reply to This | # ]
A possible fix for a slow Mail.app
Authored by: PancakeMan on Feb 06, '06 11:19:32AM

Oh, and I forgot to mention: before I did the hint's instructions, I tried Mailbox -> Rebuild. It did NOT remove those unwanted half-messages.



[ Reply to This | # ]
A possible fix for a slow Mail.app
Authored by: djfreak on Feb 06, '06 12:50:42PM

THis is a great tip. Improved my osx mail performance tremendously. I had been migrating that same bloated envelope index for years. Mine went from 16 Megs to 4 Megs and Mail feels much better.

---
The internet radio revolution is now.

www.beathustler.com/radio



[ Reply to This | # ]
A possible fix for a slow Mail.app
Authored by: swilcox on Feb 06, '06 01:47:32PM

Tried this. I too use mostly IMAP accounts. I notice no difference in speed. The old Envelope index was ~12.5 MB. The new one is 10.5 MB, no appreciable disk savings either.



[ Reply to This | # ]
A possible fix for a slow Mail.app
Authored by: dturley on Feb 06, '06 02:38:57PM

I have a mix of IMAP and POP. My Envelope file was 45M. After importing 93,996 messages, it was reduced just a bit to 38M. But opening mailboxes seems significantly quicker. Searches are faster too. It was previously taking several minutes to search the subjects of a mailbox with less than 50 messages. This is now very much improved. I'd tried rebuilding the mailboxes without improvement.



[ Reply to This | # ]
May also help when having problems with smart mailboxes
Authored by: moritzh on Feb 06, '06 04:29:33PM
Deleting the Envelope Index file may also help if your smart mailboxes are showing incorrect read/flagged counts etc., as mentioned in another hint.

[ Reply to This | # ]
A possible fix for a slow Mail.app
Authored by: kholburn on Feb 06, '06 05:26:41PM

I had a look hmmm... my envelope Index file was 66Meg, OK I'll try it.

I have an IMAP account. I quit Mail, move the Envelope Index file to my Desktop, start Mail. Mail says I'll have to rebuild the index for 150000 emails this will take 1 hour and 33 minutes. Phew, luckily it didn't quite take that long.

Then when it finally opens Mail has forgotten which folders are Junk, Trash, Sent and Drafts. I tell it.

Some of my messages have the mailbox "***orphanned mailbox***. That's different.

Mail goes into a loop and has to be killed.

New Envelope Index is now 60MB not much of an improvement really.



[ Reply to This | # ]
A possible fix for a slow Mail.app
Authored by: kirkmc on Feb 07, '06 01:22:29AM

In Mail, select a mailbox, then Mailbox > Rebuild. For POP accounts, this deletes a whole bunch of mail files that hang out on your disk, even after deletion. I don't use IMAP, so I don't know what effect it has on such accounts...

What I want to know is why Mail keeps files after you've deleted messages? The first time I discovered this, there were thousands of files in my mailboxes. I deleted them manually, but later found that rebuilding does the same thing.

I don't see why you should have to rebuild a mailbox to delete deleted messages...

---
Read my blog: Kirkville -- http://www.mcelhearn.com
Musings, Opinion and Miscellanea, on Macs, iPods and more



[ Reply to This | # ]
A possible fix for a slow Mail.app
Authored by: Raven on Feb 07, '06 07:34:32AM

One thing to note though for the original Hint poster... He was connecting to Exchange which is a very important clue... The Public Folders section of Exchange servers can be massive and they automatically will Synch and downlaod to your Computer in Mail... Here on an Exchange server some one with a new mail box (Enveloppe Index is not an issue and doesn't fix anything, no more than a rebuild does since its a new account with no mail and a new config aon a new Mac) can experience massive slow downs simply because of Public Folder synch and storage on the computer. What the deletion of the Exchange server config did was to remove the reference to the folders in ~/Library/Mail. It doesn't remove the content. So when Mail checks the fodlers and content when loading it still keeps checking all those folders since their in its INdex and Mail folder. So... in his case it was a great improvement since deleting the index meant that it wasn't checking all of his old Exchange "ghost" folders including public folders and they were not in the index anymore.
That swhy he got such speed improvements.
As for Exchange there is a trick to not have the public folders checked in Mail, but thats another story...



[ Reply to This | # ]
A possible fix for a slow Mail.app
Authored by: Raven on Feb 07, '06 07:39:32AM

Oh .. forgot to add what the rebuild does for IMAP accounts.
What it does is clean all the cached folders and emails and then allows you to download a fresh copy off the server. So any lingering deleted emails (again, only the reference to the email is removed, not the mail its self or the space it takes up) are cleaned up since the folders in which they resides are gone from mail's cache and memory. Thats why alot of times if you use your IMAP account alot after a while it gets to be quite slow... It simply has accumulated crap over time.



[ Reply to This | # ]
A possible fix for a slow Mail.app
Authored by: cjwood on Jan 16, '07 01:53:18PM

What is the "Rest of the Story" to "As for Exchange there is a trick to not have the public folders checked in Mail, but that's another story..."?

I need to disable the synchronization of public folders.



[ Reply to This | # ]
A possible fix for a slow Mail.app
Authored by: zarqman on Mar 08, '07 06:08:30PM

there are two ways to make mail.app skip the public folders on exchange.

1) if you have access to manage exchange, public folders can be turned off entirely for imap. of course, this is for all users, all public folders, so it may not be acceptable in some instances.

2) this one's slightly fuzzy as i'm not in front of my work machine at the moment, so forgive me if i'm slightly off. you can configure the imap path prefix (advanced tab under accounts) with your exchange account name. for us at work this is "lastname, firstname" but that will vary by organization.

both of these have been tested successfully on exchange 2003.



[ Reply to This | # ]
Two edged sword
Authored by: gullevek on Feb 07, '06 02:37:56PM

I have three IMAP accounts and tons of mail local as space saver from the IMAP accounts.

My Envelope file was 250MB. After initial indes its 45MB, then Mail.App went through all the IMAP accounts and now it is 103MB.

Before I did this, my bigges mail accounts (IMAP) was 100% synced down, now I only do that with my small private one.

I am not sure if it feels faster though...



[ Reply to This | # ]
A possible fix for a slow Mail.app
Authored by: yj on Feb 07, '06 04:32:02PM

I tried this, and it might have worked (I can't tell). One thing I noticed, though, was that it sent out a couple of "lost" emails that were apparently hiding in my Outbox... so I got a couple of confused replies about emails I thought I'd sent last year.



[ Reply to This | # ]
A possible fix for a slow Mail.app
Authored by: Ministry on Jun 11, '06 04:05:23AM

I did the whole thing and made no difference what's so ever. I have IMAP accounts and now all the attachments wanted to cache on my local disk.
It says that it has 441 Attachments and after done all (progress bar AND numbers are saying that it cached all) it wil stop and 'hang' delaying all other processes.

Anyone a suggestion?

---
--
PHP programmer (Ministry of Web Development)



[ Reply to This | # ]
A possible fix for a slow Mail.app
Authored by: pvera on Aug 02, '08 07:00:06AM

Works on Leopard. The envelope file went from 13MB to 10 MB, which is not much, but in terms of usability it went from excruciatingly slow to damn zippy. I have about 26000 emails, only POP accounts.

---
Pedro
-
http://www.pedrovera.com
http://insomniaccoder.com



[ Reply to This | # ]
A possible fix for a slow Mail.app
Authored by: brunus on Feb 06, '09 12:31:28PM

Hi guys,
when I try to rebuild the index, mail crashes at the very same message at each time. I even tried to move the mailbox in which the corrupted? message is, and then import it, but no luck.
Any idea how I could identify the offending message?

thanks,

brunus



[ Reply to This | # ]
A possible fix for a slow Mail.app
Authored by: mgrace on Apr 03, '10 08:08:49AM

This didn't help me.
I tried the sqlite3 command; removing and rebuilding the envelope index file; no help at all.
Just the spinning beach ball of death for long periods of time.
Any other ideas?
Thanks in advance



[ Reply to This | # ]
A possible fix for a slow Mail.app
Authored by: phlops on Nov 21, '11 10:31:52AM
The location of the Mail indexes have moved in 10.7. You still quit Mail, delete the index files, and then relaunch Mail to have it regenerate them. But the files to delete are in a new spot.

The new location is:

~/Library/Mail/V2/MailData/

And now instead of just one file called “Envelope Index”, there are at least three files. The new ones are named “Envelope Index” suffixed with a dash and three letters.

So to rebuild in 10.7 you do this:
  1. Quit Mail
  2. rm ~/Library/Mail/V2/MailData/Envelope\ Index*
  3. Relaunch Mail
  4. Allow Mail to rebuild your email indexes
---
/phil


[ Reply to This | # ]