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 commented on 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 commented on Oct 10, 2014
Could you please add a link to RFC?
pitrou commented on 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 commented on 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 commented on Aug 7, 2015
ping.
serhiy-storchaka commented on Aug 7, 2015
I take this.
juris commented on Apr 5, 2020
Would be good to have solution for this out-of-box in Python3. Any news?
lcnittl commented on 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 commented on Jul 8, 2026
Implemented in #153149. Now we can use it in imaplib.