eneam / mboxviewer

A small but powerfull app for viewing MBOX files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to recreate folder structure of exported Betterbird/Thunderbird pop account (t-online)

nima-amin opened this issue · comments

Not really an issue - but: as the import/export add-on for Betterbid and Thunderbird exports an email account in several mbox files (as many as that account has folders) - how can I recreate the folder structure in mboxviewer (similar to that of opening a Gmail Takeout mbox file in mboxviewer)? Unfortunaletly t-online email like I daresay most email providers doesn't have a "takeout tool" similar to that of gmail, you can only export your emails folder-wise as eml files form the web-interface (totally unsorted and not chronological, so that is of no real use if you want a full backup in which you will be able to find anything without having to step by step open hundreds of emails until you come across the one you need), or retrieve your emails through a client such as Betterbird / Thunderbird and use the export function there (exported eml- files retain their chronology which is very good), but if you want the entire account in 1 mbox file you have a problem, or I am doing it the wrong way. I havn't found anything though.

commented

I am planning to make a new release of the MBox Viewer with the following features:

  1. Support for Thunderbird exported mbox files as a hierarchy of folders ( see attached example).
  2. Mbox files will be validated based on the mail header fields and not based on file extensions
  3. Merge files capability will be enhanced to merge valid mbox files including eml files using wildcard names and concrete names

Sounds like enhanced MBox Viewer may address your requirements, let me know.

I believe current Mbox Viewer will not merge true eml files correctly unless they are mbox files with eml extensions.

I don't have yet specific release date for this new Mbox Viewer. All above capabilities are basically implemented but testing is not completed yet. User Guide needs some work also.

Let me know whether this new release will help to address your requirements and what still will be missing.

MailTree

commented

I did a quick test to merge eml files running v1.0.3.26 of MBox Viewer and meging of email files worked. Example command to run:

mboxview.exe -MBOX_MERGE_LIST_FILE=F:\New\emlList.txt -MBOX_MERGE_TO_FILE=F:\New\mergefile.mbox

F:\New\emlList.txt content:

F:\TOnline*.eml

Not sure if that is what you are looking for. MBox Viewer will not automatically merge eml files. You need to repeat the merging for each folder with eml files.

Please provide additional comments about the issue you would like MBox Viewr to address better.

Hello, no actually I would like to merge several mboxes into one mbox while keeping the folder structure. In the attached file you see how an email account (any) is exported by Thunderbird / Betterbird. 1 mbox per folder. I can open them separately in mboxviewer, of course, and also export the mails as emls in chronological order (only mbox viewer does that great thing!!!), but if I want to keep track which folder belongs to which account I have to manually rename them so that they at least stand below each other, but it's not like a "folder tree". I would like to merge these into 1 mbox keeping the folder structure per email account similar to what you get when you do a "Google Takeout" with a gmail or G-Workspace account. There you get the entire thing in 1 mbox file, when you open it you see the tree.
TB exported emails account as mbox

You have , by the way, still some problem with UTF-8. Not only in the folder/label names (Entw_rfe instead of Entwürfe), but also written in or containig passages in Czech, Danish, French, German Spanish, etc. etc. (practically all Europen languages except English) are sometimes (not always) displayed in an odd way where characters with diacritics are supposed to be. Changing the code in the context menu doesn't help there. Strange enough, when I switch to "view as eml" these oddities are gone.

commented

Appreciate more details you provided what you are trying to accomplish. Hope you don't mind if I ask more questions. Not sure what an account means. New MBox Viewer will allow you to open the root folder and all sub-folders with mbox files as shown below. I created 2 root folders such as Account1 and Account2. Assuming account names differ, you can have sub-folders with the same name under each root.

image

Will such feature help to avoid name clashes? It doesn't allow to search all emails withing account however.

I would like to merge these into 1 mbox keeping the folder structure per email account similar to what you get when you do a "Google Takeout" with a gmail or G-Workspace account.

Do you refer here to Gmail Labels or something else?

