One of my few complaints about OSX's Mail.app is that it can be slow when opening large folders like the trash or when opening Smart Folders.
- Close Mail.app
- Launch Terminal
- Type the following:
sqlite3 ~/Library/Mail/Envelope Index/ vacuum
(if that's hard to read, there is a space between 3 and tilde and a space between slash and vacuum)
That's it. Fire up Apple's Mail.app and enjoy the new found speed!!!
Or, if you want to take this one step further, download the Mail Vacuum Automator Action and use it as a recurring iCal plugin.
NOTE: Instead of using the default Mail Vacuum action, I've modified it slightly for my purposes, adding the "Quit Application" Automator Action as step one to ensure that Mail.app is closed before the vacuum. I then saved the entire flow as an iCal plugin. Works for me.