Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Mail- Quit or Quit and Rebuild Index

All three of my Macs, all fairly new are showing an error in mail, giving me the option to either Quit or Quit and Rebuild Index. I've tried both, nothing happens. Does anyone know what's happening?


Thanks in advance,


Tom

MacBook Pro 2, Mac OS X (10.6.6)

Posted on Feb 4, 2016 9:04 AM

Reply
15 replies

Feb 4, 2016 11:14 AM in response to TJ670

Please quit Mail. Force quit if necessary.

Back up all data before proceeding.

If you're running OS X 10.11 ("El Capitan") or later, triple-click anywhere in the line below on this page to select it:

~/Library/Mail/V3/MailData

If you're running an older version of OS X, use this line:

~/Library/Mail/V2/MailData

Copy the selected text to the Clipboard by pressing the key combination command-C. In the Finder, select

Go Go to Folder

from the menu bar. Paste into the box that opens by pressing command-V, then press return.

A folder window will open. Inside it there should be files with names as follows:

Envelope Index

ExternalUpdates.storedata

Move those files to the Desktop, leaving the window open. Other files in the folder may have longer names that begin as above. Move those files, if any, to the Trash.

Relaunch Mail. It should prompt you to re-import your messages. You may get a warning that the index is damaged and that Mail has to quit. Click OK. Typically, the process takes a few minutes, but it may take hours if you have gigantic mailboxes. In that case, you may be able to speed things up by temporarily adding your home folder to the Privacy list in the Spotlight preference pane. Remove it when Mail has finished importing.

If the import operation stalls or fails with an error message, quit Mail, delete the two new index files (keeping the original ones that you moved to the Desktop), and try again. According to many reports, the second attempt may succeed after the first one has failed.

Test. If Mail now works as expected, you can delete the files you moved to the Desktop. Otherwise, post your results.

Feb 6, 2016 10:04 PM in response to TJ670

This solution unfortunately didn't work. I tried twice on my iMac with no results and a lot of mail that won't restore because the mailbox stops for minutes before I get the same message again, quit or quit and rebuild index. This error is occurring on all three of my machines which makes me suspicious about the root cause. I'm open to other suggestions. I did not try it on the other machines as I'd like to get it resolved on the iMac first.


Tom

Feb 8, 2016 7:27 AM in response to TJ670

The new version of Mail stores its database in a different format than the old one, so the database has to be converted before Mail can use it. Sometimes the conversion fails because the old database is corrupt, or because of a bug in the conversion code.

What you should do depends on what kind of mail accounts you have. The first step, regardless of what else you do, is to back up all data, if you don't already have a current backup.

Please read this whole message before doing anything else. If any of it is unclear, ask for clarification before taking any of the steps. If you're not confident that you can follow the instructions, stop—don't change anything.

A. If you know that you have IMAP and/or Exchange mail accounts only

The easy way to recover is to discard the old database and start afresh. You can do that without losing any messages, provided that:

☞ All your incoming mail accounts are on an IMAP or Exchange server

☞ You store sent messages on the server

☞ You don't have any "On My Mac" mailboxes

Most well-known independent mail services such as iCloud and Gmail are based on IMAP. On the other hand, ISP-hosted mail services often use POP. If your ISP is one of your mail service providers (or the only one), you may not be able to use this procedure. See Part B below in that case.

If the conditions above are satisfied, please continue as follows.

Quit Mail if it's running.

Open the Library folder in your home folder by holding down the option key and selecting

Go Library

from the Finder menu bar. Inside it is a subfolder named "Mail." Move that folder to the Desktop. You're not moving the Mail application; you're moving a folder named "Mail."

Launch Mail. The mailboxes should be restored automatically. The messages will be downloaded from the servers, so it may take a long time if you have very large mailboxes. Some people have mailboxes in the gigabyte range, and that may be a problem if bandwidth is metered or the Internet connection is slow.

If the mailboxes are restored successfully, you can delete the folder you moved to the Desktop. You may have to recreate your Mail rules, signatures, and custom stationery. If it's important to you not to have to do all that, ask for instructions before deleting the folder.

B. If you have POP and/or "On My Mac" mailboxes, or if you don't know what you have

Move the Mail folder to the Desktop as in Part A and open it.

Press the key combination command-F to start a search. From the row of search tokens along the upper part of the window, select "Mail". Below that, set as the search criterion

Name ends with mbox

The results of the search will be a list of folders with a name ending in ".mbox". Each one represents a mailbox.

