Closed poldy79 closed 2 years ago
That's annoying. Any suggestions for a possible fix?
First of all, I would try a old version of IMAPClient, suggestions which version to use? Secondly, we have to figure out the encoding of the returned data, to properly decode them. UTF-8 works for INBOX, but it may depends on the Server... I am not very into the IMAP-Protocol.
Usually these issues arise with a python 2 to 3 migration, as in python 3 strings are always unicode and it strictly distinguishes between strings and byte-arrays (e.g. what a socket returns etc.).
ok - i figured out, that box has to be decoded using
box = imap_utf7.decode(box)
Then --list_boxes will print the folder-structure with german umlauts and ß, e.g. "ößfolder".
I can provide a pull request, but I suspect this is not the only problem of this kind.
I have created https://github.com/rgladwell/imap-upload/pull/39 to solve this issue
Thanks @poldy79.
Using current master (684cd23) with python 3.9.2 on debian bullseye with IMAPClient==2.2.0 option --list_boxes requires --google-takeout. Furthermore it then fails with
It seems that uploader.list_boxes() returns the list of boxes as a byte stream, which has to be decoded to a string.
I suspect, that this is because of a change in IMAPClient. You might add a requirements.txt which states the latest version known to work.