Mail on the Mac Pro running the latest update of High Sierra (newest OS I can use) keeps crashing when I use “Select All” to empty the trash

mail.apptrash

Application Specific Information:
* Terminating app due to uncaught exception 'NSRangeException', reason: '* -[__NSArrayM objectAtIndexedSubscript:]: index 9223372036854775807 beyond bounds [0 .. 1]'
terminating with uncaught exception of type NSException
abort() called

Mail does not crash when I delete each email in the trash individually, only when I select them all then hit "delete." I have tried to delete the mail preferences, rebuilt the mailbox, deleted/reinstalled the account, reset the VRAM, erased the disk and reinstalled High Sierra (then restored from CCC5), ran disk utility from Recovery Drive, called AppleCare (very dismissive of my "obsolete" Mac Pro), booted into Safe Mode (same problem).

Best Answer

When you rebuilt the mailbox did you also get it to re-index?

Quit mail, then ~/Library/Mail/V6/MailData/ delete all the Envelope Index files [duplicate to the desktop first for safety] & re-launch Mail.

The rebuild may take some time

Related Question