Posts Tagged ‘sqlite’

SpeedMail: Slick Envelope Rebuilding app for Mail

Wednesday, July 18th, 2007

SpeedmailMatteo Discardi has produced a nice little app to perform the “rebuild your database and speed up Mail.app”" trick.

It’s been a while since I rebuilt my own Envelope Index, so Matteo’s app shaved a handsome 1.2 MB off mine. Snappy. Snappy.

If you have somehow missed the way this trick puts a boost back into the performance of Mail, you can read about it in an older Hawk Wings post, which outlines how to do this via the Terminal.

It doesn’t offer the options to automate the clean out that you can find in VacuumMail, another app that does the same thing, but it is a nice, polished alternative. It’s polite too:

Speedmail Dialog

Matteo is offering it for free but is not refusing donations from satisfied users. You can get the latest version from his web site where he warns you that it is a beta. Back up your Envelope Index file first, unless you crave the excitement of living on the bleeding edge.mail.app, apple mail, envelope index, SQLite, productivity, speed up

Tags: , , , , ,

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 .mail.app, apple mail, envelope, SQLite, launchd, productivity, spring clean, speeding up

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.mail.app, apple mail, applescript, scripts, automate, ical, tips, envelope, speed, sqlite, productivity

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“.mail.app, apple mail, sqlite, envelope, speed boost, tips, productivity, POP

Tags: , , , , , , ,

Get your head around Smart Mailboxes

Friday, February 17th, 2006

smartfolderMacGeekery has posted a piece on smart mailboxes.

It explains what smart mailboxes are, how they don’t really “contain” emails and how, in fact, they don’t even really exist.

It also shows you how to use them to search your email most efficiently and quickly by using information stored in Mail’s own database rather than relying on Spotlight.

After digesting that, you could move on to Joe Kissell’s MacWorld article on Smart Mailboxes for more tips and tricks.

[Via TUAW ]smart mailboxes, spotlight, envelope index, sqlite, mail.app, apple mail, joe kissell

Tags: , , , , , ,