Mail.app crashes on startup after Exchange settings update

OK, this is one of those problems that come up only if you do something silly or simply something really unusual.

Basically, I experienced a terrible situation today when my Leopard Mail.app refused to work. It was crashing all the time even before the window would appear on the screen and a standard Relauch/Ignore dialog box was popping up all the time. This is one the error messages I found in Console which is a built in application and can be found under /Applications/Utilities:

18/12/2007 11:12:16 Mail[167] *** Assertion failure in -[LibraryToDo mailboxUid], /SourceCache/Message/Message-915/Library.subproj/LibraryToDo.m:205
18/12/2007 11:12:16 Mail[167] An uncaught exception was raised

18/12/2007 11:12:16 Mail[167] Mailbox UID is not set
Stack Trace: (
(
2530345579, 2474053787, 2530345035, 2462609636, 4844373, 3408319, 4829155, 2461484666, 2529720906, 2529721635, 2461473392, 13228, 4990192, 3024109, 2530368413, 2530366856, 3999207, 2461487181, 2461486068, 2472796277, 2472795954
))
18/12/2007 11:12:16 Mail[167] *** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘Mailbox UID is not set’
18/12/2007 11:12:16 Mail[167] Stack: (
2530345579, 2474053787, 2530345035, 2462609636, 4844373, 3408319, 4829155, 2461484666, 2529720906, 2529721635, 2461473392, 13228, 4990192, 3024109, 2530368413, 2530366856, 3999207, 2461487181, 2461486068, 2472796277, 2472795954
)

The first question is: what might have caused that? And the answer is: a recent update of my Exchange email account settings in Mail.

Last night I was VPNing to my office network and I was forced to replace the Exchange server hostnames with raw IP addresses (under Mail Preferences -> Accounts -> Incoming and Outgoing Mail Server) because for some reason my computer stopped resolving them and was not able to send and receive messages anymore. And when I got to the office today and tried to access my email, the application started crashing.

Solution
As I wasn’t able to access Mail and restore the previous Exchange settings I decided to create a new Mac OS X user account in order to temporarily replace my corrupt ~/Library/Mail settings with a fresh bunch of files. I backed this directory up and after sorting out the permissions I grabbed the files from /Users/NEWLY_CREATED_ACCOUNT/Library/Mail and dropped them under ~/Library/Mail. Then I tried firing Mail up and this time it did not crash. I fixed the the Exchange settings, restored the original, backed-up copy of ~/Library/Mail, restarted the Application and could see everything up and running again.

The moral of the story is “don’t give up when Mail doesn’t want to start” :-) Just create a new user account, replace the Library settings and start the process from there. I don’t know if there is any other way (other than the one with the updated Exchange settings) of making Mail crash but if there was one, going this route might be a good way of restoring your email without even thinking about reinstalling the system or anything as severe as that.

One Response to “Mail.app crashes on startup after Exchange settings update”

  1. Bill Says:

    Thanks a lot for this posting. I had the exact same issue and this fixed it.

Leave a Reply

You must be logged in to post a comment.