Restore Deleted Email in Thunderbird
After using Thunderbird for several years I noticed my backup of it kept increasing. It had always seemed bigger than it should be as I only keep a few emails archived in it. Eventually I saw an extension called XPunge which stated that Thunderbird does not delete your emails (even if you empty the Trash folder) unless you compress the folders (which is what that extension does by clicking on the button they provide). This made me realize that this was why my email backup was becoming so big. So as long as you don’t use the compress folder option in Thunderbird, you have the ability to restore your deleted email, including the attachments.
Go into Thunderbird’s profile folder then inside the Mail folder. Now depending on how many email address you have setup in Thunderbird it could be in several folders, but it will be named with either Local Folders or with the POP address you are using. (You can find out easily by going to Tools >> Account Settings and then going under the account you want to restore email address for and look under its Server Settings and at the bottom look at the path for Local directory). I’d recommend closing Thunderbird once you know where to go. Make a backup of the file called Inbox (Note: it’s the one with out an extension, Inbox.msf is for something else). Now open up Inbox in your favorite Text Editor (Notepad, Crimson Editor, Notepad++, etc.), it may take a few minutes to load depending on how big the file is, some of mine were over 90MB. Don’t open it in WordPad, since it will add formatting to the file, also keep in mind Notepad on Windows 98 has a file size limit and won’t handle really huge files. Now you can search for whatever emails you are looking to restore, or have fun looking at really old emails. When you find one you want to restore, scroll up and change number after X-Mozilla-Status: to be a 0 (zero). It’s okay to just make it a single zero rather than a four digit number. Don’t bother changing the X-Mozilla-Status2. Do that for each email you want to restore. Then save the file. Open up Thunderbird and it should now be in your Inbox marked as Unread (Note: it may take awhile for it to read that Inbox).
Thank you so much for your description!!!!
Feb 18, 2007 at 5:37 pm • 1In Mozilla 1.4, there also is this Inbox file. Mine was 340 MB.
This is at the same time a very good archiving feature.
Maike from Hamburg
What do you do if you deleted the folder, and then emptied the trash?
Mar 19, 2007 at 12:55 pm • 2It doesn’t matter if you empty the trash as long as you don’t compact the folders. However I’m not sure what to do if you deleted the folder, but I think it should still restore it and make it showup in your inbox.
Mar 19, 2007 at 9:56 pm • 3Thanx
Mar 27, 2007 at 3:07 am • 4If I do aht you wrote my folders are clear. There is no single mail in it, Not even the mails that still are in my inbox if I open thunderbird. What’s wrong there? Or did I do something wrong…?
May 25, 2007 at 10:07 am • 5Do you mean your folder is empty? Or that the “Inbox” file is empty?
Make sure you open the file in the right folder
In Windows 2000 and XP
X:\Documents and Settings\YOURWINDOWSLOGINORUSERNAME\Application Data\Thunderbird\Profiles\YOURPROFILENAME\Inbox
(Be sure to open up the file just called “Inbox” Don’t open up Inbox.msf)
May 25, 2007 at 4:31 pm • 6Ok, I got my mistake but now I have another problem. If I want to open the file in any text editor (I tried ms word and notepad) it does not work. word says the file has to many mbs for this programm. Notepad tries to load oit but then says …”notepad recognized a server mistake and has to be close…” not exanct the same but from the meaning. I guess it is because the file is to big for notepad also…?
So what can I do now?
P.s. I tried it with my trash folder and it works. but i recogniezed that it onlly shows me the mails which where in it today. (I have not compressed the folder.) Is it normal that you only got the mails from “today”?
May 26, 2007 at 10:47 am • 7Don’t open it in Word, it will put extra formatting in the file. You’ll need to use Crimson Editor, Notepad++ or some text editor that can handle very large files without putting formating into the file. I thought Notepad in WinXP could handle big files but maybe not, I know it can handle bigger files than Notepad in Win98 could. I wouldn’t bother with the trash folder, only modify the file called Inbox.
May 27, 2007 at 10:24 am • 8my thunderbird account was deleted. I don’t know who was deleted it. All message both income and outcome were deleted. How to restore my account and all my messages??
Jun 20, 2007 at 7:12 am • 9Thank you
Triyana from Indonesia
Did you restore from a backup?
I recently setup a new install of XP and I noticed that when I setup my new XP machine I had a different login name (it was different from the last one I had) and so I had to update what Thunderbird was looking for.
If so goto Tools -> Account Settings and go under the account you had setup and look under Server Settings and see what Local Directory is pointing at.
It maybe pointing to an old login or another login you had. If its one that doesn’t exist Thunderbird will try to create that folder and if it can it will all be blank. It could also be pointing to another profile folder (the ones with wierd names).
Jun 22, 2007 at 6:45 pm • 10Hey there,
Thanks for the really helpful article.
My inbox had 100 messages and was corrupted. I looked at the file and found that it’s almost 3gb (I’ve never compressed it). I’ve tried to open it with TextPad, copy it, burn to DVD, etc. and it errors out at 46%. I also tried to edit with TextPad without opening it — same thing.
Any thoughts on how I can repair the file so I can restore the missing emails?
Thanks for your time!
Jun 30, 2007 at 1:46 pm • 11Trevor
If your using Thunderbird 2.0 you might try this to fix the corrupted inbox folder:
Jul 1, 2007 at 11:09 am • 12Right-click on that inbox folder and select Properties -> General Information, then click on Rebuild Index. That may fix the file, I’m not sure if it will keep the deleted emails or not though.
i deleted a contact years ago can i still get his e-amail address
Jul 12, 2007 at 12:33 pm • 13If one of the deleted emails is from him you can get it.
Jul 16, 2007 at 9:03 am • 14People like you make the web what it is.
Many thanks.
Jul 29, 2007 at 10:16 am • 15Excellent post mate. life saver. thanks so much
Aug 4, 2007 at 7:37 pm • 16Hi,
I did compact folders and all mails in my Inbox are all gone. I really need to restore them back to my Inbox. How could I do that? I desperately need your helpl.
Thank you very much.
Oct 4, 2007 at 6:38 pm • 17oh, by the way, I need to restore emails from my Inbox that I have not deleted them yet. But after doing “compact folders” they are all gone.
Where would they go after we do compact folders? How could we restore them?
Thank you very very much.
Oct 4, 2007 at 6:39 pm • 18I’ve never heard of emails disappearing from the inbox if you compact the folder but never deleted them. Where they flagged as spam? Do you have a backup of your Inbox?
Oct 4, 2007 at 7:52 pm • 19Unfortunately, I do no have any backup. Today is my first time to use Thunderbird and I just messed up.
Oct 4, 2007 at 8:41 pm • 20Real Lifesaver.
Oct 19, 2007 at 1:51 am • 21Thanks, I’m automatically processing my father’s folder right now!
Thanks for this.I was able to restore an email and attachments which were very important to my work. One thing though,it would not restore to my name folder,only to the Local Folder.From here it was a simple matter to restore to my inbox and problem solved.I also downloaded Notepad++ to edit the file with and this program is now my editor of choice.Again thanks very much.
Oct 26, 2007 at 6:03 am • 22I am having some trouble with this I’m going to the right directory and everything else for what i need but the email folders have all the msf files but there is no files like inbox or trash or any of them that are not .msf files yet the msf files show that there is file size to them could the inbox file be deleted?
Nov 22, 2007 at 8:08 pm • 23It might be in another Windows Username folder or another Thunderbird profile.
(On Win 2000 and XP)
X:\Documents and Settings\WINDOWSUSERNAME\Application Data\Thunderbird\Profiles\THUNDERBIRDPROFILE\Mail
The easiest way is to check the settings in Thunderbird so you know where to look.
Go to Tools -> Account Settings and go under the account you have setup and look at Server Settings and see what Local Directory is pointing at.
Nov 23, 2007 at 8:09 am • 24I deleted unknowingly in my trash folder, how to find out my mails
Jan 7, 2008 at 12:32 am • 25I accidently deleted my account and therefore also the folders I created in my “Inbox”. I can get some of the e-mails back in the “inbox”, but how do I get the folders back?
Jan 18, 2008 at 7:55 pm • 26lakshman, the trash file should still exist for you to restore the emails, trash.msf, I believe is just the trash folder for Thunderbird to use and not the file with all the data. Open up trash in your Thunderbird’s profile folder and open in a text editor and make the changes I mentioned in the tutorial.
Søren, in your Thunderbird’s profile folder you should see a file named whatever your folder was called without an extension. For example if you had a folder called personal, you should see 2 files: one called personal and another personal.msf. The one without the extension is the one you want to open in a text editor and make the changes I mentioned in the tutorial, (treat it like its the inbox file).
Jan 21, 2008 at 9:55 am • 27Hi. I switched hosting packages which screwed up my email. The moment I put in a password, all files and subfolders were gone. I am using IMAP and i think that was why it removed all the emails as they were no longer on the server. Thing is… I’ve browsed the INBOX file which resides in the account folder along with INBOX.msf. I suppose that is the new file created. The INBOX file is big and I opened it and changed at least one message to a 0. Well I don’t see how thunderbird will bring this back considering the file doesn’t have an extension and a newer one is being used.
So I’ve tried deleting the new Inbox.msf file and renaming the old one. Once thunderbird is open, it keeps clearing out that file.
Any ideas?
Jan 25, 2008 at 1:32 pm • 28Matt, goto Tools -> Account Settings and go under the account you had setup and look under Server Settings and see what Local Directory is pointing at. Is it pointing at a new folder or perhaps one similar to what you had before but with a number 2 at the end? I’ve changed ISPs once and I think I remember Thunderbird making a new folder, due to that.
Jan 25, 2008 at 5:13 pm • 29Can you please tell me, what has gone totally wrong with the hierarchy of the folders and subfolders in my thunderbird? - Try to look at the place with two “Inbox” :S
http://img337.imageshack.us/img337/1203/faultsr4.jpg
Jan 28, 2008 at 5:32 pm • 30Søren, can you post a picture of what’s inside the folder with the file extensions turned on (not from inside Thunderbird, but from your OS)?
Jan 30, 2008 at 7:54 am • 31I don’t understand what to post
Jan 30, 2008 at 9:22 am • 32Can you please specify?
A screenshot from Windows Explorer of the folder that Thunderbird uses for that account with all the .msf and other files in there.
Jan 30, 2008 at 2:12 pm • 33Hello. I deleted all my e-mails from Inbox by mistake. It is quite annoying and consumes a lot of time to edit over 300 MB text file. Is there some other way to recover all Inbox mails? (No compacting made).
Feb 6, 2008 at 9:50 am • 34PS. Deleting Inbox.msf didnt help.
Rasmus, you shouldn’t delete Inbox.msf, perhaps you got confused by the other comments made.
The only way to restore the emails is to edit the text file. You can try using Find and Replace to make it go a little faster, especially if your text editor allows for RegEx Find and Replace, but be sure to backup the file first.
If you are using Notepad++ try this:
Go to Search->Replace
In the Find What: textfield type in
In the Replace With: textfield type in
Be sure Regular Expression is checked and then click Replace All and that should do it.
I’d recommend to start backing up your profile folder so you can restore things in the future if you ever need to.
Feb 6, 2008 at 9:19 pm • 35http://img329.imageshack.us/img329/1231/63925353mp2.jpg There you go
Feb 11, 2008 at 8:46 am • 36Søren, Thunderbird should let you drag the folders to the main Inbox? If you do that and start Thunderbird again, are there any emails in the second inbox? If not you should be able to delete the second one and the second trash folder from inside Thunderbird.
Feb 11, 2008 at 10:32 pm • 37Thunderbird doesn’t allow me dragging the folders to the main inbox - unfurtunately.
Feb 12, 2008 at 12:12 am • 38Søren you might try the Thunderbird forums on MozillaZine. I’m not sure what happened.
Feb 13, 2008 at 12:56 pm • 39After my husband did some computer maintenance today,
Mar 19, 2008 at 7:09 pm • 40we lost all current messages in the Thunderbird inbox, sent. trash, etc……..
AND the sub folders disappeared! Those sub folders had important Emails in them to use as reference. How can we get all Email back on our Thunderbird Email display?
What kind of maintenance did your husband do? Did you get a new login to Windows? If so, its possible that Thunderbird is still looking for the for profile folder under the old Windows login that it can’t find or doesn’t have permission to see.
Mar 20, 2008 at 9:36 am • 41Thank you SO MUCH for this post. You saved me from a coronary. I’d like to add something that may be useful:
- In Windows Vista, be sure to check the path your Inbox file is stored in by going to Server Settings for that particular account. It will likely be different than XP.
- If you deleted a message by holding Shift + Del to bypass the “Trash” folder, the X-Mozilla-Status will be 0009. So be sure to change those to 0 as well. I originally missed a lot of messages because of this.
Everything looks restored now. Thanks again!
Mar 21, 2008 at 9:01 am • 42This article really saved my bacon. This evening I managed to delete the entire contents of my Inbox (five years’ worth of emails) due to somehow accidentally selecting every single message before hitting Shift+Delete. My previous backup was nearly a year old, so as you can probably imagine I’m incredibly relieved. Note to self: make backups more often.
Mar 31, 2008 at 3:18 pm • 43This tip is a lifesaver! I just accidentally deleted an account from Thunderbird because I accidentally set it up as a POP account rather than IMAP. When I re-set it up as an IMAP account, all my existing Inbox mail that I’d read had disappeared.
I had to do a quick workaround to your tip to restore the mail. instead of copying the ‘edited; Inbox file to my original profile, I copied it to the Local Folders and all of my deleted email appeared. Thanks!
May 1, 2008 at 8:36 pm • 44Hi, I just opened my Thunderbird and everything has disappeared: mails, folders, account information. I did not do anything. Is there a magic button somewhere to get everythin back? The software asks me to install a new email account. Thanks.
May 3, 2008 at 7:12 am • 45Did you get a new login to Windows? If so, its possible that Thunderbird is still looking for the for profile folder under the old Windows login that it can’t find or doesn’t have permission to see.
May 3, 2008 at 9:30 am • 46Thanks. No, no new login. I did not do anything, I did not change anything. It’s very weird. But, I guess the files must be still around somewhere, it’s hard to believe they vanished completely. Any idea what I should look for?
May 3, 2008 at 11:45 am • 47See if you can find your Thunderbird Profile Folder. If so, in Thunderbird goto Tools -> Account Settings and go under the account you had setup and look under Server Settings and see what Local Directory is pointing at. It maybe looking for it somewhere else, even though your data is in another location.
May 3, 2008 at 1:25 pm • 48Great, Thanks a lot, I have located my mails !
They are in Application data > Thunderbird > Profiles
But, next, when I go to Thunderbird > Tools > Account settings there is nothing to see or adapt, it’s just an empty screen…
May 3, 2008 at 3:02 pm • 49I’m guessing it’s not pulling in the some setting from what you’re saying, but I can’t tell without several screenshots of settings in Thunderbird. You might also try the Thunderbird forums on MozillaZine.
May 5, 2008 at 2:58 pm • 50Thanks a lot, Blogger, I found what I needed. It was far from easy for a low-tech guy like me, but everything is solved.
May 10, 2008 at 8:00 am • 51Thank you so much for this article! I accidently lost my e-mails when I deleted my POP3 account. With your article, I was able to get them all back onto Thunderbird and the mail server!
May 15, 2008 at 2:09 pm • 52Very much appreciated, I had found the folder/files but had no idea what to do with them, my trash file was 47mb so I knew there was something in it. Thanks a lot, saved me a massive headache.
May 20, 2008 at 11:02 am • 53Excellent stuff - accidentally deleted mail which contained concert tickets in pdf-form.
Thanks
May 25, 2008 at 12:59 am • 54Lifesaver. You’re a total legend.
May 29, 2008 at 5:44 am • 55Can we use this technique in IMAP mode?
Jun 23, 2008 at 8:41 pm • 56I accidentally hit shift-delete on my inbox and my messages are gone. I’ve followed the steps to open the inbox file using a text editor. It’s 92MB in size. All I get is:
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ……………………
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ……………………
and so on. What am I doing wrong? I don’t see “X-Mozilla-Status” at all.
Jul 1, 2008 at 11:09 am • 57boyOz, I assume it should work for IMAP mode, but I haven’t tested it.
Jul 1, 2008 at 11:58 am • 58Anybody?
Jul 2, 2008 at 8:16 am • 59Brian, that looks like Hex. What program did you use to open the inbox file?
Jul 2, 2008 at 6:27 pm • 60