diff --git a/offlineimap/imaplib2.py b/offlineimap/imaplib2.py index 61878f6..a6b13ad 100755 --- a/offlineimap/imaplib2.py +++ b/offlineimap/imaplib2.py @@ -17,9 +17,9 @@ Public functions: Internaldate2Time __all__ = ("IMAP4", "IMAP4_SSL", "IMAP4_stream", "Internaldate2Time", "ParseFlags", "Time2Internaldate") -__version__ = "2.52" +__version__ = "2.53" __release__ = "2" -__revision__ = "52" +__revision__ = "53" __credits__ = """ Authentication code contributed by Donn Cave June 1998. String method conversion by ESR, February 2001. @@ -51,7 +51,8 @@ Fix for correct byte encoding for _CRAM_MD5_AUTH taken from python3.5 imaplib.py Fix for correct Python 3 exception handling by Tobias Brink August 2015. Fix to allow interruptible IDLE command by Tim Peoples September 2015. Add support for TLS levels by Ben Boeckel September 2015. -Fix for shutown exception by Sebastien Gross November 2015.""" +Fix for shutown exception by Sebastien Gross November 2015. +Add support for server BINARY mode (supplied by offlineimap-project) November 2015.""" __author__ = "Piers Lauder " __URL__ = "http://imaplib2.sourceforge.net" __license__ = "Python License" @@ -1383,7 +1384,10 @@ class IMAP4(object): self.literal = None if isinstance(literal, string_types): literator = None - data = '%s {%s}' % (data, len(literal)) + if 'BINARY' in self.capabilities: + data = '%s ~{%s}' % (data, len(literal)) + else: + data = '%s {%s}' % (data, len(literal)) else: literator = literal