I would like to know if any \"official\" function/library existed in Python for IMAP4 UTF-7 folder path encoding.
In the imapInstance.list()
I get the f
The imapclient implementation is kind of broken though:
x = "foo\rbar\n\n\n\r\r"
imap_utf7.decode(imap_utf7.encode(x))
Result:
>> 'foo&bar\n\n\r-'
Edit:
After some research I found an implementation in MailPile which does not fail at roundtrip encoding on this test. I also ported it to Python3 if you're interested: https://github.com/MarechJ/py3_imap_utf7