Turbulent Sky
Tech Tips, Tricks and Solutions

by

After updating from Mozilla Thunderbird 1.5 to 2.0, I noticed that a manual filter that I had set up stopped working when I clicked the Run Now button. Today, I found a painless and effective workaround for it.

This problem occurs under the following conditions:

  1. The folder is on an IMAP server
  2. The mail filter contains one or more rules that match a custom header
  3. The filter is run manually by selecting “Run Filters on Folder” from the Tools menu or by going to the Message Filters dialog, selecting a folder from the “Run selected filters on” drop down list and then clicking the Run Now button

Note: Filtering on a custom header will work on incoming IMAP mail, just not when run manually on IMAP folders.

The reason the filter fails is that the filter functionality in Thunderbird 2.0 was changed to search the local cache instead of the server and the cache doesn’t contain custom header information, only the standard headers. This change was made because some IMAP servers either don’t have search capability or their implementation is broken.

So, in order to get the filter to work again, Thunderbird needs to have a local copy of all the message headers. Bug 184490, After-the-fact Filters on custom header (eg “User-Agent” or “Newsgroup”) won’t match for IMAP messages, documents this problem and David Bienvenu, in comment #50, gave a very nice workaround for it.

The workaround simply downloads all the messages with all the headers to the local repository for offline use. Hence, Thunderbird can now see all the custom headers and filter on them. To employ the workaround, simply do the following:

  1. Right-click on the folder you want to filter
  2. Select Properties
  3. Click on the Offline tab
  4. Select the “Select this folder for offline use” checkbox
  5. Click the Download Now button to make sure your local copy is up to date
  6. Click the OK button

Now, when you manually run your filter(s), they work! What a relief it was to find this.

Post a comment

20 Comments

  • Andrea says:

    Oh my, thank you so much for posting this! I was going insane trying to figure out why it wasn’t working. ^.^

  • PeterRidge says:

    Thanks for the feedback, Andrea. I know just how you feel. I was going crazy too when my filters stopped functioning. Glad it worked for you as well.

  • jard says:

    Thank you for your post, I couldn’t figure out why my X-Mailer filter wasn’t properly working ;)

  • PeterRidge says:

    You’re welcome, jard. Now if I could just figure out why filters fail intermittently when there are lots of new messages (e.g. a couple hundred) in my IMAP Inbox (i.e. when I log into the mail server).

  • Anonymous says:

    Thanks for this information.
    It whould be great if developers find an other way to download only headers.

    I wrote the info on thunderbird’s page of french Ubuntu’s documentation (doc.ubuntu-fr.org).

  • Dogsbody says:

    Thank you so much for this. I was having the same problem with with custom views that I wanted to run against a folder. Doing this fixed it great :-)

  • Anonymous says:

    I too am very pleased to find out why this isn’t working.

    But, forgive me if I don’t think the workaround is very good.

    If I wanted to download every single mail body, I wouldn’t be using IMAP, would I?

  • Peter Ridge says:

    @Anonymous: No need to apologize. Not all workarounds are ideal. Actually, the only ideal workaround is not needing a workaround. ;-)

  • Alan says:

    Just what I needed. I thought I was loosing my mind. I had no idea why my List-Id filtered messages wouldn’t work when I had to recreate my profile. Now I do and the fix works. Thanks!

  • Peter Ridge says:

    Thanks Alan. Yeah, it’s an elusive one.

  • Jake says:

    Thanks for the blog post. Save me another 10 frustrating minutes of trying to get me messages filtered.

  • Rado S says:

    Thanks very much, a very annoying dysfunctionality. :-/

  • Charles T says:

    Thanks a bunch, this really had me extremely perplexed. Custom headers are very important for my spam filtering!

  • Peter Ridge says:

    You’re welcome, Charles. Happy spam filtering!

  • Ian Young says:

    Perfect! This addressed my exact problem.

  • Alexander says:

    Thank you so much!!!

  • Dan says:

    The whole point of IMAP folders is to take advantage of remote mail storage. If I have to download the messages “for offline use”, I might as well use POP. My IMAP folders have 2 to 12 THOUSAND messages in them. This is hundreds of megabytes. While I can and DO appreciate a work-around, I am angry that this kind of gross negligence made it through QA and still is not fixed in the latest Thunderbird.

  • Chris says:

    yep, still an issue with Thunderbird 3.1.9

  • I’ve been trying to use this workaround without success for a while.

    Turns out, my Thunderbird (Icedove) Offline Settings had “synchronise the most recent 2 weeks” and “Don’t download messages larger than 50kB” set. I don’t remember setting them, but I can’t rule it out…

    So just something to watch out for if you’re not getting the results you expect from manual filtering with the given workaround.

  • Peter Ridge says:

    @Paul: Yeah, good caveat. Thanks for the feedback, Paul.

Post Comment

Please note: Comments are moderated by an Admin and may not be publicly visible right away.


Creative Commons License This work by Peter Ridge is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License.
Turbulent Sky Theme by Peter Ridge, based on BlueMod Theme by FrederikM.de