I’m excited!
I recently migrated all my mail to [GMail](mail.google.com), and the
fact that it keeps an archive of _everything_ by default (just as I
have done explicitly using via server-side rules for years before now)
inspired me to return to my old project of getting some [Emacs mail
client](http://www.emacswiki.org/emacs/CategoryMail)—any client—to show me all the messages in a conversation, even if
they’re not all in the current folder.
I started with [Wanderlust](http://github.com/wanderlust/wanderlust) because, after all, [Gnus](http://www.gnus.org/)’s [IMAP
implementation](http://josefsson.org/nnimap/nnimap.html) is pretty broken. I had been getting something like
this functionality with Wanderlust using [Mairix](http://www.rpcurnow.force9.co.uk/mairix/) on the server side.
Mairix will do a fast search over the Maildirs generated by a dovecot
IMAP server and create a new Maildir containing links to all the
matched messages. It also contains the built-in ability to find every
message in the same thread as another message, so it almost seems
ideal. The downsides:
1. You have to either wait long enough for a server-side cron job to
update the Mairix database and make sure the message whose thread
you want to find has been indexed, or force a “quick” update (not
really all that quick when you have Gigs of message history) and
wait for that to complete before you can even do the search.
2. I can’t run Mairix on Google’s servers. Some people get around the
problem of having no ability to run programs on the remote
mailserver by running a local dovecot server and using offlineimap
to sync it with the remote one, but this is a pretty resource- and
sysadmin-intensive approach and I always worried about the cost to
my laptop’s battery.
So I began by attempting to extend the functionality of
`wl-summary-jump-to-parent-message` (\`^’), which currently is able to switch
to NNTP in case the thread migrated from NNTP to email. I figured I
could replicate the basic functionality and look up the parent message
in Gmail’s “All Mail” IMAP folder instead of going to NNTP.
Unfortunately, that experiment was a failure. Maybe I didn’t try hard
enough, because I never really got it to work at all, but after a
while I intuited that following that avenue would require WL to gather
up enough history from “All Mail” to include the first message in the
thread. I knew from experience that, even if it “worked,” it was
going to be dog-slow.
Next, though, I thought I’d see how well WL’s built-in “filter folder”
feature worked with GMail’s IMAP implementation. So I picked a
message from my INBOX from which I’d already deleted many messages,
looked at it raw (\`,’), and grabbed the first message id from its
References: header field. Then I constructed a filter folder named as
follows:
~~~~
{{lang:txt}}
/(references:
~~~~
Then I entered the folder, expecting it to take a long time. Wow,
that was fast! I’m not sure if I ever really tried this with my
dovecot server; It might actually have worked. Just to be sure this
was going to keep performing, I tried a filter that would have to go
way back in history—I asked it for every message containing “status”
in the subject line:
~~~~
{{lang:txt}}
/subject:status/%[GMail]/All Mail
~~~~
It was just as fast. I know I’ve never had wanderlust load up
messages from this account going as far back as 2002, so I’m pretty
confident that this is working. It seems to me that automating the
creation and entering of such a folder should be really easy, and
that’s what I’m going to do next.
But there’s more to do. For example, I want to be able to update the
INBOX’s read/unread state of individual messages, and do the other
manipulations (such as relabeling the whole conversation) that GMail
makes so easy from within a conversation view. I’ll keep you posted
on how that goes.
Pingback: Gmail Adds Rich Text Email Signatures | EmailTimes.info