From 63a1d865a8b925f7725b0121898ae46f2872db39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Mon, 28 Dec 2020 18:09:10 +0100 Subject: [PATCH] BUG: offlineimap3 fails with tunneled connections Running offlineimap with tunneled connections fails. The connection to the server is right, the server sends the PREAUTH message, offlineimap reads it and provides a reply, something like 'UID1 CAPABILITY'. This message is added to the output queue in imaplib2.py, function _command(): if literal is None: self.ouq.put(rqb) return rqb Then, the function _writer() in imaplib2 calls the self.send() function: try: self.send(rqb.data) if __debug__: self._log(4, '> %r' % rqb.data) self object is an IMAP4_Tunnel class, and the function send() writes the message, but the message is not sent to the server. We need flush the buffer. Closes #30 --- offlineimap/imaplibutil.py | 1 + 1 file changed, 1 insertion(+) diff --git a/offlineimap/imaplibutil.py b/offlineimap/imaplibutil.py index 338f3f5..b29b019 100644 --- a/offlineimap/imaplibutil.py +++ b/offlineimap/imaplibutil.py @@ -164,6 +164,7 @@ class IMAP4_Tunnel(UsefulIMAPMixIn, IMAP4): data = self.compressor.compress(data) data += self.compressor.flush(zlib.Z_SYNC_FLUSH) self.outfd.write(data) + self.outfd.flush() def shutdown(self): self.infd.close()