Skip to content
June 2, 2007 / Upnishad

Recover corrupted/deleted LOCAL emails in Thunderbird.

I have always loved Thunderbird…but my love crossed all bounds today. Somehow in the morning, somehow (dont blame the birdy) my local folders got corrputed and I missed lots of mails from a specific very dear folder…I panicked but my faith in the birdy never wavered.

I remembered that birdy never actually deletes any mails until I compact the folders. I tried to google and found this superb article..

In a nutshell, you can recover those long gone mails as follows :
(Disclaimer : This will work only if you have not compacted the folder)

– Turn off Thunderbird, do not compact.
– Using your OS, locate the file without an extension and with the same name as the Thunderbird folder where the messages were last (might be Trash) in your profile folder http://kb.mozillazine.org/Profile_folder#Thunderbird
For example, the Inbox file rather than inbox.msf or inbox.sbd.
– Open this file with a simple text editor.
– Change the digits after X-Mozilla-Status all to zero for those messages you wish to undelete if they still exist.
– Save the file
– Turn off the text editor
– Delete the file of the same name with the extension .msf. Example Trash.msf. This will rebuild the message index.
– If you are religious, say a prayer to the deity or saint of your choice
– Say a prayer to Murphy
– Restart Thunderbird

This works like a charm….

Technorati tags: ,

35 Comments

