From 0903428fdaf102a1dd258b5d19f6a9c26fb57415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abd=C3=B3=20Roig-Maranges?= Date: Thu, 25 Oct 2012 14:25:19 +0200 Subject: [PATCH] Enable compressed connections to the IMAP server Added the configuration setting usecompression for the IMAP repositories. When enabled, the data from and to the IMAP server is compressed. Signed-off-by: Eygene Ryabinkin --- Changelog.rst | 1 + offlineimap.conf | 5 +++++ offlineimap/imapserver.py | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/Changelog.rst b/Changelog.rst index e541358..cb60d5e 100644 --- a/Changelog.rst +++ b/Changelog.rst @@ -9,6 +9,7 @@ OfflineIMAP v6.5.6 (YYYY-MM-DD) =============================== * Add knob to invoke folderfilter dynamically on each sync (GitHub#73) +* Add knob to apply compression to IMAP connections (Abdó Roig-Maranges) OfflineIMAP v6.5.5 (2013-10-07) diff --git a/offlineimap.conf b/offlineimap.conf index 0a8d44c..f3cd479 100644 --- a/offlineimap.conf +++ b/offlineimap.conf @@ -479,6 +479,11 @@ remoteuser = username # idlefolders = ['INBOX', 'INBOX.Alerts'] # +# OfflineIMAP can use a compressed connection to the IMAP server. +# This can result in faster downloads for some cases. +# +#usecompression = yes + # OfflineIMAP can use multiple connections to the server in order # to perform multiple synchronization actions simultaneously. # This may place a higher burden on the server. In most cases, diff --git a/offlineimap/imapserver.py b/offlineimap/imapserver.py index ecd7602..b00fd08 100644 --- a/offlineimap/imapserver.py +++ b/offlineimap/imapserver.py @@ -422,6 +422,10 @@ class IMAPServer: self.passworderror = str(e) raise + # Enable compression + if self.repos.getconfboolean('usecompression', 0): + imapobj.enable_compression() + # update capabilities after login, e.g. gmail serves different ones typ, dat = imapobj.capability() if dat != [None]: