The quickest and easiest way to fix this issue is by running the following command in Terminal:
NOTE: you will need to be an adminstrator.
1. Open Terminal (Applications > Utilities > terminal.app)
2. Type: sudo su
3. Enter your current accounts password (Must be an administrator!)
4. Copy and paste this command: sqlite3 ~/Library/Mail/V2/MailData/Envelope\ Index vacuum
5. Hit return
6. Type: exit
7. Hit return
8. Exit Terminal
9. Relaunch Apple Mail, and it should rebuild the database successfully.
Obviously, be very carefull that you type/copy everything into Terminal properly.
The above works on Lion and Mountain Lion.
Hope this helps!
This almost worked for me. What really did the trick was watching where the import stalled-out. It turns out that the problem wasn't the "Envelope..." files but that the "Sent" mailbox on my me.com account. It was too big, currupted, or something else that prevented it from being imported. The solution was to,
- Go > Go to Folder
- Type in "~/Library/Mail/V2/Mac-MyMail" (no quotes)
- Delete any mailbox with "Sent", of which there were two.
- Re-open Mail.
- Import, which worked this time.
- Resync my iCloud email account and take it online.
I hope this helps.
Hi Unggoy Murderer,
After I wrote to Apple Support at the bottown of this page on the right, you will see " Contact us " in blue. Click on this then you will see on the 2nd column on the 2nd paragraph, that is the link on which you write Apple Support.
You have to write directly to their support and someone will contact you in no time after you send your message.
I'm telling you this because, Michael gave me the procedure by phone... so my memory of it is long gone.
For a prompt reply, you give your name and phone number, you will see how efficient Apple Support is. For the best luck, should try on a working day, maybe on Saturday someone could contact you, but I wouldn't bet on it.
Of couse, we know how to do that. What I'm asking is, how did you actually solve the issue in the end? These forms are used not just for support, but also for reference. If someone in the future has the same issue, they can solve it folling your instructions.
Are you able to tell us what YOU did, to solve the issue on your computer?
Miraculously, the post below about Lion works for Mountain Lion as well.
This same thing happened today when migrating a friend's laptop.
Inside the Library folder (Lion hides this folder now, so hold down the option key and use the Go menu in the finder — Library will appear in the menu. Go there.) you'll find the Mail folder. Inside the mail folder was another folder called V2. I simply took the contents of V2 and dragged them to the parent folder (Mail).
When I launched mail again, everything was back to normal. As Apple says, "It's that simple!"