VacuumMail is an AppleScript application that performs the "vacuum" command on Apple Mail's underlying SQLite EnvelopeIndex database. This must not be done while Mail is running, so VacuumMail will first check to see if Mail is running and if so, it will close Mail (giving you a chance to opt out, of course!). If Mail was running when the process begins, VacuumMail will restart Mail when it's finished, and will let you know how much it was able to compact the database.
VacuumMail is designed to be incorporated into an automated maintenance routine and run at regular intervals. This is the purpose for the Launch Agent included in this install package.
The Launch Agent utilizes Apple's launchd process to schedule regular vacuuming of Mail using VacuumMail. You can use the included Lingon application to edit the Launch Agent to your own specifications.
You can, of course, run VacuumMail interactively if you need to do so, and it makes a great addition to your Finder toolbar. After installation, you will find VacuumMail and Lingon in your /Applications/Utilities folder, and the Launch Agent in your ~/Library/LaunchAgents folder. (The installer will make one for you if you don't have one yet.)