Skip to content

Latest commit

 

History

History
20 lines (12 loc) · 862 Bytes

README.md

File metadata and controls

20 lines (12 loc) · 862 Bytes

py3_imap_utf7

Python3 encoding and decoding utilities for the IMAP modified UTF-7 encoding. See RFC2152

This is a direct port from the python 2 version from Mailpile

This version works better than the one found in imapclient, which fails to do roundtrip encoding in some situations like:

from imap_utf7 import encode, decode

s = 'foo\r\n\nbar\n'
assert s == decode(encode(s))

Although control characters are usually rejected by IMAP servers.

I will add some unittests when I find the time, finish the porting properly and maybe switch to an in-place implementation for better performance