Many common problems with Mail can be fixed by rebuilding all or part of its index database. For example:
To do a complete rebuild of Mail’s database:
First toggle some settings to prevent SpamSieve from refiltering old messages if Mail redownloads them after the database rebuild:
(If these are already off, you can leave them off.)
Quit Mail.
Locate the Envelope Index file. On macOS 15, macOS 14, and macOS 13, the file is stored at:
/Users/<username>/Library/Mail/V10/MailData/Envelope Index
Open your user Library folder. (See the How can I open the Library folder? section if necessary.) Then open the Mail folder, then V10, then MailData to find the Envelope Index file.
Once you’ve found the Envelope Index file, drag it to the trash. Also delete Envelope Index-shm and Envelope Index-wal (if they exist).
Note: Rebuilding the index database is normally perfectly safe. Even though it seems that you are deleting a file, Mail stores its primary copy of your message data elsewhere. When you delete the damaged database, Mail uses this primary copy to create a new index database. However, please be careful if you are using macOS 10.15. We’ve heard some reports that rebuilding the Envelope Index can lose messages in On My Mac mailboxes on macOS 10.15.0–10.15.2 due to a bug in Mail. If you are using macOS 10.15 prior to macOS 10.15.3, be sure that you have a backup first, and proceed with caution.
Relaunch Mail. It will welcome you as if you haven’t used it before. This step may take a few minutes, as Mail searches through all of your stored messages to build your new database file. IMAP and Exchange messages will need to be re-downloaded from the server.