Leave a Comment
  1. Nicole J. LeBoeuf-Little / Jul 3 2007 10:06 am

    I remembered that birdy never actually deletes any mails until I compact the folders.

    How do I love thee? Let me count the ways…

    ClamWin (free antivirus software) just now told me I had the Kakworm in one of my Thunderbird account’s Inbox file. I knew this posed no real threat, as Kakworm only exploits a long-patched hole in Outlook or Outlook express… but I didn’t want to have to hear about the Kakster every time I ran ClamWin.

    So I found the text “kak.hta” in the Inbox file, paged up to find the (six-year-old) email it was associated with, went into Thunderbird and deleted that email, emptied the trash… and *still* the dang email was hanging around! Couldn’t find it in Thunderbird, but it was still there in the Inbox file. GahhH!

    And then I found your blog post and realized why: I hadn’t compacted folders since deleting the infected email!

    Although you were trying to recover email and I was trying to trash it, your discovery was just as useful here today as it was for you when you posted this. So thank you, thank you, thank you. All credit will be given you (and the MozillaZine forums) when I blog today’s little worm-hunting adventure. Thank you.

  2. tovorinok / Jul 5 2007 7:51 pm

    Hello

    Great book. I just want to say what a fantastic thing you are doing! Good luck!

    G’night

  3. paeisls / Oct 5 2007 7:07 am

    Hello,

    Thanks for your useful posting. But my case is a bit different and I cannot find a solution yet.

    After doing “compact folders” all emails in my Inbox are gone. I just do not know where they are

    kept, but I really need to restore all of them back to my Inbox.

    How could I do that? I have been searching for how to restore emails back to the Inbox in

    Thunderbird, but I could not find anything.

    I am using Thunderbird 2.0.0.6 (20070728) on Windows Vista. And I guess I did compact folders more

    than once and hope that it did not make my case even worse.

    I desperately need all the emails back before my boss finds out and fire me.

    Thank you very much.

  4. geek-o-pedia / Oct 5 2007 11:27 am

    Yes, if you compact a folder in Thunderbird, there is no way to get the emails back. Compacting a folder means that they are deleted permanently.

  5. Holly / Jan 4 2008 7:07 am

    This was really useful to read — not only in getting my emails back but in figuring out how to delete the spam w/viruses permanently. Thanks!!

  6. gokul / Jun 5 2008 6:34 am

    I accidently deleted this folder. And I am trying to follow your steps but I am not able to locate any file without any extentsions. My folder is named as MeetingMinutes but I am seeing only MeetingMinutes.sbd and MeetingMinutes.msf and not anything without extensions. Any help?

    • Mac File Recovery / Feb 9 2010 4:46 pm

      You can use Stellar Phoenix Mac File Recovery software demo version which is absolutely free which will show you the recovered files and data…gud luck

  7. upnishad / Jun 6 2008 2:01 pm

    Did you compact the folder ? That might be the reason.

  8. upnishad / Jun 6 2008 2:03 pm

    @paeisls, compacting the folder does permanent damage. You can not recover anything now.

  9. upnishad / Jun 6 2008 2:04 pm

    @Nicole J. LeBoeuf-Little : Sorry for a very late reply, I just missed your comment, Thanks for appreciating this post.

  10. shweta.puja / Jun 23 2008 6:48 pm

    i want my mail back some emportent mails deleted today

  11. Geek / Jun 24 2008 10:15 am

    @shweta, Try following the exact steps as per this article. Chances are that you will be able to recover those important mails.
    Cheers !

  12. holl / Aug 4 2008 7:37 am

    I’m trying to recover my deleted inbox files but every time I try and open that inbox file to change the numbers, it will never open. The kb for the file is massive so I don’t think any of my text editors can withstand it. What should I do?

  13. upnishad / Aug 4 2008 10:27 am

    @holl :
    1. You need to use : Textpad to handle large files.
    2. You must change the message numbers in the inbox files as described in the article.
    “Change the digits after X-Mozilla-Status all to zero for those messages you wish to undelete if they still exist.”
    This will definitely work

  14. blackrhino / Sep 11 2008 8:08 pm

    thanks!
    my two pennies:

    I’ve found (I don’t remember where) an easy way to do this with an text editor and e regex. As the text editor doesn’t work for a 800MB file… I went with sed in linux.
    0001 is for ‘read messages’.

    sed -e ‘s/X-Mozilla-Status: [a-z0-9]\{4\}/X-Mozilla-Status: 0001/g’ Inbox > Inbox2

    gene_x

  15. Igor / Oct 17 2008 2:11 pm

    HELLO. CAN ANYBODY HELP ME PLEASE?

    I have compacted my folder in Thunderbird. Now my messages are corrupted. They are in strange code – ASCII – some of my emails are empty when opened, even when there is a size of message showed. for example 1Mb or so.

  16. Geek / Dec 29 2008 12:20 pm

    @blackrhino : Might work..have to give it a shot
    @Igor : If you compact your folder in Thunderbird, you can not recover them.

  17. Shekhar Ganji / Jan 15 2009 12:08 pm

    I tried today and it worked . Thanks a lot for the article .

  18. Greg / May 31 2009 1:58 pm

    I could Kiss you 😛

    Thank you so much for this article…. 🙂

  19. Vince / Aug 29 2009 8:47 am

    Is the same applicable on a MAC ? The corrupted folder is a disaster for me.. help…

  20. the-geek / Sep 30 2009 6:20 pm

    @Vince – This is not specific for windows and this is not an application. This is an approach to recover lost emails from Thunderbird (and only Thunderbird)

  21. egy / Aug 7 2010 12:03 pm

    Bagi teman – teman yang pernah mengalami harddisk rusak
    – no detect- partisi hilang- terformat- fdisk- virus- corrupt
    – delete- hidden..dll…..bisa dikonsultasikan atau di recovery data
    bisa datang ke ertech komputer.
    Alamat nya: jl.karang rejo x/36 surabaya (daerah ketintang)
    Hub : 031 72357968/081330029001
    Saya dulu pernah menyelamatkan harddisk no detek
    Disini memang benar ok banget.masalah harga bisa di nego,
    Trims ertech berkat ertechcom dataku kembali normal.
    Semoga sukses…..teman2…!!

  22. Daniel Howard / Sep 1 2010 7:39 pm

    Thanks a million for this post, it has just helped me recover some emails, with attachments, that had vanished themselves from my inbox!!!! Strangely, when I tried out changing just one of the “X-Mozilla-Status” parameters as a test (I’m so cautious) it brought back all of the 8 emails that had gone missing.

    I am going to review the settings for compacting folders so that it does this less frequently from now on!

  23. Tempenke / Oct 19 2010 6:49 pm

    Thanks. This Work

  24. Natalie / Mar 9 2012 3:16 pm

    Thank you! On my mac, I used UltraEdit text editor to open the file because it was huge. Then at first it didn’t work, the emails wouldn’t show up in Inbox when I reopened Thunderbird.

    But when I made a copy of my Inbox and put it in Local Folders, then redid the procedure described above, only copying the edited inbox file and replacing it with the one in the Local Folders file, Voila! There’s my 50 thousand emails I was looking for!

  25. Lee / May 28 2012 10:50 pm

    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.

    • bignose2 / Jul 14 2015 2:51 pm

      I know this is an really old thread but I am struggling. Thunderbird & WIndows.

      Lost 3 months of emails, I can search them & see the start of the message but simply not in the normal list or on iMap. So from what I have learnt, some if not all is still in the search index as above.
      I have installed sqlite3 (all new to me) & trying to do as Lee says.
      Not sure about the ~/.thunderbird .. location, says database not found, tried dozens of combinations of \ or / so used full directory location.

      sqlite3 -line C:\Users\GregReed\AppData\Roaming\Thunderbird\Profiles\cwk2td7c.Karen\global-messages-db.sqlite “select date,id from messages where folderID = 52″

      This gives Syntax near error “!select” the ! is actually a little o with a upside down v on top.

      If I do the same command once opened a new DB I just get …> which I assume means unknown command & can;t do anything from here, have to ctrl C to exit.

      I have tried to learn a bit sqlite but not really sure where to start if I am NOT loading “global-messages-db.sqlite” in the first place.

      Should the above sqlite -line …. command be direct from the CMD prompt or once I have open a new .db.

      I do not know how to find what folderID mine is but figured something should load, there are not tables or anything.

      Sorry a really basic starter is needed.
      I can program MS Access Database, visual basic etc & many years ago some DOS stuff but don’t have time to learn this now so hope someone could give me a short cut.

      I can load the file into excel & sort of see some of the messages but very mixed up, no dates or structure.

  26. outlook express repair / Aug 1 2012 9:25 am

    These are truly wonderful ideas in concerning blogging.
    You have touched some good points here. Any
    way keep up wrinting.

  27. Monnie / Sep 15 2012 8:43 am

    Help. My Inbox was full and I deleted some files and then tried compact folder. Then all messages disappeared from the Inbox. Other folders are fine, Sent is intact, etc. I exited out of TB, found my profile file, located the Inbox. There is a file named Inbox without extension with 1,379,912 kb. I tried copy and paste this onto another place but got an error message saying I need to be administrator to do it. I even log in as the hidden administrator in Windows 7 and still can’t copy or rename this file. Is there still hope to recover my Inbox. When I open Thunderbird again, it still says my Inbox is full.

    • Francesco / Apr 22 2013 5:03 am

      Dear Monnie, were you able to solve this problem? I had the same one today and I have no ideas what to do now 😦 With greetings

  28. tarantino title crossword clue / Apr 5 2013 9:52 pm

    In July, 1887, a credit card applicatoin was heard inside the Clermont Warden’s Court for any reef claim 200 yards west of Hurley’s Dam, and the ‘Telegram’ states:.

    After targeting about two minutes and a half, he pulled the trigger.
    Good fishing ended up being to be been on this river all of the year round, during flood-time, so when
    water was clear fish may be seen taking the bait with a depth of 10 feet.

  29. Latesha / Jun 1 2013 1:31 am

    As such, it really should not be too difficult to spend some time constructing a database
    of tables similar to what is suggested at where they’ve provided a sample database spec for use in a college accommodation reservation application. Virus Barrier X5 is often a popular virus scanner designed for Mac computers. The Vi – O comes pre set most abundant in widely used cellular devices, such as Blackberry, i – Pod, i – Phone amongst others.

  30. marshalhubs / Jul 31 2013 12:37 pm

    HI,

    Thanks for sharing Informative article in your blog, Above tips are working for my situation. But if you are unable to recover your deleted email using above tips then you could be try another solution as a tool which can also recover your deleted email from Thunderbird email application. I would like to suggest such type of tool Stellar Phoenix email recovery. It also works for some other email application. Check yourself

  31. Johnf913 / May 28 2014 8:10 pm

    Howdy! Do you know if they make any plugins to protect against hackers? I’m kinda paranoid about losing everything I’ve worked hard on. Any recommendations? bdcbccegdcek

Trackbacks

  1. kristinpowell.com.au » Blog Archive » Recover corrupted/deleted LOCAL emails in Thunderbird.

Leave a reply to shweta.puja Cancel reply