Posts Tagged ‘envelope’

VacuumMail: Automated Mail vacuuming via Launchd

Sunday, March 18th, 2007

Leland Scott has taken the best bits of several scripts that automate the vacuuming of Mail’s Envelope index and rolled them together into a solution that will automate the cleaning process using Mac Os X’s Launchd service.

The result, VacummMail, is a clever little utility that can be run anytime with two clicks of the mouse for a manual clean up.

It features a series of dialogs that tell you what is about to happen and what has happened, which is always satisfying:

Vacuummaildialog

Even better, the process can be automated by placing the app into your /Applications/Utilities folder and the included plist file into your ~/Library/LaunchAgents folder.

By default, this will run the app at 1 pm every Tuesday. If that time doesn’t suit, it can easily be changed using Lingon , an open source launchd configuration file editor:

Lingonvacuumamil

You can get VacuumMail from Leland’s web site .

  • Digg
  • Facebook
  • Delicious
  • StumbleUpon
  • Evernote
  • Share/Bookmark
Tags: , , , , , , ,

Scripts to automate the Mail.app Envelope speed trick

Saturday, March 3rd, 2007

SpeedymailThursday’s tip about trimming the fat out of Mail’s Envelope Index for a leaner, faster Mail.app got a fair bit of coverage.

Two readers liked it so much that they have produced applescripts to do the job.

Sebastian Morsch has written a script that quits Mail, runs the sqlite commands and then relaunches Mail at the end of the process. You can get the script from his web site.

“pmbuko” has written another, which does the same thing (modified as suggested in the comments below by Romulo — Thanks!) :

tell application “Mail” to quit
set sizeBefore to do shell script “ls -lah ~/Library/Mail | grep -E ‘Envelope Index$’ | awk {’print $5′}”
do shell script “/usr/bin/sqlite3 ~/Library/Mail/’Envelope Index’ vacuum”
set sizeAfter to do shell script “ls -lah ~/Library/Mail | grep -E ‘Envelope Index$’ | awk {’print $5′}”
display dialog (”Mail index before: ” & sizeBefore & return & “Mail index after: ” & sizeAfter & return & return & “Enjoy the new speed!”)
tell application “Mail” to activate

It gives you some feedback on what happens:

Optimisemailscript

You can grab the text of the second script above or download it in a zip file I’ve uploaded to the site.

Obviously, the law of diminishing returns is in play here. The first time you run it, the benefit is tremendous. Run it again soon after and there is not so much bloat to remove and, hence, not as great an improvement.

IcalalarmStill, as some have pointed out, this should be a regular maintenance routine for Mail. You can wait for the Mail Development Team to implement it or with one of these rules and iCal, you can automate it yourself.

All you need to do is create a recurring event in iCal and use the “Run script” option in the alarm feature to run the script.

So, save the script somewhere sensible — I saved mine in the ~/Library/Scripts/ Applications/Mail folder.

Create the event.

Click on the alarm field in the event’s information pane, and select “Run script”.

When prompted, navigate to the script and select it.

I’ve added an end for the event after 100 instances because my Palm really hates events with no end date. You may be luckier.

Now you can enjoy a lean Envelope Index long after you have forgotten about the tip.

[With thanks to Sebastian and pmbuko]

UPDATE: If you prefer Automator to AppleScript, Steve Weintraub has created an Automator action to do the same thing.

  • Digg
  • Facebook
  • Delicious
  • StumbleUpon
  • Evernote
  • Share/Bookmark
Tags: , , , , , , , , , ,

A faster way to speed up Mail.app

Thursday, March 1st, 2007

SpeedymailUPDATE: A number of posters in the comments have pointed out that it is possible to run this command on just one line in the Terminal and to leave some of it out. See the comments if you are interested in more fancy ways to get the job done.

As everyone knows, it is possible to get quite a speed boost out of Mail.app by stripping all the bloat out of its Envelope index, an SQLite database Mail uses to store senders, recipients, subjects and so on.

In a past Hawk Wings tip , I suggested that quitting Mail, deleting the Envelope file and restarting Mail would force a rebuild that produces a leaner, faster email experience.

In October last year Dallas noticed a faster way to get the same result and posted it in the comments to that tip.

And there it remained until I noticed that Shaun Inman (an iCelebrity and developer of Mint which counts the peeps on Hawk Wings) had noticed it.

Here it is.

1. Quit Mail.

2. Open Terminal.

3. Type the following:

cd ~/Library/Mail
sqlite3 Envelope\ Index

An sqlite> prompt will appear.

At that prompt, type vacuum subjects;.

After a short delay, the prompt will return. Type Control-D to exit.

4. Restart Mail and enjoy the extra speed.

The first time he tried this, Rob Griffiths of macOSXHints reduced his Envelope index from 25.9MB to 4.5MB. My result was less dramatic (21.6MB -> 17.6MB) but Mail.app still felt a lot more zippy.

Some anecdotal evidence suggests that POP users don’t see the same reductions. Can any POP user out there confirm this?

UPDATE: It is easy to automate this using iCal and an applescript. See “Automating the Envelope speed trick“.

  • Digg
  • Facebook
  • Delicious
  • StumbleUpon
  • Evernote
  • Share/Bookmark
Tags: , , , , , , ,

Address Book and Mail icons in four colours

Monday, November 20th, 2006

LeopardmailFrench design company mac@dam has produced a set of twenty icons in four colours revolving around a “mail theme”.

The icons which come in silver, black, red and blue, include the classic Mail.app stamp icon, a letter box, an envelope and an “icard”.

I am pretty confident that the animal in the icons is a leopard although at first sight I thought it was one of those wicked flying monkeys from the Wizard of Oz.

Addressbookmailicons

If you fancy one of these, changing Mail.app’s default icon is easy.

The icons are freeware and are available in the Downloads section of Apple’s web site.

  • Digg
  • Facebook
  • Delicious
  • StumbleUpon
  • Evernote
  • Share/Bookmark
Tags: , , , , , , ,