Turn Of Mail Logging Debugging - El Capitan

Hello


Just upgraded to El Capitan


I have a mail logging file EWSBodyFetch which is enormous in size c. 17gb and grows at an alarming rate and is writing debug information. When I checked it, for some reason it appears to be logging everything. Mail is working absolutely fine and I want to debugging turn off. At one point under Mavericks I had a problem with Mail hanging ( maxing out the thread count ) and obviously turned on debugging to help sort the issue. The problem resolved itself on upgrading. Can anyone tell me how this is achieved, I assume it is a


/usr/bin/defaults remove com.apple.mail XXXX

Posted on Oct 4, 2015 1:24 PM

Reply
25 replies

Nov 11, 2015 9:39 AM in response to MushroomInTheDark

I have finally solved my issues with El Capitan Mail app and (in my case) Exchange Servers.

This is what I have discovered;


The problem:

Mail app at El Capitan create massive debug logs at ~/Library/Containers/com.apple.mail/Data/Library/Logs/Mail/

The debug log it's not running all the time, only sometimes start a crazy loop, that you can't stop anyway, it's doesn't matter if you close the app, because it will continue next time you open Mail.

When the issue it's happening the Mail app processor use it's over 100% and the file XXX_IMAPSyncActivity.log starts to grow up to the infinite.

When the file it's too big, Mail tries to archive and zip the file, and this eats all your ram memory.

At this time you computer it's completely lost, and your only option it's to force kill Mail app or a hard reset.

If you open Mail again the process will remain at the last point and you will lose your computer again.

At this time you can remove all log and zip files at ~/Library/Containers/com.apple.mail/Data/Library/Logs/Mail/ restarting the process from the beginning.

It doesn't matter if you activate, deactivate, delete, reconfigure, rebuild or whatever you want to do with the conflictive account.

it doesn't matter if you do a clean install of El Capitan and start from zero.

Soon or later the log will eat all your resources, your processor, your disk and your ram and you will lost your computer control again.


My solution:

Probably you need to uncheck first:

Mail --> preferences --> accounts --> Mailbox Behaviors --> Move deleted messages to the Trash mailbox

And after that, disable:

Mail --> preferences --> accounts --> Advanced --> Compact mailboxes automatically


I have seen that when Mail tries to compact the mailbox with Exchange Servers the process doesn't work as expected and loops an indefinitely error.

The debug and log of this error it's what in my case created all my problems with Mail.

Disabling the automatic compact mailbox for my exchange account I have had no more issues with the Mail app at El Capitan.


I hope this help others with the same problem, and Apple programmers to definitelly solve the problem in a next update.

Nov 11, 2015 11:42 PM in response to MushroomInTheDark

The tip above applies for IMAP mailboxes and may help there. Maybe even if you access your exchange mailbox via IMAP but it does not help if you configured your exchange mailbox correctly at exchange mailbox.


I don't have the settings either at my exchange mailbox but at my IMAP mailboxes. But they don't make any problems. Also the logging of my exchange does not run into any loop it just logs everything it correctly does.


Actually you can separate the 2 issues alrea by the log file name. If it contains EWS it is the Exchange problem.

Nov 12, 2015 2:30 AM in response to AminSharaf

Hi, our company Exchange Server it's very very old, (it's the unsupported 2003 version), and the only way I can use it on a mac is with IMAP, I don't think the problem it's with all IMAP configurations because I don't have any problems with other IMAP accounts (gmail for example) in my home computers.


In my case, the compact option it's greyed out if I don't disable first Mail --> preferences --> accounts --> Mailbox Behaviors --> Move deleted messages to the Trash mailbox.


If on "real" Exchange accounts (EWS log files) that option it's not present I would try to configure the account with IMAP and disable the move deleted messages to trash and compact mailboxes. It's not perfect, but I have been having the problem with Mail from the first day I updated to El Capitan, I tried all possible things, and suggested previous solutions, I made a clean install of El Capitan and configuration from zero, and nothing solved, until I unchecked the sent to trash, and after that the compact mailboxes. With that configuration I have had no more problems and my job iMac 24 2008 (with ssd) goes like my home mac book pro retina 2014, very very fast and without any problems 😉


This is the full configuration working for me:

User uploaded file


User uploaded file

Nov 24, 2015 1:02 PM in response to MushroomInTheDark

This maneuver stopped the log writing. Time will tell if it fixes the death spiral


From Terminal:


cd ~/Library/Containers/com.apple.mail/Data/Library/Logs/Mail


chmod 555 .


(That's chmod 555 DOT)


Or this should do same thing:


chmod 555 ~/Library/Containers/com.apple.mail/Data/Library/Logs/Mail


This turns off write permissions for everyone to the log dir. I was sure Mail would hang up when it could no longer barf out megabytes of debug logs but so far it's working.


Seems just too simple and idiotic.


It might have the side effect of filling up the syslog but it should be slower and better managed.

Nov 25, 2015 7:11 AM in response to barangus

After I posted the idiotic "fix" of setting the log dir to 555 (see above) I did more digging because I HATE that fix.


Firstly I'll mention I am sysadmin for my company's Exchange 2003 mail server. the log files that go out of control happen to be my own company's IMAP server.


Doing a little digging I found in the following thread that almost exact things are happening with CYRUS servers. This leads me to believe there are other "rogue" IMAP servers also having issues.


El Capitan Mail.app causes massive load on Cyrus IMAPd server


Sure enough my log files are getting hammered with EXPUNGE dialogs just. Sure enough the workaround of setting Mailbox Behavior prefs to NOT move any messages (all check boxes cleared) and to uncheck Compact Mailboxes Automatically stops the out of control logging.


Note that you have to first uncheck all boxes in Mailbox Behaviors, THEN select another mail acct to actually Save setting and THEN go in to Advanced and uncheck Compact.


Good news is at end of thread saying that the beta of Mail in 10.11.2 fixes this once and for all.

Nov 25, 2015 7:36 AM in response to barangus

Hi barangus, thats exactly what I posted some days ago, but just for your information in my case with Exchange 2003 I can have checked the save on server for the SENT messages without problem as you can see on the previous screenshots I attached.


Unfortunately I think the "compact mailboxes automatically" uncheck solution it's not working for all people because others are having the same problem with Avast anti-virus, but it's good to know that you solved the problem as I did 🙂


Best.

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.

Turn Of Mail Logging Debugging - El Capitan

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