Apple mail "Envelope Index" - Warning!? -
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read Advertise

LinkBack Thread Tools Display Modes
Old Dec 10th, 2009, 09:11 PM   #1
Honourable Citizen
krs's Avatar
Join Date: Mar 2005
Location: Ontario and Quebec
Posts: 9,103
Apple mail "Envelope Index" - Warning!?

I have set up a whole bunch of folders in my Apple mail where I keep emails I need to refer to later.
Today, I'm trying to drag some emails from my inbox to some of these specific folders, something I do pretty much every day and for some email I get the message that the cannot be moved to that folder I had set up.
The first set of email messages moved fine and then the next set wouldn't. No explanation in the message why - just that they couldn't be moved.

So I debated about rebuilding Apple mail which I have never done, googled a bit and came across this infgormation:
Apple's flagship email client had me banging my head against a wall again when I finally dug up this tip on rebuilding's 'Envelope Index' SQLite database at Hawk Wings (If you're wondering what that file is all about, check out Hawk Wing's "What's in your Mail folder?" post). Forcing to rebuild this file is as simple as quitting the app, browsing to your ~/Library/Mail/ folder and dragging out the file called 'Envelope Index' to your desktop (I'd recommend making a backup of your Mail support folder before attempting this. Don't say we didn't warn you). Start back up and it will give you a message about re-importing or re-indexing all of your messages (sorry, I forgot to screencap the message), and depending on how many you have it could take a couple minutes. I have over 13,000 emails and it didn't take my G4 PowerBook long at all.
Mail slowing you down? Rebuild its database

My mail wasn't slowing down but I thought maybe something was corrupt so rebuilding the envelope index sounded like a good idea.

Made a copy of my mail folder in the library, then followed the instructions - shut down mail, dragged the envelope index to the desktop, restarted mail and let the mail run through the import which took about six minutes.
There were apparently just over 30 000 messages all told.
When done, the envelope index size had shrunk from just over 25Meg to just over 12 Meg - mail seemed a bit more snappy - all fine and good so far, just what I expected until I looked at the number of messages in my inbox.
There were only about 300 left, before this exercise I had several thousand.
When I checked closer, I found that all messages in my inbox earlier than the 28th of November had disappeared!

Anyone have a clue what happened?
This doesn't seem to be such a hot tip (which is basically why I posted it here)
I moved the existing mail folder out of the library folder onto the desktop and replaced it with the backup I had made just before I started this exercise.
All the messages are back now, so that's good, but I'm still curious to try to understand what happened.

PS: I checked the size of the mail folders, it's 1.76 GB originally and 1.75 GB after the envelope index rebuild. Seems to me the messages are still there but after the rebuild most of the inbox can no longer be accessed.
krs is offline   Reply With Quote
Sponsored Links
Old Dec 10th, 2009, 10:31 PM   #2
Indigent Academic
rgray's Avatar
Join Date: Feb 2005
Location: the Gulag of E ON
Posts: 8,113
I am interested in your result because I have done the Envelope Index thing many, many times on my own machines and on client machines without the slightest hitch. The process is useful for much more than 'speeding up Mail'. See my blog post here: maintenance. There are three methods of doing the procedure.

In your position, I would try running one of them again (with the same sort of backup you already have done.

Personally, I don't keep a lot of email around - never more than about 1000 altogether and have often wondered about why people keep all that stuff around. However, some of my clients keep huge amounts of email and it is an abiding nightmare of mine having to resurrect a failure in one of their systems - which is why I frequently use this technique... Now you have given me pause....
"not all those who wander are lost….." j.r.r. tolkien
rgray is offline   Reply With Quote
Old Dec 11th, 2009, 01:15 AM   #3
Honourable Citizen
krs's Avatar
Join Date: Mar 2005
Location: Ontario and Quebec
Posts: 9,103
I was going to try this again tonight but I already noticed one thing that may shed some light on this issue.

When I copy my mail folder (just the mail folder, not the mail downloads folder) to the desktop, it copies about 34400 items but when mail then "imported" after restarting mail, it only "imported about 30900 messages.
That roughly equates to the number of messages missing in the inbox.
I currently have 5215 messages in the inbox, when I did this procedure earlier I ended up with less than 400 messages in my inbox.
I'm going to do a complete clone over night to a new 1.5 TB hard drive I just installed so that I have a complete backup and then try this envelope index exercise again tomorrow.
krs is offline   Reply With Quote
Old Dec 11th, 2009, 10:53 AM   #4
Honourable Citizen
krs's Avatar
Join Date: Mar 2005
Location: Ontario and Quebec
Posts: 9,103
Diud a Mailbox>Rebuild this morning (not the envelope index thing) and ended up exactly in the same spot as with the envelope index procedure.
All inbox messages earlier than Nov 28, 2009 gone.

Then tried the rebuild on mt draft mailbox which has 242 messages in it - after rebuild there is one message left.

28 Nov 09 is the date I ran the last clone before I went on my recent trip although the mailbox I'm rebuilding is the one I cloned FROM not the clone.
And the one message left in my draft box is the only message I modified since cloning on Nov 28th.

So it may have something to do with that - just a guess.
krs is offline   Reply With Quote
Old Dec 12th, 2009, 11:26 AM   #5
Honourable Citizen
krs's Avatar
Join Date: Mar 2005
Location: Ontario and Quebec
Posts: 9,103
After more testing, investigation and rebuilding as described in other posts, I now believe the envelope index rebuilding as described in my first post in this thread is OK.
The isssue I had was that the messages didn't exist (got somehow deleted during cloning - probably by using the wrong cloning options) and the envelope index rebuilding would of course rebuild based on the messages that were in the mail inbox.

Based on the results of my investigation, it seems that following the original instructions to rebuild the envelope index are fine, but that does nothing more than using the existing Mailbox>Rebuild command in mail itself.
krs is offline   Reply With Quote
Old Dec 13th, 2009, 08:57 AM   #6
Assured Advertiser
Honourable Citizen
MacDoc's Avatar
Join Date: Nov 2001
Location: Planet Earth.....on FASTER boil :-(
Posts: 30,834
I rebuild regularly but keep my mailboxes below 5k messages each - about 2 months worth.
It is also part of Onyx and I check that box as part of regular maintenance but it's alway wise to clone before doing maintenance.

In Australia and the web site is out of date.
Lots of good deals on Retinas, previous high end MacPros and current MacPro 6 core bundles in stock. [email protected]
MacDoc is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Heads up Mail search/Spotlight mail search problem MacDoc Anything Mac 21 Apr 17th, 2008 11:38 AM

All times are GMT -4. The time now is 02:59 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
vBulletin Security provided by vBSecurity v2.2.2 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Copyright © 1999 - 2012, All rights reserved. ehMac is not affiliated with Apple Inc. Mac, iPod, iTunes, iPhone, Apple TV are trademarks of Apple Inc. Content Relevant URLs by vBSEO 3.6.0 RC 2 Urban living in Toronto!