How to Clear Apple Mail Cache and Temporary Files on Mac?
If you are using Apple Mail to manage your email messages in the macOS, you may be really shocked to see how much storage space is taken up by the application after some time. Apart from disk space required by your email messages, Apple Mail collects some temporary files and index logs as well.
Temporary files may slow down your computer’s performance and even lead to crashes of applications, syncing or storage issues. Cleaning cache and temporary files of Apple Mail will help you free gigabytes of valuable space easily.
What Apple Mail Cache and Temporary Files?
Before considering the clean up process, it should be mentioned which kind of data the Apple Mail stores on your Mac hard drive:
- Envelope index files: Databases, which are built on the basis of the SQLite engine. If such indexes are damaged or fragmented, the search process will work incorrectly, and the Mail operation will be slow.
- Attachments to emails: All the downloaded images, PDFs and documents that are open from the emails are automatically saved by the Apple Mail in cache folders.
- Messages cache: Local copies of the emails, which were downloaded from the IMAP or Exchange mailboxes.
- Log files: Information, which appears when you configure your account, or perform other actions related to accounts checking or updating.
Method 1: Clear Apple Mail Attachments Cache via Finder
The Mail attachments cache folder, also known as Mail Downloads behind the scenes, occupies the largest amount of storage space in Apple Mail. Each time you open an attachment, it will be copied to this folder.
Steps to Remove Downloaded Attachments:
- Close the Apple Mail application completely using $\text{Cmd}+\text{Q}$ or File > Quit Mail from the top menu.
- Open Finder.
- Click on Go at the top of the screen and hold down the Option key while clicking on Library. (The Library folder is hidden on the Mac)
- Navigate to this folder:
Containers/com.apple.mail/Data/Library/Caches/mail
- Find the folder named “Mail Downloads” or “com.apple.mail caches”
- Drag all contents inside the “Mail Downloads” folder to the trash.
Note: Deletion of files from the “Mail Downloads” folder does not delete any attachment from the mail server. Whenever you open those emails in the future, the Apple Mail app will simply redownload the attachments on the spot.
Method 2: Manually Clear Apple Mail Caches via the Library Folder
Apart from attachments, Apple Mail stores general cache files in the Library directory in your account. By doing so, you force Mail to generate new cache files on its next start.
How to Clear Mail Caches?
- Launch Finder; click Go in the top menu, press Option, and choose Library.
- Navigate to the Caches directory.
- Find the following directories that are related to Apple Mail. com.apple.mail | com.apple.MailCacheDelete
- Trash the files in these directories.
- Empty your Trash and reboot your computer.
Method 3: Reindex the Envelope Index (Fix Syncing and Search Lag)
In cases where the Apple Mail program is slow, when searches return results that take too much time or where there are problems with unread email counts, the problem usually lies in the corruption or bloating of the Envelope Index.
Reindexing Apple Mail:
- Close the Apple Mail application (Command + Q).
- In Finder, press Option and click on Go then choose Library.
- Choose Mail Folder.
- Select the folder for your current macOS version of Apple Mail (V10, V9, or V8 based on macOS version).
- Click on MailData folder.
- Locate all files named Envelope Index (such as Envelope Index, Envelope Index-shm, Envelope Index-wal).
- Copy the files to Desktop, then delete the files from the MailData folder.
- Open the Apple Mail program.
An e-mail notification will inform you that it is importing messages. The program is not downloading all your messages again; it is just rescanning and creating a new database of your messages for efficient searching.
Method 4: Adjust Attachment Download Settings to Prevent Future Bloat
For avoiding any further instances of your Mac being filled up with attachments by default using Apple Mail, you can tweak your account settings.
How to Change Download Settings:
- Open Apple Mail.
- Click on Mail in the top-left corner and then choose Settings (or Preferences).
- Select the Accounts tab.
- Choose your email account from the sidebar on the left side.
- Click on Account Information.
- Change the setting for Download Attachments from All to Recent or None.
Method 5: Use Built-In Storage Management Tools
macOS provides a Storage Management utility that automatically identifies large email attachments and unnecessary files.
- Open the Apple menu ($\mathbf{\Large\text{}}$) located in the upper left corner of your screen.
- Navigate to System Preferences > General > Storage (or About This Mac > Storage > Manage in older versions of macOS).
- Focus on the Mail item in the categories list below.
- See how much disk space you are using for each account and press Edit or see attachment cleanup suggestions.
Quick Tip – Opt MacMister Apple Mail Converter for Mac to preserve Apple Mail mailboxes into 15+ saving options. With the help of the app, one can save Apple Mail database to PST, PDF, MSG, EML, HTML, CSV, DOC, IMAP, Yahoo, Gmail, Office 365 and more.
Epilogue
Following these procedures regularly will help you to ensure that Apple Mail remains light, solve unexpected performance issues, and make your valuable gigabytes available on your Mac’s hard disk space.