You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like there is consensus to add "mUTF-7" or "imap4 UTF-7" to the codec module for Python 3.5. Details in https://mail.python.org/pipermail/python- dev/2014-October/136601.html
Not sure on the scope of this, but if someone wants to implement the incremental codec API, be aware that the existing UTF-7 codec, PyUnicode_DecodeUTF7Stateful() API, etc, does not actually support this properly. See bpo-20132, e.g. the test cases in <https://bugs.python.org/issue20132#msg232850\>. I recommend against impementing an incremental or stream codec based only on a stateless codec.
Activity
jcea commentedon Oct 10, 2014
Looks like there is consensus to add "mUTF-7" or "imap4 UTF-7" to the codec module for Python 3.5. Details in https://mail.python.org/pipermail/python- dev/2014-October/136601.html
serhiy-storchaka commentedon Oct 10, 2014
Could you please add a link to RFC?
[-]IMAP4 UTF-7 support[/-][+]Add mUTF-7 codec (UTF-7 modified for IMAP)[/+]pitrou commentedon Oct 11, 2014
See http://tools.ietf.org/html/rfc3501#section-5.1.3
Note how detailed the specification of "modified utf-7" is :-)
vadmium commentedon Jul 23, 2015
Not sure on the scope of this, but if someone wants to implement the incremental codec API, be aware that the existing UTF-7 codec, PyUnicode_DecodeUTF7Stateful() API, etc, does not actually support this properly. See bpo-20132, e.g. the test cases in <https://bugs.python.org/issue20132#msg232850\>. I recommend against impementing an incremental or stream codec based only on a stateless codec.
jcea commentedon Aug 7, 2015
ping.
serhiy-storchaka commentedon Aug 7, 2015
I take this.
juris commentedon Apr 5, 2020
Would be good to have solution for this out-of-box in Python3. Any news?
lcnittl commentedon May 13, 2020
I just stumbled over this too. Very eager to know if there are any news on the state of out-of-box support for the "mUTF-7" codec.
pythongh-66788: Rename the codec to utf-7-imap and add aliases
pythongh-66788: Use test.support.subTests in utf-7-imap codec tests
pythongh-66788: Strictly enforce the modified Base64 alphabet in utf-…
gh-66788: Add the utf-7-imap codec (GH-153149)
serhiy-storchaka commentedon Jul 8, 2026
Implemented in #153149. Now we can use it in
imaplib.