Qoba.lt

27th dimension of the Internet

Thunderbird for a large number of emails

by , on

Thunderbird is an excellent email client. I have been using it for many years now, sometimes to follow messages from mailing lists with a lot of activity. In this case, it becomes mandatory to tweak the configuration options to make life easier. I wrote the initial version of this document two years ago. It was addressed to my colleagues, but I realised that it might also be useful to other people, and worth publishing on this blog.

Sorry about mentioning GMail this much: I certainly do not want to encourage the reader to use proprietary services, it just happens I had to use GMail at work when I wrote this document.

Thunderbird logo. Copyright © Mozilla, file under MPL2
Thunderbird logo. Copyright © Mozilla, file under MPL2

So here are some tips about Thunderbird configuration. I use most of these, but you should consider them as suggestions, and see what setup works best for you!

1 Improve Your Workflow

1.1 Working with Threads

Thunderbird can display messages by threads. Use this feature according to your preferences. Note that you can “watch” an entire discussion, marking at once all current and future messages of the thread as emails to follow. If you set up rules to automatically delete old messages, you have the possibility to prevent deletion of watched threads. There is a keyboard shortcut for watching a thread: W.

Note that unlike GMail, that does not reorder threads, Thunderbird do reorder them when the threads are listed by dates: the “most recent” threads are the one that received messages last (while on GMail, “most recent” threads are the one that were initiated last). You can set mailnews.sort_threads_by_root option to true if you wish to change this behaviour (see Tweak the Preferences).

1.2 Using Labels

Thunderbird and GMail do not handle labels in the same way. GMail’s labels are considered as IMAP subdirectories by Thunderbird. But it is also possible to add labels in Thunderbird. Do not hesitate to use them: coloring the line of an email can make it much easier to find it again later in the email list pane.

Another advantage is the possibility to search for messages with a specific label, making it easy to instantly retrieve all the emails of a certain category.

You can add your own labels to the default set proposed by Thunderbird. If you apply several labels to an email (with filters, for instance), the color used in the pane is the one of the label with the lower ID number (so important always win).

1.3 Setting up Filters

You have two ways to use filters: on the server (in GMail for instance) and on the client side (in Thunderbird). Both places may be useful. For example, you can automatically apply labels in GMail to filter your emails and dispatch them to different directories, steering for example all messages from a given mailing list to their associated folder. And you can later filter in Thunderbird to add a color label, to highlight, for instance, all emails addressed or sent to someone from your group or company on this mailing list; or all email whose subject or body contains a particular keyword you have interest in.

1.4 Creating Virtual Folders

Virtual folders are filtering folders: it is easy to create them from a search. For instance, I can create a virtual folder that will display all emails containing “Qobalt” in their subject; or another one automatically regrouping all the emails I sent to a list. Those folders are “virtual” in the sense that emails do not “belong” to them, they remain in their original folders and are only displayed in virtual folders as matching the search results.

1.5 Writing in Plain Text

Only send plain text messages when you write to mailing lists. See the documentation for output content format for available options.

1.6 Deleting Emails

Mind that by default, deleting (or “deleting immediately”, without using Thunderbird’s trash folder) emails from one of Thunderbird’s folders will not remove it from GMail’s “All mail” folder. If you have subscribed to a mailing list, this can leave thousands of messages undeleted on GMail, or worse—downloaded on the “All mail” counterpart on Thunderbird.

To avoid this problem, go to your “Account Settings”, select “Server Settings” in the left pane, and then look for the section that starts with “When I delete a message:” and has three options. The option “Move it to this folder:” should default to the Thunderbird local “Trash” folder. Change it instead so that it points to the “[Gmail]/Trash” folder, so that messages actually gets deleted out of “All Mail” when the trash is emptied. As a complement, you may want to empty the trash each time you close Thunderbird.

1.7 Retrieving the local URL of a message

Thunderbird assigns an internal URL to each message it receives. It can be useful to get a link to a desired message from your inbox. To obtain the link:

  1. Open the error console (from “Tools” menu, or by hitting ctrl+shift+J)
  2. Enter the following code

    var hdr = top.opener.gFolderDisplay.selectedMessage;
    alert(hdr.folder.getUriForMsg(hdr));
  3. Click on the “Evaluate” button.

Warning: this URL is dependent on the folder where the message is stored, and may change if you move the message.

When you have the ID of a message, you can open it directly in Thunderbird by providing it on the command line, such as in:

thunderbird -mail \
    imap-message://fname.lname%406wind.com@imap.gmail.com/INBOX#1234

More details here.

1.8 Playing with the Layout

Most messages received on mailing list are wrapped to 80 characters or so. So if you have a wide screen, it may be worth considering using a vertical layout to display the thread pane and the message pane (you can change it in View menu › LayoutVertical view (more details here). It avoid loosing space at the right side of the email contents pane, and prints a much longer list of emails in the other pane.

Seriously, if your screen is wide enough, you should absolutely try this.

2 Tweak the Preferences

2.1 Using the Config Editor

Some preferences cannot be changed from the configuration interface, and only the “Config editor” can be used to modify them (other than editing directly your configuration files, maybe). You might be interested in some of them, see next subsection. The editor is available in SettingsAdvancedGeneral tab › Config editor. You can usually perform a web search on the names of those properties to obtain their full description.

Also, this page lists a lot of options, but note that the dots in the option names are surrounded with spaces, as in mail␣.␣default_view_flags, which can make a search on the page fail if you do not account for it.

2.2 Some interesting options

Applying filters on all IMAP subdirectories (by default, they are only applied to the INBOX directory)

  • mail.server.default.applyIncomingFilters: "true" (⚠ must be declared as a string, not a boolean ⚠)

Display emails by thread, by default in all directories

  • mailnews.default_view_flags: 1

Change format of the quote header for reply mails (see also the add-on below)

  • mailnews.reply_header_ondateauthorwrote: "#2 #3, #1:" (adapt to your needs; see the doc)

Plain text emails: actually wrap mails before sending (not only for display)

  • mailnews.send_plaintext_flowed: true (boolean)

3 Install some useful Add-ons

Here is a list of add-ons that I use and that you could find interesting, in particular if you send source code patches to lists.

Change quote and reply format

I send emails in various languages, and I prefer to have a language-agnostic header above quoted messages in replies. I’m using this format for the header: %%5 ~ %%1, and this one for a custom date format: %Y-%m-%d %H:%i UTC%z. | Download the add-on | Web page

Colored diffs

Color diffs sent by SVN / CVS / Git / Mercurial… | Page on addons.mozilla.org

FiltaQuilla

Adds many new mail filter actions—launch a file, suppress notification, remove star or tag, mark replied or unread, copy as “read”, append text to subject. Also add new filtering methods (including regex). | Page on AMO

Generate patch command

From a given email, generate a command line to reply on the same thread with a patch (it formats the --to, --cc and --in-reply-to options for the git send-email utility). | Page on AMO

Toggle Headers

Allows to switch between the normal header view and viewing all headers when viewing a message by using a keyboard shortcut (H). In particular, this is another way to access the “In-reply-to” header of an email (and to use it later with git send-email). | Page on AMO

4 Additional references