For what seems like the hundredth time, I've been presented with "Your Mail index has been damaged. To repair it, quit Mail".
This is stage 1 of the pain. Stage 2 occurs when Mail crashes again during the index rebuild (about an hour in).
A bit of detective work many moons ago revealed that it always crashed at the same point in the rebuild, and tracking the timestamps on the
~/Library/Mailsuggested that the last one to be touched was responsible. Deleting it allows the rebuild to succeed (I know this folder will be downloaded from the IMAP server afterwards, so there's no harm done).
All mail clients suck, and in my experience Mac Mail sucks the least, but this particular issue is maddening. It might be time to give Thunderbird another try.