For the last year (possibly longer) the Mail app on my iMac crashes after I close the window (not quit, just close using the red X button in the top left corner, or with cmd+w). This happens 100% of the time without fail. I submit a crash report to Apple each time but it seems like this isn't addressed. Note, I only have one account connected and that is my iCloud. Things I've tried:
- resetting PRAM
- removed Mail preferences files
- removed the entire library (can't remember how, found instructions online. but after it was finished the app asked to rebuild the mail index)
- rebuilding mailboxes (https://support.apple.com/guide/mail/rebuild-mailboxes-mlhlp1227/mac)
- removing and re-adding my account
I'm out of ideas besides reinstalling macOS but that's my last resort. Here's part of the crash log:
Process: Mail  Path: /Applications/Mail.app/Contents/MacOS/Mail Identifier: com.apple.mail Version: 11.5 (3445.9.1) Build Info: Mail-3445009001000000~1 Code Type: X86-64 (Native) Parent Process: ???  Responsible: Mail  User ID: 501 Date/Time: 2018-08-30 11:29:14.606 -0400 OS Version: Mac OS X 10.13.6 (17G65) Report Version: 12 Anonymous UUID: <STRIPPED> Sleep/Wake UUID: <STRIPPED> Time Awake Since Boot: 45000 seconds Time Since Wake: 6100 seconds System Integrity Protection: disabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Signal: Segmentation fault: 11 Termination Reason: Namespace SIGNAL, Code 0xb Terminating Process: exc handler  VM Regions Near 0: --> __TEXT 000000010a623000-000000010a9e5000 [ 3848K] r-x/rwx SM=COW [/Applications/Mail.app/Contents/MacOS/Mail]
Edit to add detail:
When I disable my iCloud account in preferences, I can close the app without it crashing. But as soon as the account is re-enabled, it goes right back to crashing on close.
Another thing I noticed is that if I click the "Mailboxes" button to show all mailboxes (eg, Inbox, Flagged, Sent, etc). I can switch to any other mailbox and close the app without problems. It only crashes if I have the Inbox selected and close the app.
Opened Console and tracked error messages from Mail app. Here are the results, all of these errors are logged multiple times except the
Error sending searchable item 29964 to CoreSpotlight:Error Domain=CSIndexErrorDomain Code=-1000 "(null)" [AOSAccounts] : [ACAccount+iCloudAccount] : -[ACAccount(iCloudAccount) icaCloudKitToken] - icaCloudKitToken cannot be returned as account is still not vetted! AEGetDescData of non-desc type 'reco' not a good idea
A lot of events are logged in Console. I cleared the console before closing Mail, here's a screenshot with all the messages (my email address blurred out).