Fix invalid filenames in Thunderbird

I want to travel for a while and need winfdows 7 for that. I want to copy my Linux Thunderbird profile with many years of emails across to windows7 then back to Linux when I’m finished with win 7.

I copy the “profiles” folder at ~/.thunderbird/profiles folder over to win 7. Being thorough, I then run the windows app “chkdsk” to see if windows dislikes what I did in a filesystem context. Chkdsk finds three illegal filenames in the copied folder. The filenames contain colons. They are as follows:

  • a directory named “mailbox:”
  • a directory named “mailbox:.sdb”
  • a file named “mailbox:.msf”

I try to manipulate them in windows (e.g. rename, delete, open, whatever) and get error messages about invalid names.

It sounds to me like the items really are corrupt. So now I have a partially corrupted Thunderbird that works in Linux and doesn’t work in windows and has years of emails in it.

How do I straighten out Thunderbird in Linux? (I’ll worry about windows later)

What’s the problem in Linux? You say it works in Linux and I assume the files and directories don’t have those colons in them (because they shouldn’t). So assuming that the colons were somehow introduced by the copying process and only appear on the target (Windows) disk, I don’t see why you think the items actually are corrupt in your Linux installation. Very confusing.
If it was IMAP mail, such as Gmail, the solution would be fairly straightforward: download the messages (or message headers, more likely) from the server to the Windows installation of Tbird.

What’s the fs you copied to, or through? Mailboxes on Tbird can be very big, I’ve met the situation where it was copied to an USB-stick with FAT32 on it. All copied even though the db was about 6GB in size. The XP version (at that time) threw one error after the other. When we repeated the whole procedure through an NTFS fs things were alright, except for this: we needed to rename the profile’s folder, the …default/

Tb mailboxes can be big but often shrink dramatically when recompacted. I had 90+ gig shrunk to 3 gig or so in minutes…

I assume the files and directories don’t have those colons in them (because they shouldn’t

The colons are indeed part of the filenames in Linux. I never noticed it before (because I don’t look in .thunderbird). I checked my long series of auto-backups. The filenames are wrong in all the backups. It’s a Linux phenomenon.

@Knurpht – it happened in Linux. The whole profile is only 263 MB (I keep it tidy). The win fs is NTFS. No clues there, it’s a Linux corruption.

Not a size problem (& thanks).

Hi swerdna. Which email client are you looking to use in Windows 7?

I realise this doesn’t actually answer your question, but I’m thinking only about extracting your valuable mbox files. Forgive me if I’m off track, and you may know this process already… but if using Outlook, there is a free Windows app called IMAPSize with a utility called mbox2eml that can convert mbox email files into eml files (digestable by outlook). Essentially you would need to do this for every folder you have set up in Thunderbird. (That may be a tedious process for you depending on your email folder organisation).

How to Export Mail from Thunderbird to Outlook Express and Other Email Programs - About Email

Export Thunderbird to Outlook

The utility “hexedit” available as an rpm can be invoked with a /dev/drive_partition argument. It has a search function in hex that should find the filename. It can then be modified and written back to the device.

I offer ABSOLUTELY NO WARRANTY on the results, but I have done it on other file systems. I have also been known to trash file systems.

I’m not sure why you have a colon in the name I don’t here.

swerdna, this might be an alternative for you, I use a truecrypt container for my mail, simply NTFS formated and link I thunderbird to that simply by changing my profile.ini in .thunderbird:

[Profile0]
Name=Default
IsRelative=0
Path=/media/truecrypt1/Thunderbird/default
Default=1

for you this would have 2 benefits

1- you travel, if you laptop gets stolen your mail will be a bit safer in a truecrypt container then not.

2- you just have to copy the truecrypt container over to your win7 and be done, when you get back you copy it back. I even had it so far both my winxp and opensuse had access to the same one when I was still on a dual boot.

Thank you for the replies.

I backed up my Thunderbird data and then changed the names of the offending trio of folders & file, dropping the colon out of the name, and started Thunderbird. There was no drama – it started well. But the drafts folder of one of the eight email accounts had disappeared. The corrupted names must have related to that drafts folder.

So I drafted an email and saved the draft and the drafts folder reapepared and all is well again.

So I transferred that Linux Thunderbird profile to win 7 and it worked with no further complaint from windows chkdsk.

So all is well, thanks for your suggestions. I will look at truecrypt and at exporting between Tbird and microsoft outlook, those ideas are interesting even though the problem is solved.