2

My Mail.app program is ridiculously slow. I have several email accounts and I just checked the size of my Mail folder (~/Library/Mail): 593.2MB.

That's huge...no wonder it's so slow. So the question is, how do I minimize the size? I refer back to old emails all the time, so I am reluctant to just purge my email folder. I have thousands of emails.

Is there an easy way to make this smaller and will that help with the speed of this program?

I have a MacBook Pro 2.5G GHz Intel Core 2 Duo with 4 GB 667 Mhz DDR2 SDRAM. I am running Lion 10.7.2.

2
  • 600 MB is huge? Since when? Thunderbird manages my 4.28 GB of mail with no issues. It sounds like you need a better mail client.
    – Fake Name
    Feb 13, 2012 at 21:52
  • Is your hard drive busy with other tasks while you are running Mail? Try running Activity Monitor and choosing the Disk Activity tab at the bottom of the window to see how much activity is taking place.
    – bneely
    Feb 14, 2012 at 0:42

1 Answer 1

6

You might try the following:

  • Quit Mail first

  • Run the following command in Terminal:

    sqlite3 ~/Library/Mail/V2/MailData/Envelope\ Index vacuum;

This will rebuild your Mail index data.

Below is the actual shell script that I use. I keep it in ~/Library/Scripts/Applications/Mail so it is accessible from the AppleScript menu in Mail.app

#!/usr/bin/env bash

mail_data_dir="/Users/$USER/Library/Mail/V2/MailData"
killall -HUP Mail
BEFORE=`ls -lah $mail_data_dir | grep -E 'Envelope Index$' | awk '{ print $5 }'`
/usr/bin/sqlite3 $mail_data_dir/Envelope\ Index 'PRAGMA integrity_check';
/usr/bin/sqlite3 $mail_data_dir/Envelope\ Index vacuum;
AFTER=`ls -lah $mail_data_dir | grep -E 'Envelope Index$' | awk '{ print $5}'`
echo "before: $BEFORE"
echo "after:  $AFTER"
open -a "Mail.app"
/usr/bin/osascript -e 'tell application "Mail" to display dialog "Envelope Index before: " & "'$BEFORE'" & return & "Envelope Index after: " & "'$AFTER'"'

When run it will automatically quit Mail. Run the command to rebuild and check the integrity of your Mail index data, restart Mail and present a dialog box showing you the before and after sizes of your Mail index file.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .