How to Rebuild an Apple Mail Mailbox
If you are dragging and dropping emails from Apple Mail into DEVONthink, you may see a message in our Log window that importing a message failed. Here’s something you can try to resolve the issue.
Go into Apple Mail and select the mailbox you’re dragging from. Then choose Mailbox > Rebuild. This will redownload emails and rebuild the index — content and metadata. After the rebuild is finished, try dragging and dropping the problematic message again.
Be aware, the time required to rebuild a mailbox depends on the number of emails involved. So you can rebuild the mailbox you’re currently importing from and rebuild others when you have more time to let it process.
And please make sure you have given DEVONthink Full Disk Access and allowed its Automation requests in System Settings > Privacy & Security.
On a side note: Apple Mail is built with an underlying database. Over time, a database can have inconsistencies, especially one that’s heavily used. The rebuild can also improve searches, smart mailboxes, mail rules, and even performance while browsing your emails!