Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recursivity doesn't place subfolders inside parent folders when using "official" structure #7

Open
it-1313 opened this issue Dec 22, 2022 · 1 comment

Comments

@it-1313
Copy link

it-1313 commented Dec 22, 2022

Hello,

first thank you for this script! I had a much harder time than expected to import maildir into Thunderbird without a detour through an imap server, and this script is the one I found!

I use the latest version 1.0 from april 21st of 2020, and I have the "official" maildir format (screenshot)
Screenshot_20221222_152146
When using maildir2mbox.py -r Maildir_old/ mboxX (using 22.04 and python 3.10.6), I get

maildir2mbox_orig.py -r Maildir_old/ mboxX
ERROR 15:32:49 Missing `new` and/or `cur` subdirectories in path Maildir_old, aborting conversion
15:32:49 Maildir_old/.HO restructuring -> mboxX.sbd/HO restructuring
15:32:49 Processing 77 messages in Maildir_old/.HO restructuring
15:32:49 Maildir_old/.HO restructuring.AS -> mboxX.sbd/HO restructuring.AS #<-- the folder should be calld AS.sbd and be in HO restructuring
15:32:49 Processing 16 messages in Maildir_old/.HO restructuring.AS #<-- the emails should be moved inside HO restructuring/ in a file AS
15:32:49 Done with 1 errors. # can be ignored I think

I also tested it with the provided test_data and if I e.g. move the .coincoin folder to the same level as the .INBOX.toto folder (and rename it to .INBOX.toto.coucou) it also wrongly gets placed next to .INBOX.toto (and not inside .INBOX.toto).

I think the problem lies in maildir_sub_path (? or of course, I wrongly apply the script) and I tried to debug it in an online python debugger but had troubles getting the correct variable (path info) of maildir_path to be used. I'm happy to investigate further, e.g. if somebody tells me how I can use a variable depending on a local folder inside an online debugger.

@intractabilis
Copy link

intractabilis commented Dec 30, 2022

@it-1313 Here is my complete rewrite. The command line syntax is

mailmigration.py maildir_root_folder mbox_output_folder --inboxname=MigratedInbox

You need --inboxname because the content of the inbox is in the root of the maildir, and it doesn't have its own name in the file system. The output mbox file for the inbox of maildir will be named MigratedInbox in the example above.

mailmigration.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants