Apple Event: May 7th at 7 am PT

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

Mail.app not restoring properly - keeps asking to import mailboxes, crashes

I noticed in the last few days that searching for email messages, either from within Mail.app or directly from spotlight, fails to find emails that I recently received and haven't deleted. (At the very least they should have shown up in the trash mailbox).

After trying to delete the Envelope* files and rebuilding the mailboxes, it started crashing completely.

I then restored both the entire ~/Library/Mail folder as well as the ~/Library/Preferences/com.apple.mail.plist file from my 1 day old Time Machine backup.
Launching Mail after this restore brings up the "Welcome to Mail" window, as if upgrading from Tiger and it then starts importing mailboxes.

After a few hundred (out of ~30,000) messages Mail.app just crashes, and trying to launch it again repeats the precise same thing again and again.

I've also tried launching it after having uninstalled all bundles by the way, and the crashes are pretty much the same.

I did note, however, that the Envelope files that are normally in the ~/Library/Mail folder, are non-existant in any of the Time Machine restore points - this seems like the reason Mail.app absolutely must start by importing the mailboxes, to create an Envelope Index etc.

Any advice for solutions/workarounds etc. would be most appreciated - I'm currently Mail-less!

Thanks!
Thanks.

MacBook, Mac OS X (10.5.2)

Posted on Mar 13, 2008 10:10 AM

Reply
10 replies

Mar 14, 2008 3:37 PM in response to Guychi

I'm having a similar problem after using Time Machine to transfer my entire system from one MacBook Pro to another. When I launch mail, it welcomes me and tries to import, gets to 523 messages out of 44,000 and the time starts climbing at the bottom of the screen. When it reaches a time remaining of about 6 hours it crashes, leaving no account set up and no mail imported. I've tried this several times and even migrated an additional copy of my Mail folder from the time machine drive, with exactly the same result.

I'm going to try repairing permissions, then try a firewire connection to my old MacBook Pro and try to import from the mail folder on the original drive.

Other ideas welcome.

Dave

Mar 14, 2008 4:17 PM in response to daveblair

I made a copy of the mail folder to the root level of the hard drive, leaving the original in place in Users:Library:Mail. Always like to have a backup, however there is still one on the time machine drive and on my old hard drive if this isn't successful.

I then went to Disk Utility and ran Repair Permissions on the boot drive.

I then re-launched Mail. At this point it did come up with the correct user accounts showing, however all mailboxes were empty, and only new mail started rolling in. All my mailboxes were in place, however. I then went under File to Import and reimported all my mail again in the standard way. I am now moving the message back form the imported mailboxes to their original spots.

this seems to have worked, but I'm worried that I have another full copy of all the mail sitting in my mailbox that isn't being used, and its not clear of what to erase... not that hard drive space is an issue, with 250 GB, but its still seems a bit wasteful to have 5 GB of extra mail hanging around that I can seem to figure out how to get rid of. The backup (real) copy of my mail from my old computer is 4.58 GB and my current new mail folder is now 10.54 GB.

Ideas? The only one I've had is to do this process again, but to wipe the mail folder and re-establish the accounts fresh before importing. If you have an easier way, let me know.

thanks, Dave

Mar 15, 2008 2:40 AM in response to Guychi

I've solved my problem:

It turns out there were a few culprit messages that when trying to import them Mail.app would crash. These were usually messages with attachments that had filenames containing both non-ascii characters AND digits. But this may not be the only criteria.

To identify which are the culprit messages and remove them, go into the mailbox folder from which Mail is importing last when crashing, and remove the first file (when sorted in ascending order by name) from the Messages folder inside it.

Repeat as necessary for each successive culprit.

That's it!

Mar 21, 2008 5:32 PM in response to Guychi

I'm also having this exact problem. Mail tells me "Mail needs to import your messages. This might take a few minutes, and you won't be able to use Mail until the import is finished. Click continue to import your messages now, or click Cancel if you'd rather do it later."

Clicking continue starts the import process -- of my 170,000 -- emails. Mail reliably gets to 88868 messages, then the number stops counting upwards and the progress bar no longer progresses.

Watching Mail in Activity Monitor I can see that Mail starts rapidly consuming more and more memory until it fills the system memory entirely (on my MBP with 4GB RAM) and then crashes out.

Like the previous poster, I suspect there is a particular message causing Mail to crash or go into a memory leak loop, however, it's very difficult to identify because the crash report Mail generates (along with log info in Console) doesn't mention any specific messages it is importing.

It's clearly a memory leak problem of some sort because Mail consistently sits at 212.94 MB of active RAM usage while importing the mail up until the point it crashes, after which time it uses about 40MB a second until it fill system memory.

I tried using the LSOF command to monitor what files Mail was opening each second, however when it goes into its "rapid memory consumption about to crash" mode, I can see that it is continuing to open different mail messages, so it is not clear which one I'd have to delete to fix the problem.

So I am a bit stumped. I can work around the problem by hitting cancel when Mail says it needs to reimport the mail, but then I can only receive new mail, as none of my existing mail is listed in Mail. Very annoying.

May 9, 2008 1:42 AM in response to Guychi

I just got my new MBP17 (4GB,250) and Migration Assistant copied things over from my old MBP Time Machine Backup.

I am seeing the same problem. My question is: why did Mail.app decide it needed to import anything at all ? Why didnt it just start up with the copied over settings, prefs, mailboxes etc. as if nothing had changed ?

Very annoyed since mail is kind of a must have application. Stuck in limbo between not being able to use the new machine until this f**up is cleared and not wanting to use the old one any more because then I get progressively out of sync if I still do mail on that...

grrr- tearing out gray hair...

Jun 17, 2008 2:51 AM in response to Guychi

If Mail pops the message about +existing mail messages need to be imported first time you use Mail+ it's because its preferences file is corrupt. To fix the problem, restore the mail preferences file from a backup and you're all set. You'll find it here ~/Library/Preferences/com.apple.mail.plist.

It just happened to me: the mac crashed, mail stops working after reboot, restored preferences from a time machine backup, relaunched mail... all's fine.

(I first just deleted the preferences file, but that will reset all the accounts. This may result in losing the messages in the special Inbox, Outbox and other special folders. Go with the restore.)

Mail.app not restoring properly - keeps asking to import mailboxes, crashes

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