Open Behinder opened 2 years ago
As a suplementary note I discovered that recursive option not work if folders have dot in names. In my case Thunderbird named the folders with ".sbd" extension
Hi @Behinder, thanks for the report. Tou might want to raise that second bug as another issue.
Unfortunately, I don't know when I can get around to fixing this. If you have the time, a PR would be gratefully received.
I don't know if this is really fixable, I noticed that even with retry flag program during recursive tends to stop after importing one or two boxes, I had to delete them and run program again few times to finally import everything. Because --debug flag really does nothing and no error was raised I am not sure if something can be done.
Please don't lose hope. There have been a lot of changes in the repository recently. Please let me know if this version of the scripts works better for you:
I've noticed that MBOX files don't have a header or magic bytes, so identifying them without the extension is quite difficult... but a quick solution for uploading Thunderbird MBOX files would be to search for .msf files, and then for their counterparts without extension.
I've made a quick & dirty fix to the script to make it work in my case:
elif file.endswith(".msf"):
print("Found mailbox at {}...".format(path))
mbox = mailbox.mbox(path.replace(".msf",""), create=False)
if (email_only_folders and has_mixed_content(src)):
target_box = box + separator + src.split(os.sep)[-1]
else:
target_box = file.split('.')[0] if (box is None or box == "") else box
if err:
err = mailbox.mbox(err)
upload(imap, target_box, mbox, err, time_fields)
Now it's detecting those Thunderbird mbox files :)
Thanks for posting that. It would be a big help if you raised a PR to include that fragment in the code base.
Done, thanks for letting me contribute to imap-upload! :)
Thank you for contributing. Does https://github.com/rgladwell/imap-upload/pull/66 fix this issue?
If I import single file without extension it works however recursive option not work. Thunderbird stores mailboxes on Windows without giving them extension so with large number of mailboxes it can be pain to change them all manually. Is it any way for a program to detect mboxes anyway?
However even with that option script seems to stop after processing first folder