Auto vacuum on mail.app database

Posted by kain Wed, 03 Sep 2008 10:42:00 GMT

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"