2

I had a hard crash on my Mac PowerBook and when I restarted, Mail came up with only my MobileMe account still available and I cannot figure out how to restore the other eight email accounts I have.

The directories in ~/Library/Mail all seem to be there. I even did an rsync of the modified .plist files from a TimeMachine backup of the directory from before the crash (unfortunately, I was on travel, so the backup is more than a week old and I'd like to try and recover from that point without having to entirely restore from TimeMachine).

I also did a fix permissions.

So my questions are where exactly is the account information for Mac Mail kept? Any thoughts of what might have caused the failure? Why does only MobileMe come up? Any other thoughts on how to fix things?

3
  • See the 3 files I suggest you restore with Time Machine (while Mail.app is not running) Aug 24, 2009 at 22:40
  • So it was the ~/Library/Preferences/com.apple.mail.plist. I actually found it on my own before checking back here, but thanks for the pointer.
    – Tim
    Aug 25, 2009 at 15:56
  • This is why storing email in anything other than an mbox or maildir format is asking for failure, or going for that tempting user lock-in. Apple shouldn't have done it. BeOS long ago demonstrated that storing mail in an maildir format with filesystem extended metadata like from, to, subject etc. was the way to go. They also did this with mp3s and id3 tags, making the whole iTunes music library look crazy.
    – dlamblin
    Sep 4, 2009 at 22:51

7 Answers 7

4

There's a hacky (but may be only) way to convert your messages to the mbox format which you can then re-import into Mail.

This tool will convert your individual emlx mail files (found in ~/Library/Mail/) to the old mbox format.

To import your e-mail into Mac OS X Mail, follow these stepssource:

  1. Click on "File" in the menu bar, then on "Import Mailboxes"
  2. On the "Import Data From..." window, select "Other", then click "Continue" (In MacMail 3.2, there will be no "Other" option, but you will be able to import "mbox files" as an option on this menu)
  3. Navigate to the location of your netID.e-mail.mbox folder. Select that folder, then click "Choose"
  4. Make sure that all the mail folders you want to import are checked, then click "Continue"

The problem is that just having those folders there isn't all that the Mail app needs. It probably has some settings and dbs stored in it's preferences folder as well (you may be able to use Time Machine to restore these and have everything work again as well).

I would try restoring the following files:

  1. /System/Library/PrivateFrameworks/ScreenReader.framework/Versions/A/Resources/English.lproj/ExceptionsDatabases/com.apple.mail.plist
  2. /Library/Mail/MailAccounts.plist
  3. ~/Library/Preferences/com.apple.mail.plist
2
  • The key component for me is restoring the other accounts. The data/mail from these accounts is still there. If I recreate the accounts from scratch, it will either conflict or ignore the existing data, which is why I'm trying to restore the underlying parts.
    – Tim
    Aug 24, 2009 at 19:53
  • This worked for me with this note: Of these 3 files, I could not find /Library/Mail/MailAccounts.plist. But restoring the other 2 seems to have fixed everything just fine. Time Machine restore saved the day.
    – user92196
    Jul 29, 2011 at 14:10
3

If you are running Lion, things changed and none of what anything said here will work. :)

The problem is even worse if you upgraded Lion from a prior version and and still see all these old files sticking around and you break your keyboard trying to get your mail back by restoring files that aren't actually used anymore. :)

The preferences for Mail.app under 10.7 are now under:

~/Library/Mail/V2/MailData

You'll need to restore the entire contents of this folder to get your accounts back. Once I did this, everything worked again and life was grand.

1

(Hmmm, re-reading your question, the following will not help you much. Just for the archives then.)

You can restore the messages with Time Machine directly without the need to copy the message files yourself. But I don't know about restoring the account settings (and I don't know if this will correctly "connect" the messages with the accounts).

So: your manual copy may be easier, but if you want to use the Time Machine interface: just first activate Mail and then enter Time Machine. Instead of the usual Finder in the star field, you'll see Mail.

(If you replaced any hardware after the crash: remember you can hold down Option while clicking the Time Machine icon, to change "Enter Time Machine" into "Browse Other Time Machine Disks".)

1

So I tried a number of things and finally got things mostly back to where I wanted to be.

I tried using TimeMachine on the Inbox and did a restore from before the crash. This restored the contents of the email messages from that point, but put them in a new folder (called something like Time Machine) and did nothing for the accounts, which was the main goal. This wasn't much help, so I restored from a backup copy I had made of ~/Library/Mail.

I then restored ~/Library/Preferences/com.apple.mail.plist from before the crash. I had not tried this initially, because when I did a grep of one of my mail accounts in the ~/Library/Preferences directory, but the grep failed with "egrep: ringToFront.plist: invalid context length argument", which I didn't realize was a hard failure and it did not get to the other files. Doing a grep directly on com.* in the pre-crash TimeMachine directory gave "Binary file com.apple.mail.plist matches". Bingo. So I moved that file into place and restarted Mail.app with the old ~/Library/Mail directory in place and it caught up.

1

My solution more or less confirms the previous ones, but I chose a slightly different option.

I had a hard crash today (hit the all too convenient foot operated off button on my Powerboard). When I rebooted, all my Mail folders and accounts had disappeared. Tried restoring the folders through Mail and Timemachine, but like Tim, I just got a lot of unlinked folders, which would have been a huge amount of work to relink.

I then found this site and tried restoring ~/Library/Preferences/com.apple.mail.plist from the Timemachine Archive just prior to the crash. I got three options, "Keep Original", "Keep Both" and "Restore". I chose "Keep Both", and then proceeded to restore. I quit Mail, then restarted it, and all my folders and accounts reappeared by magic! I then saw that there was a file, com.apple.mail (original).plist which is the version with the missing Mail data. I'll delete this, but it was useful to have the security of knowing I had a version with some data, just in case the restore didn't work.

1

In Lion the paths are slightly different, the two files to try restoring from Time Machine are:

~/Library/Preferences/com.apple.mail.plist ~/Library/Mail/V2/MailData/Accounts.plist

In my case the first did nothing, but the 2nd worked. Accounts.plist had obviously been truncated to 1kb. As to why, that's another question.

0

After a restart I opened my Mail program, only to find it empty and asking me to do a set up.

After reading through this thread I found a file named library/preferences/com.apple.mail.plist.saved so I deleted the newer library/preferences/com.apple.mail.plist removed .saved from other file name, restarted mail, and everything is good again!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .