My experience with tagging IMAP messages in Thunderbird is that those tags will be saved on the server (from what I read they as stored as IMAP keywords), so they are synced, but if you access the same messages with another Thunderbird profile (e.g. from a different computer), you have to re-create the tags in Thunderbird first, and then only will it be able to show those tags on the messages. In other words, you have to tell TB that "those tags exist" or it will not be able to see them.

Two questions:

1/ In the case of a lost Thunderbird profile, which used to contain a lot of tags, is it possible to see all the tags that have been saved to the server, in order to retrieve them? (Either on a per-message basis, or globally)

2/ In the case where the TB profile still exists, is there a way to extract the tags that have been defined in that profile, and then import them to another profile? Or sync them between profiles without having to manually recreate them all?

2 Answers 2


I'm still very interested in an answer to my first question, but regarding my second question, I found out that the tags are actually saved in the "prefs.js" file, which is in the Thunderbird profile folder. Example for the tag "Important":

user_pref("mailnews.tags.$label1.color", "#FF0000");
user_pref("mailnews.tags.$label1.tag", "Important");

(User-defined tags are also found in that file; not just predefined tags.)

So saving this file is probably a good way to easily make a backup of the tags that have been defined in Thunderbird. As for restoring those tags in another profile, I have not tested it, but maybe simply copying those lines in the file (when TB is not running) would do the trick.

Edit: I now have tested it and can confirm that it works.

Also, as mentionned by @Hovestar in their answer, the tags can be put inside a user.js file instead of editing the prefs.js directly (which isn't recommended). The content of the user.js file will be copied to prefs.js when Thunderbird launches.

It should be noted that this only works one way. Tags created in Thunderbird will not automatically be copied into user.js. So this method is useful to import tags into Thunderbird, but you cannot rely on this file to export your tags.

Also, I ran into a small encoding problem when using this approach: special characters (such as "é") in user.js appeared as "é" in prefs.js. (This was only visible in the file itself, not in the Thunderbird interface.) But saving the prefs.js file with UTF-8 encoding was enough to solve this problem.


To add more detail to @s427's answer the prefs.js file is located here: C:\Users\USERNAME\AppData\Roaming\Thunderbird\Profiles\_FEWRANDOMLETTERS_.default\ There is a comment on the top telling you not to edit this file, and that it's better to edit a user.js file.

Either way, go into the source computers prefs.jsfile and copy all the lines with mailnews.tags and go to the destination computer where you'll make a user.js file in the destination and paste the user_prefs in.

  • Thanks for this info. I just tested it and can confirm that it works. The tags inside User.js are copied in prefs.js when Thunderbird is launched.
    – s427
    Mar 18, 2020 at 11:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.