Mac Mail app crashes on launch – rebuild the envelope index

For no good reason at all my Mac Mail app started crashing on launch and would not stop. A quick Google search found this article – the key bits are reproduced here to make things easier.

Open Finder and select the Go menu option. While holding down Option, select the Library option (which is otherwise invisible). Navigate to Mail/V2/MailData. In that folder there will be a number of files starting with “Envelope Index”. Move (not copy) all of these out to the Desktop or somewhere safe just in case. Then, launch the Mail app. It will re-import the messages (which might take a long time depending on how many there are – about 20 minutes in my case) and then everything should be back to normal. If that worked, the original index files can be deleted.