Auto vacuum on mail.app database
As you probably know (this is an old trick) it’s possibile to speed up mail.app by vacuuming it’s database, which is created with sqlite.
There’s also a trick to perform an autovacuum on it, here’s how:
Quit mail.app then open a terminal and issue the following:
sqlite3 ~/Library/Mail/Envelope\ Index ".dump" > EnvelopeIndex.sql
Add
pragma auto_vacuum=1;
to the top of EnvelopeIndex.sql
rm ~/Library/Mail/Envelope\ Index sqlite3 ~/Library/Mail/Envelope\ Index ".read EnvelopeIndex.sql"