This is a strange period in technology, while the world talks about going green, saving power by unplugging home devices while unused because that small LED light multiplied by millions of users costs lot of energy, it seems instead that hardware manufacturers, software developers, and IT companies more in general don’t give a fuck about any of this.
Last month I had to deal with Samsung bloatware on Android turning my phone into a toaster, now I’m here for Apple turning my MacBook into a panini press “thanks” to Mail app going crazy.
anyone else experiencing *extreme* CPU drain on Mac OSX El Captain with Mail app? +160% of CPU is just insane
— Simone Rescio (@srescio) 5 marzo 2016
How to fix
As pointed out on apple forum, this happens due to Mail app logs becoming somehow corrupted, which leads the app into consuming an insane amount of CPU power, with consequent battery drain, probably being stuck in some kind of stupid loop.
Despite being a problem reported all over the internet this is an issue that up today, on OSX El Capitan 10.11.6 has not been fixed yet, what may be causing Apple the impossibility of doing a minor bugfix release for it is a mistery.
The user of the forum suggests to move the Logs directory then restart the app, and if it doesn’t fix the issue (it always did for me) to restore it where it was. But the Mail app can just recreate the Logs directory each time it is missing at startup time, so unless you need that data for debug purpose you can safely trash it anytime your CPU goes crazy again. So instead of manually looking for the Mail directory and deleting the Logs via Finder you can shorten the operation in a one liner command for Terminal, that you can save into an handy alias :
rm -rf ~/Library/Containers/com.apple.mail/Data/Library/Logs
But I don’t even know what Terminal is, something clickable?
Here’s an Apple Script that quits Mail app, cleans Logs directory, and restarts it, download & extract then double click to execute, problem solved.
Here’s the content of the executable :
tell application "Mail" quit end tell repeat while application "Mail" is running end repeat do shell script "rm -rf ~/Library/Containers/com.apple.mail/Data/Library/Logs" delay 2 tell application "Mail" activate end tell