Launch Mail. All mailboxes will be empty at first, but if you have any IMAP or Exchange mailboxes (including iCloud), they should refill automatically after a delay, as in Part A. If you now have all the messages you want to keep, you can stop here. Otherwise, import from the mailboxes in the search results. As directed in the linked support article, select

Apple Mail

as the import format. You'll probably want to skip mailboxes with names such as "Deleted Messages," "Junk," "Spam," or "Trash." Some may be duplicates of what you already have; those you can delete.

In some cases, a mailbox may fail to import with an error message. If that happens, please post your results.

If all the mailboxes that you want to import do so successfully, you can delete the Mail folder on the Desktop.

Feb 8, 2016 7:43 AM in response to TJ670

TJ670 wrote:


Thanks I'll give it a try and report back. I'm still wondering why it happened on all three machines at about the same time.

Hello TJ670,

Whenever your iCloud mail gives you problems, always check the Apple Server status page first: https://www.apple.com/ca/support/systemstatus/

Then, verify that by checking the internet and Twitter. There was a major iCloud outage recently and that does seem to correspond with when you started this thread.


Also, I don't recommend using the "Rebuild Mailbox" feature. I used to recommend it, but that was based on how things worked years ago (both in OS X and my own mail servers). If you are using a standard iCloud e-mail setup, the only thing "Rebuild Mailbox" does is delete all of your mail and pull it down from the server again. If you have 12,000 e-mails in iCloud like I do, that's really annoying. If you have 12,000 e-mails in iCloud and the iCloud servers are down, then you have nothing.

Feb 8, 2016 8:06 AM in response to etresoft

Thanks for the response. I've got seven different email addresses and formats, so I'm wondering as a first step if I should disable each one, one at a time and see if I can narrow down the culprit. Would that be the first step? Then based on type, try the steps above. I also noticed that I'm starting to run out of disk space on my MacBook Pro, so I'm guessing that every time I hit "quit and rebuild index" it was loading the same messages on top of the others or something.


As for etresoft's suggestion, yes they all happened about the same time, but I'm typically not on all three machines within a 24 hour period. When I noticed the problem on my MacBook Pro, I checked my iMac, and the same problem was there, followed by my MacBook. I suspect it's Apple related somehow unless it's caused by a single corrupt email message that ended up on all three machines.

Feb 13, 2016 4:04 AM in response to Linc Davis

Hi Linc,

Some of the accounts are Gmail, others are POP. I got Apple Tech Support involved and they were of little help, so I wiped my MacBook of all email and accounts and started over, introducing one account at a time, reloading all email before I'd go on to the next one, making sure it was working. As soon as I deleted all accounts it stopped on the MacBook while the problem persisted on the two others machines. I finally had all accounts running smoothly for a day on the MacBook before I proceeded to the iMac followed by the MacBook Pro. I then for good measure, did the same thing with my 6S+ and iPad Pro, all of which took a couple of days to complete. Everything is now back up and running properly.


Without much evidence, other than I deleted the POP mail accounts first and the problem was still occurring, I think it had something to do with Gmail. I don't really know. One person at Apple Support suggested I may have reached the email limit, as it claimed to be reloading 14,000 emails.


Thanks for your help. The true source of the problem remains a mystery but for now the problem is solved.


Tom

May 1, 2016 1:39 AM in response to TJ670

I have been suffering from this problem for several weeks, if not months. I believed it started after upgrading to El Capitan. I tried the usual suggested solutions (e.g. rebuilding the Mailboxes, removing the Envelope* files, etc). However, sooner or later, the crashes would eventually come back.


I now believe that the problem was caused by some corrupted mail/folder of mine on my IMAP account. Unfortunately Mac Mail could not handle this (other email clients have been more robust).


The way that I managed to solve the problem was with some re-organisation of my old email. In particular, I used Thunderbird (since Mac Mail kept crashing on me) to "Archive" all messages of mine (ie. effectively retiring old mail folders in favour of newer folders named Archive/2015, Archive/2014, etc). In the process, I discovered some very large old messages (20 MB each or so) that I got rid of/deleted. I eventually migrated all messages (in the hundreds of thousands) into new "fresh" archive folders (created by Thunderbird) and deleted the old mail folders.


This "cleansing" process apparently took care of whatever the corruption was. I can now use Mac Mail again.


I am posting my solution here in case it is useful for somebody else.

Mail- Quit or Quit and Rebuild Index

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.