Decode mailboxes with pipe character


(beatrixwillius) #1

I’m the developer of a macOS application that archives emails from different mail clients. Thunderbird is supported. Some enterprising user has mailboxes with the pipe character ("|").

How do I decode those? Whatever I rename a mailbox in Thunderbird to everything after the pipe character becomes 8 characters.

“something | else and even more” becomes “something 8a5ce7dc”.

I poked a bit around in the files. One reference I found were to the SQLite database. Where the “something 8a5ce7dc” was together with the original name of the mailbox. Another reference was in the “panacea.dat” file. I was astonished that the really very special Mork format still is in use.

Is there something that I have overlooked?

Mit freundlichen Grüßen/Regards

Beatrix Willius

http://www.mothsoftware.com
Mail Archiver X: The email archiving solution for professionals


(Matt Harris) #2

I am not a developer but the comment here. should give you a starting point. It would appear that the pretty name is stored in panacea.dat and the folders MSF file. So I do not think decode is the correct word. Replace is perhaps more like it. The numbered version being what is used on disk and silently replaced by Thunderbird with the “pretty” version. You will find I think the MSF file is also MORK :slight_smile: Such a wonderful file format we still use it for the address book as well.


(beatrixwillius) #3

Hi Matt,

thanks. I checked the msf file and it really contains the “real name”. The discussion you linked to mention illegal names. Is the pipe considered illegal? At least I wasn’t able to add this to a mailboxname on my test IMAP account.

So I need to find a way to parse the insanity called Mork. Blech, the only parsers I found were in Python. Which hates me.

Regards

Beatrix Willius


(Matt Harris) #4

My understanding is nothing is really considered illegal, but some things will cause the operating system to barf and those are munged to the operating system so the file system accepts the modified name. But we still see folk insert /\ into names and for some odd reason all hell breaks loose :slight_smile: because they are “valid” operating system operators. There is no accounting for ignorance really.

I suggest you actually have a look at the souce code. This might be a good starting place.
https://dxr.mozilla.org/mozilla/source/mailnews/base/util