header

Torsten Curdt’s weblog

Optimizing Mail.app index

Some while ago someone posted an AppleScript to optimize the Mail.app index. I prefer bash over AppleScript. So I just dump my version here:

killall Mail
BEFORE=`ls -lah ~/Library/Mail | grep -E 'Envelope Index$' | awk '{ print $5 }'`
sqlite3 ~/Library/Mail/'Envelope Index' vacuum
AFTER=`ls -lah ~/Library/Mail | grep -E 'Envelope Index$' | awk '{ print $5}'`
echo "before: $BEFORE"
echo "after:  $AFTER"

For more details see this blog post or hawk wings.

3 Responses to “Optimizing Mail.app index”

  1. Детская социальная сеть придет в Рунет из Израиля said, on 6. May 2008 at 16:42

    [...] Optimizing Mail.app index [...]

  2. Mariano Kamp said, on 7. May 2008 at 12:22

    Hey Torsten,

    good tip. Works well for me.

    There seems to be a minor typo in your script. When you assign the original size to $BEFORE you missed the trailing E in the variable name.

    Cheers.

  3. tcurdt said, on 7. May 2008 at 12:40

    @Mariano: Thanks! Fixed!

Leave a Reply

Please copy the string BnnFim to the field below: