Function: Optimizes the Apple Mail database, drastically improving performance (your mileage may vary). Quits and relaunches Mail during execution.
Author: Automator World
Notes: This workflow is based on a discussion at Hawk Wings. This workflow is probably best used as an iCal plug in, set to run once a month or so:
.1 update: no longer requires separate “Quit” action.
YES YES YES YES!
Holy cow… this is the greatest little app I’ve ever seen.
Why doesn’t apple just make my mac do this on its own?
The improvement in speed was INSTANT and AMAZING.
Comment by JC — November 15, 2007 @ 2:42 am
Wonderfull, wonderfull!! my Mail.app was getting soooo slow I was thinking of trying other email applications. Thought Mail couldnt handle that many emails…. Now, after using this Mail runs as smooth as when i started using it. No more waiting 15 secs when looking into another folder. And after this cleanup the envelope file is still +50 MB which, i get the impression, is quite big…
thanks!
Comment by Edo — March 5, 2007 @ 2:28 pm
Jim - I had removed the Quit action for that reason (which I didn’t realize was a 3rd party action, available here), and replaced it with the same Applescript step you posted.
Comment by Steve — March 4, 2007 @ 1:57 pm
Automator complained about a missing Quit Application (or something like that). So I replaced it with another Run Shell Script using:
osascript -e ‘tell app “Mail” to quit’
I suppose this could be added to the part that runs the sqlite3 command.
Comment by Jim — March 4, 2007 @ 1:49 pm
Oops, I had uploaded the wrong version. The correct one is up, with quit/relaunch Mail. Sorry about that.
Comment by Steve — March 3, 2007 @ 4:46 pm