Enormous mail file is taking over my hard drive storage, maybe disabling Mail search function and sync.

I've been using Apple Mail for Mac for many years, mostly via IMAP connections. Somehow the mail file in Users/MyName/Library/Containers/Mail/Data/Library/Logs/Mail (it's named imap.gmail.com-gibberishHere.txt) has grown to 1.4T. I have only 2G of space left on my 2T hard drive. Can I repair or delete that file? At the same time, the search function within Mail is completely not working. Is this related to the obese file? At the same time, syncing is really funky, with some messages showing up from my phone but not from my desktop. I presume this is related to one or both of the above? I've tried rebuilding my largest inbox and my very large Archive mailbox, but no difference seen. I'm afraid that without space on my drive I'm going to wreck it, and without Search in mail I'm dead. Can anybody help?

iMac Line (2012 and Later)

Posted on Feb 9, 2022 11:04 AM

Reply
Question marked as Top-ranking reply

Posted on Feb 10, 2022 4:19 PM

In Mail, click on the Window drop-down menu and select Connection Doctor. Uncheck the box "Log Connection Activity". Then quit Mail and trash the log files. They won't be recreated because logging will be turned off. It's a trouble-shooting tool you only need if you are trying to figure out why your Mail isn't connecting.



5 replies
Question marked as Top-ranking reply

Feb 10, 2022 4:19 PM in response to lee63xx

In Mail, click on the Window drop-down menu and select Connection Doctor. Uncheck the box "Log Connection Activity". Then quit Mail and trash the log files. They won't be recreated because logging will be turned off. It's a trouble-shooting tool you only need if you are trying to figure out why your Mail isn't connecting.



Feb 9, 2022 6:34 PM in response to lee63xx

Apple Mail will by default download the entire Gmail mailbox and that sounds exactly like your problem. Here are your options:


  1. Configure Gmail to limit the number of emails it delivers over IMAP by going to your Gmail web interface, clicking the Gear in the top-right then See all Settings and go to the Forwarding and POP/IMAP tab at the top. Scroll down to the IMAP section and set Limit IMAP folders to contain no more than this many messages (1,000 - 10,000).
  2. Configure Mail Account settings for Gmail to not download the attachments on the Account Information tab in the Google IMAP account settings.
  3. Uncheck the "Enable this account" and Quit Mail
  4. Press Shift+CMD+G to pull up the Go to Folder in Finder then go to ~/Library/Mail/V9 and you should see several long numbered folders expand each one till you find the one that contains "[Gmail].mbox". You will then move that numbered folder to the Trash.
  5. Start up Mail and re-enable Gmail account and let it sync.


If that doesn't free up enough space you'll either need to start using Safari or perhaps Chrome to access your Gmail instead of the Mail app. Otherwise you will need to delete your old email on Gmail. Easier if you do it on the web interface to Gmail.

Feb 10, 2022 2:15 PM in response to James Brickley

Thank you so much, James! It freed up 140G of space after the trash got emptied (over an hour!) and the Search function is working again in Mail. But one big question remains: how about the huge 1.37T file that is still in Users/MyName/Library/Containers/Mail/Data/Library/Logs/Mail (it's named imap.gmail.com-gibberishHere.txt) . The file is getting used, as its mod date/time changes as I use Mail. What is that file, and would it get rebuilt by Mail if I trashed it? I think it's too big to archive and then trash, as it's occupying 70% of my hard-drive space. If it's just a log, it feels like it's probably not important, but I'm reluctant just to take a chance. Any thoughts?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Enormous mail file is taking over my hard drive storage, maybe disabling Mail search function and sync.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.