Tag Archives: Thunderbird

Thunderbird Can’t Create Mailbox Node When Archiving Email Messages

For quite some time, I’ve been getting an error whenever I tried to archive an email message on an IMAP server for the first time during a Thunderbird session (i.e., archiving the first email after starting Thunderbird). All subsequent archiving operations would be error-free until I restarted Thunderbird. (Note: I’m using Thunderbird 3)

After pressing Ctrl+A to archive an email message, Thunderbird’s Activity Manager would contain the following error:

“The current command did not succeed. The mail server for account Account Name: Can’t create mailbox node /path/to/mail/Archive/: File exists.”

Despite much searching, I wasn’t able to find anyone else who encountered this problem when archiving an email message. So, I worked around the problem by just remembering that the first message I archive had to be archived twice, because the first attempt would fail and the message wouldn’t leave the inbox.

Today, I discovered the solution. After setting up a new IMAP account, I didn’t receive any error archiving email messages from this new inbox. However, the Archive folder had a subfolder named 2010. Aha! So, Thunderbird must be trying to create a similar folder in my other account and failing. Well, I don’t need these annual subfolders, so turning off the behavior should take care of the problem.

Fortunately, it is possible to disable the annual folders created by Thunderbird’s archiving feature:

  1. Click on Options in the Tools menu
  2. Click on the Advanced tab icon
  3. Click the Config Editor button (if you receive a facetious warning about voiding your warranty, just accept it)
  4. In the Filter text box, enter granularity
  5. Double-click the preference mail.server.default.archive_granularity and enter the value 0

With the granularity set to zero, Thunderbird won’t create annual subfolders in the archive folder. This finally got rid of the error because the problematic server didn’t allow a mailbox folder to have subfolders.

Thunderbird Run Now Filters Fail on Custom Headers in IMAP Messages

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.