Inconsistencies between data/folders on disk and data that's (ignored) in Thunderbird
The general issue I'm trying to sort out is message data (mbox/sbd/msf files) in the filesystem not showing up in Thunderbird. I'm not talking about the case of deleting an email account without moving data to Local Folders. I've used Thunderbird since it was Netscape, I have a few GB of data, and for years I've noticed this kind of thing happening here and there. Not much but it happens.
I'll give a concrete example that just happened. I cleared out all the messages and subfolders for an account by moving them to the "Local Folders" in the application. So in terms of messages the account is now empty (inbox, sent, drafts etc all empty). Then I deleted the account from settings and quit Thunderbird. Then in the filesystem I expected / hoped that it would just be some empty files/folders. But not the case - I saw two problems. One was that there were some messages from years ago that hadn't showed up in the app for a long time - they were quietly sitting on the drive being ignored by Thunderbird for years. The other problem was that I cleared out the inbox like I said but despite being empty in Thunderbird the data was still there in the filesystem. And then you'll see below I couldn't reimport it to double check it was what I thought it was.
So - here's what I did to try/fix the above (thanks to reading these forums by the way). The non-inbox stuff was okay to get back - I made a directory in Local Folders, copying the mbox/sbd/msf files over in the file system, started Thunderbird, and moved them elsewhere inside Thunderbird - done! When I tried that with the mbox/sbd/msf files for "Inbox" folder nothing would work to make them show up in Thunderbird (doing the same thing - copying files to Local Folders as above). I also tried ImportExportTools and it did create the mbox/msf files but Thunderbird ignored them. At that point I tried comparing the inbox files to where I'd moved them in Thunderbird before deleting the account and the data files exactly match (used Beyond Compare) - so it's not corrupt files. Also it's not in a long subdirectory beyond some limit.
So any ideas on why 1) the non-inbox files imported fine but were ignored for years before I moved them? Can't be corrupt since they worked fine after moving them yes? 2) Any idea why inbox file wasn't empty even though Thunderbird showed that I'd cleared it out? 3) Any idea why the Inbox messages are readable inside Thunderbird in the spot I copied them to before deleting account but despite an exact binary match for the files I can't get Thunderbird to recognize them with the Local Folders trick that worked for the non-inbox files? I know I can just delete the file since they match but want to know that's going on for the future.
Thanks for taking the time to read this =)
All Replies (3)
Please explain how or where you saw "some messages from years sgo". If you're using the default mbox mail storage, you shouldn't expect to see discrete messages in your file system.
Are you familiar with how compaction works in Thunderbird? A deleted message remains in place until the folder is compacted. So it would be quite normal to find deleted messages inside mbox files.
First - Thanks for reply =)
I don't mean single discrete messages. The only unit of message measure I'm talking about is folders of them. So Inbox and Inbox.msf are a group of messages but only 2 files (and maybe Inbox.sbd folder).
I forgot you had to compact folders for them to be finally removed in filesystem so I think that resolves most of this immediately. So thanks for that!
Bullet pointing issues left:
- The main problem - disappearing messages (folders). I remember finding folders that disappeared that I'd never have deleted and them being years old so no way they weren't compacted. BUT - you can't debug a memory so I'll ask again if I see it happen again. Hopefully it was my error. The ones sitting in front of me when writing this - I can't say for sure they weren't deleted and not compacted.
- The Inbox not being empty - that's explained now... I just didn't compact it before deleting account.
- The issue of me not being able to import that old Inbox is less solved to me - although there's no practical problem here - I'd just like to understand. I successfully moved the Inbox data (messages) to a folder "A" in Local Folders from inside Thunderbird before deleting the account. When I try to restore the leftover messages in Inbox for the account that was deleted in Thunderbird - it refuses to show them in my new folder "B" in Local Folders. It makes sense if Thunderbird refuses to restore mbox file messages that are marked for deletion (but are still here because not compacted). BUT - where does it store that info that a folder or individual messages are deleted. Because when I compare what's in "A" and what I'm trying to put into "B" folders - the mbox/msf files are binary matches. Does it store the info that it's deleted in another location/database/file?
Thanks again =)
re :The issue of me not being able to import that old Inbox is less solved to me
Try renaming the old 'Inbox' files and folders, so instead of 'Inbox', 'Inbox.msf' and 'Inbox.sbd' they are 'OldInbox', 'OldInbox.msf' and 'OldInbox.sbd'
Exit Thunderbird Then copy paste those files and folder into profile name folder \'Mail' \ 'Local Folders' mail account folder. Do not put them into any other folder. Then start Thunderbird.
Do you see the folder 'OldInbox' in 'Local Folders' mail account?
re : where does it store that info that a folder or individual messages are deleted. In the mbox file, there is a line near the start of each email : X-Mozilla-Status: not 'X-Mozilla-Status2:' this line will end in a number 9 eg: 0009 if marked for deletion. So the email has not moved. It just has a different marker.
How to get all 'marked as deleted' email to reappear:
- If you opened that mbox file using a text editor like Notepad ++
- Exit Thunderbird
- Edited all the X-Mozilla-Status: numbers from 0009 to say 0001
- Saved the file
- deleted the *.msf file
- Started Thunderbird
All marked as deleted emails would appear again.