VacuumMail is an AppleScript application that performs the "vacuum" command on Apple Mail's underlying SQLite Envelope Index database. This must not be done while Mail is running, so this scriptlet first checks to see if Mail is running and if so, quits Mail. VacuumMail first notifies the user that it will be shutting Mail down, giving the user an opportunity to cancel the vacuum operation. This dialog window will close automatically, quit Mail, and commence vacuuming in 8 seconds if the user doesn't click on the "Cancel" button.
VacuumMail is designed to be incorporated into an automated maintenance routine more...and run at regular intervals. According to the SQLite documentation, the vacuum command does a more thorough optimization of Mail's database than the "autovacuum" setting that's supported in Mac OS X beginning with version 10.4.8.
Alternatively, you can launch VacuumMail interactively if you need to do a manual run. I keep VacuumMail in my Finder toolbar, so it's handy to launch.
If Mail was running when the process begins, VacuumMail will restart Mail when it's finished. The vacuum process can take several minutes if your Envelope Index is very large, and in this first version VacuumMail doesn't display any kind of progress indicator. However, when it's finished, VacuumMail will display a dialog showing the size of your Envelope Index file before the latest vacuuming as well as afterwards. This dialog will close after a few seconds if you don't close it manually.
VacuumMail can be installed anywhere on your system and expects Mail and your ~/Library/Mail folder to be at that location. I did modify the shell commands so they'll work with symbolic links, in case you, like me, store your Mail folder on a different partition but have it symbolically linked to your Library folder.
. Follow the link and
free download VacuumMail now.
DETAILS