Over time Mozilla’s Thunderbird may happen to require some maintenance in order to continue running smoothly. Symptoms could be that either you cannot find mails that are supposed to be there, mails are doubling without any reason, or deleted mails show up again in its original folder.
Note that Thunderbird must be closed (and really not running) for the next steps to be successful. You then need to navigate to your profile folder and execute the given commands at the root of this directory.
So a first task is to delete all folder-specific index files. The intended effect is that Thunderbird will re-created the index files automatically next time it is started to then show (again) the correct content of the respective mail folder.
On Linux or MacOS this can be done via the following command, at first in form of a dry run to just list all relevant files:
find . -name "*.msf" -type f
Next let’s delete all of these files:
find . -name "*.msf" -type f -delete
Another task is to delete the global search database. The intended result is that all mails can be searched (again) and that the query performance might even be increased. Similar to folder specific index files, it will also be automatically re-build next time Thunderbird is started. Deletion can be performed via the following command:
rm global-messages-db.sqlite
On rare occasions when having to move to a new computer or operating system, here are some guides on how to migrate the complete mails and configuration:
- “Moving your profile folder” by MozillaZine
- “Moving Thunderbird Data to a New Computer” by Mozilla Support
When it comes to maintenance the following add-ons have proven to be useful:
- Remove Duplicate Messages (Alternate) – As the name already suggests, a convenient way to identify and delete duplicates in your folders.
- ImportExportTools – Very useful when changing to or from another mail client as it supports different mailbox formats like mbox or eml.
However according to a recent security audit of Thunderbird and Enigmail, the “add-on architecture of Thunderbird allows an attacker to obtain your email communication through compromised add-ons”. In other words, think twice before installing any add-on and leave it installed only if you really need it, like Enigmail for mail encryption.
Needless to say to keep Thunderbird always up-to-date and to regular perform backups.
P.S.: If you like to support further development of Thunderbird: https://donate.mozilla.org/en/thunderbird/.