You have , by the way, still some problem with UTF-8. Not only in the folder/label names (Entw_rfe instead of Entwürfe), but also written in or containig passages in Czech, Danish, French, German Spanish, etc. etc. (practically all Europen languages except English) are sometimes (not always) displayed in an odd way where characters with diacritics are supposed to be.

Can I assume you refer to passages in the email text? I believe I have seen occasional issue when email didn't contain character set/code in the email but it could be due some limitations in my code.

Changing the code in the context menu doesn't help there.

Below shows correct handling of Europen languages by MBox Viewer, no need to select different encoding as show below. Is that how you tried to change the language code? It helps to view the message but it would not help when printing.

image

Strange enough, when I switch to "view as eml" these oddities are gone.

Sorry but I am not sure what you mean by "view as eml". I could investigate this issue if you could provide example emails, possibly a couple of email exported as eml files. Obviously emails without confidential information.

commented

Since you reported language display issue, I looked rfc3282 and I see that are language related header fields that I am not handling such as

Content-Language: da, de, el, en, fr, it

Not sure yet what they mean and how to handle these fields. I will investigate but if you can provide example emails it would help.

commented

You can enable "Show Charsets" option to display character sets discovered and used, if any, by MBox Viewer when you select an email.

image

image

commented

I was thinking what it would take to merge all mbox files of the particular account into a single file and support Gmail style labels assuming that is what you described. I suppose I would need to traverse root folder and all sub-folders, parse each mbox file, embed folder name into each email using Gmail field as below.

X-Gmail-Labels: FolderName

I suppose the same email could be present in different mbox files. Challenge would be to reliably identify and eliminate duplicate emails, otherwise mbox file would contain duplicate mail.

commented

Ignore for now previous below comment. I did try and the feature might be broken, will investigate.

You can enable "Show Charsets" option to display character sets discovered and used, if any, by MBox Viewer when you select an email.

commented

I will prototype the suggested solution to merge all files an keep the folder structure as Labels. MBox files names will appear as Labels under the folder Label. Let me know if I am misreading your suggestions.

The other issue, problem with the character sets/languages, please provide example eml files if possible.

commented

I have released v1.0.3.27 which hopefully will address issues you raised. Hope you find time to evaluate and provide feedback.

Select "File-->Select root folder for merging.." option to merge all mbox files under the root folder and sub-folders and display as labels tree. MBox Viewer was enhanced to examine content of files in order to discover mbox files so no need to add .mbox extension to Thunderbird files.

I also relaxed mapping rules for label names. Labels in Gmail exported files will be mapped to local code pages. I think that should work better. Obviously MBox Viewer would need to be ported to Unicode to provide ultimate solution.

Note that this version of MBox Viewer will delete all files generated by currently installed MBox Viewer except for index files. During startup MBox Viewer will ask you whether it is ok to proceed. You may select NO if you wish to examine current files created by "Print To" or exports.

MBox Viewer will also ask you to configure data folder for all files created by new MBox Viewer.

README file lists all new features and changes implemented in v1.0.3.27.

Let me know if I misunderstood the issues you raised.

commented

One issue/limitation I didn't mentioned. Merging will not work if you try to merge many hundreds or thousands of mbox or eml files. It may take a very long time for MBox Viewer to finish merging and it will likely not not work at all. I need to consider enhancing MBox Viewer to disallow merging of very large number of mbox files or add an option to merge mbox files that contain just a single mail into single mbox file first. MBox Viewer v1.0.3.27 creates a separate label per mbox and email file.

Currently you would have to perform a separate step to merge large number of eml files into a single mbox file as below before you select "File-->Select root folder for merging.." option.

mboxview.exe -MBOX_MERGE_LIST_FILE=F:\New\emlList.txt -MBOX_MERGE_TO_FILE=F:\New\mergefile.mbox

F:\New\emlList.txt content:

F:\TOnline*.eml

commented

The v1.0.3.27 should address the raised requirement.