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 <rea@codelabs.ru>
This commit is contained in:
Abdó Roig-Maranges 2012-10-25 14:25:19 +02:00 committed by Eygene Ryabinkin
parent 0c4fe6bada
commit 0903428fda
3 changed files with 10 additions and 0 deletions

View File

@ -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 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) OfflineIMAP v6.5.5 (2013-10-07)

View File

@ -479,6 +479,11 @@ remoteuser = username
# idlefolders = ['INBOX', 'INBOX.Alerts'] # 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 # OfflineIMAP can use multiple connections to the server in order
# to perform multiple synchronization actions simultaneously. # to perform multiple synchronization actions simultaneously.
# This may place a higher burden on the server. In most cases, # This may place a higher burden on the server. In most cases,

View File

@ -422,6 +422,10 @@ class IMAPServer:
self.passworderror = str(e) self.passworderror = str(e)
raise raise
# Enable compression
if self.repos.getconfboolean('usecompression', 0):
imapobj.enable_compression()
# update capabilities after login, e.g. gmail serves different ones # update capabilities after login, e.g. gmail serves different ones
typ, dat = imapobj.capability() typ, dat = imapobj.capability()
if dat != [None]: if dat != [None]: