Skip to content

Speeding up Thunderbird Search with IMAP

I like the Thunderbird email client a lot (Thunderbird2).  I used to use and love pine, though, so perhaps you should take any accolades with a grain of salt.

I use Thunderbird with IMAP so that I don’t have to worry about backing up my email locally, and so that I can always ssh in and view new mail if I’m on a different computer (‘less’ is my mail client then!).

It has a lot of plugins, but the only one I really used was lightning, the calender/task management plugin.  And then I got a Palm, and haven’t been able to find any way to hook the calendar on the palm up to lightning (there is support for syncing contacts).

Anyway, one thing that got me really riled me up was the slow search.  This post illuminated the facts for me; it wasn’t Thunderbird that was slow, it was my IMAP server.  I upgraded my IMAP server to dovecot 1.1.7, that being what my hosting provider supported.  Dovecot has a nice full text search installed by default.  Or at least I thought it was nice.  It couldn’t be worse than no full text indexing at all, I figured.

However, my hosting provider didn’t provide that plugin–whoops!  I downloaded the same version of dovecot, ran ‘configure; make; make dist’ and copied over all the fts *.a *.so and *.la files for both fts and fts_squat to the plugin directory.  Then I enabled the fts plugin in the dovecot.conf file, including changes recommended for fts_squat, and restarted dovecot.  My full text searches (in Thunderbird quick search) for folders with 6000 messages, went from 4.5 seconds to 1 second.  Quite the success.

I then wanted to figure out some way to search for multiple areas in the quick search box.  I already found that you can use the pipe symbol as an or operator but that only applies to a given type of search (for subject, or body, etc).  What I was looking for was a way to search for ‘from sue’ ‘to anton’ and ‘body contains spaghetti’, all in one search.

I searched and searched, looking at the IMAP rfc and trying many different variations.  I looked at plugins.  I looked through the config editor.  I tried the Thunderbird tips page.  No luck.

Then I read a post that talked about the two ways to search.  Quick search (the box in the upper right hand corner of the email client) and normal old search, the one you get to by typing ‘control-shift-f.

This does exactly what I want!  But it’s cumbersome.  It’d be great to take a page from Yahoo Mail and implement their search shortcuts in the quick search bar: ‘from: ‘ for from, etc.  It’s a killer feature for me.

Anyone know of a plugin that does this?  This page has some keyboard shortcuts, but that’s not really what I’m looking for.  And I didn’t see anything in the Thunderbird bug list, though this bug seems like it might be heading down that path.

Anyway, those are my recent adventures in email.

5 thoughts on “Speeding up Thunderbird Search with IMAP

  1. Ralph Dosser says:

    How do you archive? Do you throw everything in one folder, or do you break it down?

    I’ve been using year/month folders (IE archive/2008/03), but that makes searching awkward. I wish there was a way to search on a folder and have it include all the sub-folders.

  2. moore says:

    In the past I’ve had issues with TB locking up when I had too many messages in my inbox.  So I archived by date (6 or so months in each folder). I thought it was thunderbird, but given my research, it may have been my imap server.

    I agree that not being able to search all folders is a pain.

    One way to search across multiple folders in Thunderbird is to use a saved search: http://kb.mozillazine.org/Saved_Search#Searching_across_multiple_accounts and just edit the properties as needed. The first time you search across all the folders, it takes a long time (downloading all those messages), but the second time was relatively quick.

    The other is to use this TB plugin: https://addons.mozilla.org/en-US/thunderbird/addon/1339 Make sure you set the search type to expression, and you can use control-enter to search across all folders.

  3. Ralph Dosser says:

    Nice, thanks!

  4. Yeroc says:

    Check out the GMailUI (http://sites.google.com/site/kmixter/gmailui) plugin. I think it does what you’re looking for in terms of searching. I use it mostly for the keyboard shortcuts but it adds nice searching capabilities as well.

  5. Stephen says:

    Something to note in the newer Thunderbirds, the search sometimes stays local. Spent ages trying to figure out when the dovecot indexes weren’t being built until I stuck on imap debug and watched the search complete with no traffic to the server.

Comments are closed.