Much as I’m sold on Mozilla Thunderbird as an email client, it did give me a bit of a scare recently. I have a folder used to store email from a mailing list that dates back to the beginning of the decade and contains around 45k emails! However recently I noticed all the emails dated before the middle of last year had gone missing. Now unless you’re just lucky with the timing, restoring from backup will almost certainly result in lost email, so there is motivation to figure out what’s gone wrong and solve the problem. In case anyone else out there has the same problem, here is my solution.
The problem is not that any email has been lost, but that something has gone wrong with the summary file – where Thunderbird keeps a summary of the emails in a folder, so it can speed up the by not having to read through the whole email database – and you’re just not seeing some or all of your emails.
I’ve actually come across this problem before – although sorting it out was much easier that time. The first time I right clicked on the folder and brought up its properties. On the properties dialog there is a button titled “Rebuild Index”. The first time I encountered the problem simply clicking on this button (and being patient while Thunderbird does whatever it does when you click this button) was enough to get back all my missing mail. Naturally I tried the same thing this time around, but it didn’t work, and after trying it a few tries I realised none of the email in this folder was visible any more!
Clearly Thunderbird was getting very confused about something!
My next try was to actually look in directory where Thunderbird (running under Windows Vista in my case) keeps its email database. I noticed that for each email folder there is a file (with the same name as the email folder) without an extension, and another file with the same name with the .msf extension, the former being much bigger than the latter. That led me to guess that the latter is the summary, and I thought possibly if it wasn’t there then Thunderbird would just rebuild it. So, first thing, obviously, I shut down Thunderbird and backed up all email – so if anything went badly wrong there would be no problem with being able to restore the email to its original state. Next, I delete the .msf file, then restarted Thunderbird and clicked on the problem folder.
Happily, I observed the progress bar indicating progress on the status bar at the bottom of Thunderbird’s frame window. When the operation completed, I had all my email back and visible!