Mac Mail keeps your emails in a series of mailbox database files located in Home > Library > Mail > Mailboxes.
With time, you add and remove hundreds of emails from these files. As a result, the overall performance of Mail is reduced and problems may appear.
The solution is simple – you should rebuild the message databases. This will repair and purge the unnecessary mail files, thus increasing your Mail’s performance.
To rebuild an email database, select it in the mailboxes "drawer" in Mail. Then choose Mailbox > Rebuild Mailbox. The rebuilding process may take from several minutes to several hours, depending on the size of your mailboxes.