Posts Tagged ‘tips’

Managing Mail Madness with Mutt

Monday, December 12th, 2011

A few weeks ago, I tweeted about a great blog post on a technique for managing the massive amounts of email many of us navigate daily.

I’d become frustrated with the state of my own inbox1 and had been on the prowl for a new method to manage the email torrent.

Having used it for a little over a week now, I can say: it works wonders!

One caveat: the author uses Postbox, which has some core features that are the cornerstone of the technique.

Now, I’ve been a longtime proponent of Postbox, and I use it as my work client. But for a variety of historical reasons, my personal email-life is centered around the venerable Mutt mail client2. So, the technique described in the article works perfectly if you use Postbox.

This is how I successfully re-created the work flow with Mutt.

Labeling

The technique relies heavily on the ability to label mail, as Gmail and Postbox both easily and handily support.

Mutt calls this “tagging,” and while there’s been support for reading the X-Label header since 1.4, support to edit labels isn’t in a currently-released Mutt.

The good news: there’s a patch to support label/tag editing.

The bad news: the patch is against a pretty old version of Mutt3.

I’m a Gentoo user, so I updated the patch4 to apply to [Gentoo's] 1.5.205,6 and also wrote an ebuild8 you can add into a local overlay to make it easier to install9.

After that, add the following to your muttrc to bind label-editing to keys and display labels:

# Add X-Label to your unignored headers
unignore From: To: Subject: Date: Cc: Reply-To: X-Label:
color header brightwhite default '^X-Label:'
macro index \Cy " ~y " "Limit view to label"

The patch binds the ‘y’ key to adding, deleting, or changing a message label in both Mutt’s message and index views; the above config binds Ctrl-y to limiting the view of the folder based on a specific label.

When editing labels, they are space-separated.

Search, Don’t Sort

The “Search, don’t sort”-mantra isn’t new; but when all you have is grep, you still tend to sort your email as an initial step to being able to easily find it later.

Enter mairix10.

Setup is relatively easy: configure it with an rc file, and run it. I run it from cron every four hours to keep the index fresh, and reset the entire index every month11

Since mairix provides its results as an mbox or Maildir folder, I wrote a simple wrapper that only launches Mutt if there are results to my search and makes the folder read-only, to keep the conceptual model—these are search results, and I shouldn’t edit them—consistent.

As for sorting, I still do sort some email, mostly Twitter, Facebook, and other automated notifications, as well as mail from important people that tends to fit neatly into boundaries (my parents, certain friends, etc.)

Keeping Folders Tidy

Now that my mail is searchable, where we save it isn’t as important. Now I can move to a model of just saving everything to mutt’s default saved-messages and going from there.

Only problem is, won’t that folder balloon over time? Probably.

Cron comes to our rescue again; I have the following entry:

5 0 1 * * MAILBOX="/home/preed/mail/saved-messages-archive/saved-messages-$(/bin/date +\%Y-\%m)" && /usr/bin/find /home/preed/mail/ -maxdepth 1 -type l -name 'saved-messages' -exec rm {} \; && /bin/touch $MAILBOX && /bin/ln -s $MAILBOX /home/preed/mail/saved-messages

This makes “saved-messages” a symlink that automatically gets updated at 12:05 am every month to point to a folder with the year and month.

And mairix updates its index with these new folders the index gets reset every month.

I use this same technique for my sent-messages, spamassassin-populated spam folder, and deleted-messages folder; the last two are auto-deleted by cron six months later.

Filtering Assaults On Your Inbox

The last tenent of this email management technique is probably the most important: if you don’t want it in your inbox again, set up a filter immediately. Don’t wait.

I’d been getting spam mails from Ticketmaster forevar. I didn’t set up a filter for them until I started using this technique.
It’s a bit costly at first, but it pays off and quicker than you think.

To help with this, I set up an easy way to test procmail rules without running them on my live inbox.

I stole the scripts from this page and slightly modified them to fit paths on my system.

Inbox Zero?!!

After using this method for about a week, I was able to dump most of my inbox into a saved-messages-archive folder, and begin using the dated saved-messages folder.

I’ve been able to find any message I’ve needed to find, and my inbox now hovers around 50 messages.

Finally, people emailing me are getting responses on the order of 72 hours; before, if their message got lost in my inbox, it was hit and miss; I just restarted a four month old thread, because I’d lost track of it, and couldn’t tag it “todo.”

Have I reached Inbox Zero? No. But as the original post points out: “I don’t care about ‘Inbox Zero’ because there’ll be more [email] tomorrow as soon as the sun comes up.”

But using this technique, I’ve been able to turn my inbox into something manageable, without the fear12 that I’ll lose a message.

All in all, I’ve been very impressed with how it’s been working so far. Hats off to Mr. Ignition for the inspiration!

_______________
1 Over 2,000 messages in 75 megabytes before I started this project
2 Having used them since I was 13, my customized Mutt key bindings, cribbed from Pine, are hopelessly burned into my muscle memory
3 It’s against 1.5.1; the current released version is 1.5.21
4 PGP sig
5 Which I’m using because of an attachment handling bug in 1.5.21
6 I also hacked up patches against pristine-1.5.20 (PGP sig) and pristine-1.5.217 (PGP sig)
7 This patch doesn’t include the documentation changes; that’s left as an exercise for the reader
8 I just added one to the ebuild revision; I’d love to hear from a Gentoo-dev on whether this is the correct way to do this, because I’m betting it’s not…
9 There’s also a method to allow editing of labels using an external script, but I didn’t use this script, so I can’t vouch for how well it works
10 Which I have @scanlime to thank for turning me on to
11 A full index of my 1.6 gigabytes of mail takes 97 seconds; reindexes only look at new messages, so it’s pretty low cost
12 Which was probably largely irrational anyway

Tags: , , ,
Posted in blahblahblah, personal, tipstricks | No Comments »

V919

Deckin’ Gentoo into Tweetin’

Tuesday, August 23rd, 2011

Editor’s note: if you don’t plan on installing TweetDeck on your Gentoo box anytime soon, you can probably skip this post…

Ever since I’d started using Twitter, Echofon or the Twitter website itself had sufficed for my needs.

But recently, I found myself using Twitter in different ways—separate accounts, mostly1—than I had in the past and needed a client with a few more features.

Echofon’s releases have continued to slide in the quality department ever since they started wrapping their API keys in weird native XPCOM libraries, and on Linux at least, there’s been an annoying bug for the last few releases where the popup background is totally transparent, and takes 3-5 seconds to paint, making it impossible to read any text2.

I know some people who swore by TweetDeck though, so I decided to give it a try on my Mac at work a few weeks ago. I’ve found it to be a very capable client for what I’m starting to need.

I decided to try installing it on my (Gentoo3) Linux laptop, so I could use it at home.

After some Googling, I found some instructions from 2008 for doing exactly this.

The instructions worked… mostly; I needed to make the following minor changes:

  1. As you might expect, both AIR and TweetDeck have changed since then; one major problem is Adobe keeps moving the link for the AIR SDK around (which you need, because they apparently don’t ship just-the-runtime on Linux [anymore?]). This is the current link: http://www.adobe.com/products/air/tools/sdk/thankyou/linux.html.
  2. When you get to that page, you need to have JS on so that the auto-download starts; in some awesome release engineering failure, the link-to-the-thing in the “If it does not start, download it here”-text IS DIFFERENT (and won’t work with the 0.38.1 version of TweetDeck) than what you get if the download JS fires4.
  3. There is one minor error on the instruction page which will trip you up: it says to launch the app with: /opt/AIR-SDK/bin/adl -nodebug /opt/AIR-apps/application-name/META-INF/AIR/application.xml /opt/application-name; directory naming preferences aside, this is wrong. The second argument should be the same as the directory-portion of the first argument, i.e. /opt/AIR-apps/application-name in this example.
  4. If you get the error message “Invalid application descriptor: descriptor version does not match runtime version” that’s because you downloaded the link-the-”OMG DOWNLOAD HERE”-text links to, which won’t work5
  5. When I got TweetDeck launched, it came up (looked as pretty as the Mac, too!), but immediately started complaining about it “having trouble using some of your passwords that are stored securely on your machine. Clicking Submit6 will clear this data so that you continue to use TweetDeck”; it’s nice enough to send you to a FAQ page, but this page talks about deleting your Gnome keyring and all sorts of other draconian solutions; read the ENTIRE PAGE before following any of its instructions.

    In my case, it turned out that since I’m using XFCE (but still have all the Gnome goop installed), Air couldn’t figure out that it wanted to use Gnome7; you need to set GNOME_DESKTOP_SESSION_ID=1 in the environment, and it will work fine.

Other than that, everything has seemingly worked OK!

the only (notable, admittedly) problem that I’ve run into is when I click URLs that aren’t something TweetDeck loads internally, nothing happens; I have to copy/paste.

That may be something with my default web browser in the Gnome goop not being entirely set, though.

I’m looking forward finding all the various bits that kept everyone raving about TweetDeck!

_______________
1 @SoberBuildEng for professional stuff, @preed for personal stuff, and the always-popular @ShitPreedHears for… “stuff”
2 Let’s not discuss the bit about how these types of Firefox extensions aren’t the type Mozilla cares to support anymore, cf. rapid release, and say we did…
3 No ricer jokes!
4 Which, for the record, is a 32 meg file: 95af29afa9b01d0b75d430f854f1c3a061f3fbf7 AdobeAIRSDK.tbz2
5 It’s an old version of the SDK that isn’t compatible with the current version of TweetDeck
6 Which is confusing, because there’s only an “OK” button…
7 It actually told me this in the terminal: Unknown desktop manager, only Gnome and KDE are supported

Tags: , ,
Posted in blahblahblah, tipstricks | 4 Comments »

V843