Recover deleted or corrupted Thunderbird messages
It sometimes happens that I delete a mail by accident because it does look like spam or like a message that I do not longer need access to. Thunderbird does not display that message anymore if it is completely deleted from the mail client. While it is first moved to the trash folder if you delete it from the inbox, deleting it from the trash or the spam folder removes it permanently from the client.
Unknown to many is that Thunderbird does not delete messages right away when that is happening, but flags them only which means it is relatively easy to recover corrupted or deleted mails as long as the mail folder has not been compressed in the meantime.
So, even if you delete the trash or remove spam, the messages are still stored in the index files that Thunderbird uses.
Compressing removes flagged emails, those that you have deleted, from the mailbox so that you can't recover them anymore once that has happened.
Recover deleted emails in Thunderbird
Open the Thunderbird Application Data folder which is located in your document and settings folder in Windows.
The easiest way to get there is to click on Help > Troubleshooting Information and click on the show folder button on the new page that opens up.
Select the appropriate Thunderbird profile if there is more than one and click on Mail in that profile. You get a listing of all your email addresses. If you setup Thunderbird to have different mail folders for every email address you have to click on the folder of the email address of the message that you want to recover. Otherwise Local Folders is the way to go.
The important files are those without extensions (Trash, Sent, Inbox ..) - locate the one that contained the mail(s) that you have deleted or are corrupted (do not show up anymore). Open it in an text editor, you could use notepad2 for instance for this purpose. Some folders may be rather big so choose a text editor that can handle large files.
Thunderbird needs to be closed completely while you are editing the files.
All mails are basically stored in that file. The important part for us are the lines X-Mozilla-Status which defines a certain state of a message such as Read, Unread or Deleted. Search for the message(s) that you want to recover, the easiest way to do so is to search for its subject or the sender's email address, and edit the X-Mozilla-Status: XXXX line into X-Mozilla-Status: 0000 for unread or X-Mozilla-Status: 0001 for read messages.
Recovered messages will appear at the bottom of the folder and should be there after you start up Thunderbird the next time. You sometimes have to delete the .msf file to make this work. If you edit the file Trash you will have to delete the file Trash.msf afterwards if the mails do not re-appear after a new start of Thunderbird.
Update: Please note that you find the Mail folder under C:\Users\username\AppData\Roaming\Thunderbird\Profiles\random.default\Mail\ in newer versions of the Windows operating system.
Advertisement
Hi
Your Method is very useful and easy to use. I recovered my lots of emails by this method. But recently I started using Outlook and I transferred my all Thunderbird data to Outlook. During this process, I lost some of my important emails. I’m looking for a method to recover them too.
Thank you, thank you, thank you – I lost a huge email yesterday (when I pressed send it disappeared) and this has saved me about two days work rewording it. (I’ve now saved the body as a text file lest the same thing should recur!)
I just lost two folders entirely by losing the actual files, I did some research, here is the result. The global-messages-db.sqlite exists in all profiles and is a database with the text of all emails optimised for searching. The actual email data including attachments are usually in the “Mail” folders. I lost two folders and managed to recreate all emails by fetching them out of the global-messages-db.sqlite with this command:
sqlite3 -line ~/.thunderbird/xf5qyjk5.default/global-messages-db.sqlite “select date,id from messages where folderID = 52”
You need to check what your folder number is and there you go.
You then just have to do some reformatting (check other email files) and then put the file into your “Mail” folder.
Well done! It’s a life saver. I was able to recover 900+ emails that thunderbird had disappeared with ! Thank you so much !
Thank you………..so much…….. you have saved nearly 4000 mails, and saved me from many problems..
Glad you were able to recover your emails.
Superb One.. Not many issues solved like this… Very Useful…….
THANK YOUUUUUUUU !!!!!!
More info at http://www.z-a-recovery.com/thunderbird-deleted-messages.htm
Thank you so, so, so, so, so much. You just saved me 2 hours or more of writing an e-mail :)
you are an absolute sweetheart!!!! It worked.
Thanks, top tip! Thought I’d lost everything and now I’m getting it back as I edit each file. Top banana..
Excellent tip nearly paid $20 for a program that does what you describe
Thanks
thank you! That looks like a great resource
This has been a veryyyy useful post. It really works. I had about 1200 emails in my inbox and samn they were not opening. Even though the folder used to show up in thunderbird, but when I used to click on the inbox folder I was not able to see my previous emails !!!! I tried everything nothing work. Thanx a million for above posts. Just downloaded textpad, opened the inbox file (it does not have any extension, so choose open all files option in textpad). It took a while for textpad to open since mine was 800MB file. Pressed F8 search for X-Mozilla-Status: 0001 and replaced with X-Mozilla-Status: 0000
Thank you so much!
It never worked for me and have been losing mails mysteriously. I have infact lost more than 6ooo mails
Thanks for knowing me about removing deleted mark into the mbox file of thunderbird. It helped me a lot.
My PC crashed but I had a back-up of the email folder but not my profile. I rebuilt the PC and restored my email folders. Everytime I went into one of my keepers folders, it deleted my emails. Since I didn’t backup my profile, I had to reset the ‘recover disk space’ to not delete emails (every folder and the server in the accounts setup), modify every X-Mozilla-Status to 0001. You can only do this if you still have your .msf file
The technique works only if you have not done a “Compact” operation on the mail folder.
THANYOU THANKYOU THANKYOU – set text editor to replace all x-delivery-status: 0008 with x-delivery-status: 0000 and it worked!!!!
Thank you! this worked really well. I have a 100+MB mail file .. all mail was deleted. There were heaps of different mail status flags being used and 851 emails so I wasn’t going to do it by hand. So I opened it in Textpad (from textpad.com) pressed F8 and used the following find query: “X-Mozilla-Status: [a-z0-9]\{4\}” (no quotes).. replaced with “X-Mozilla-Status: 0001”, clicked replace all and it is done! :)
Is find next expression u mentioned is right. I am getting an errot
thank you so much for this article. I deleted when I shouldn’t have and now I have recovered them. Thank you, thank you, thank you….
Worked a treat for me. Actually, it worked even better than I’d hoped: migrating email from Thunderbird to GroupWise, I managed to lose about 18 months worth of email from one of my most critical folders. Or so I thought. Your suggestion allowed me to recover all my previously “lost” email by simply editing a single X-Mozilla-Status line. Not sure why this worked, and I don’t particularly care, ’cause I got my email back. Three cheers.
today i dont’ know inbox the email all move to trash. please back to inbox .