A colleague was having performance problems with Apple’s default Mail app. I don't think it handles large amounts of mail very well, as it is still a file based database, rather than a true database that can be optimized for performance.
There didn’t seem to be a good, clear set of steps for doing this, so here it is:
- First, try Rebuild in the Mailbox menu. That should fix most issues.
- Quit Mail if it is currently open
- In the Finder, choose Go to Folder... in the Go menu (Cmd Shift G)
- Paste this into the text field: ~/Library/Mail/V4
- Click Go
- Move all of the folders except MailData to the Trash
- Open Mail
You will need to re-enter the password for each account.
As a last resort, you can force Mail to rebuild the index file. Follow the steps above. At step 6, open the MailData folder and delete the Envelope Index file.