docker-offlineimap/offlineimap
Łukasz Żarnowiecki 6b8ee4a183 Handle maxage for davmail correctly
"imapobj.search" returns a list with one string element of numbers
separated by one whitespace character for regular box (GMail, AOL...).
['1 2 3 4 5 6 7 8 9 10 11 12']
But if we would like to sync from Davmail it would return a list of
numbers.
['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'].

The code "return res_data[0].split()" in the first case will return what
we already have when using Davmail, hence only one email will be
fetched.  But if only the first sync would be with maxage the emails
will be removed, because offlineimap will think that they were removed
by us.

The patch distinguishes between syncing with Davmail and regular box and
applies split on the first element only when it finds whitespace
character.  It also handles the case when the first element is empty on
first sync.

Closes #327

Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-05-07 13:29:44 +02:00
..
folder Handle maxage for davmail correctly 2016-05-07 13:29:44 +02:00
repository XOAUTH2: don't force oauth2_request_url to be defined 2016-04-25 18:38:31 +02:00
ui Curses, UIBase: remove references to __bigversion__ 2016-03-05 06:47:24 +01:00
utils Make OS-default CA certificate file to be requested explicitely 2015-01-18 22:05:49 +03:00
__init__.py v6.7.0 2016-03-10 17:08:18 +01:00
accounts.py SQLite: close db when done 2016-04-09 19:55:26 +02:00
CustomConfig.py Properly re-raise exception to save original tracebacks 2015-01-12 17:51:21 +03:00
emailutil.py more style consistency 2015-01-08 23:36:19 +01:00
error.py more consistent style 2015-01-07 21:31:43 +01:00
globals.py Create global instance of command-line options 2013-02-11 23:34:18 +04:00
imaplib2.py bump imaplib2 from 2.52 to 2.53 2015-12-28 01:18:16 +01:00
imaplibutil.py change hard coding of AF_UNSPEC to user-defined address-families per repository 2016-02-23 06:57:21 +01:00
imapserver.py XOAUTH2: don't force oauth2_request_url to be defined 2016-04-25 18:38:31 +02:00
imaputil.py IMAP folder: expose the message keywords 2015-11-22 19:51:02 +01:00
init.py don't write a pid file 2016-04-26 23:49:45 +02:00
localeval.py localeval: avoid redefining 'file' keyword 2015-01-14 17:18:48 +01:00
mbnames.py mbnames: add option to write the file once per account 2015-03-22 21:15:46 +01:00
syncmaster.py Exit "infinite" monitorloop when SyncRunner thread exits 2011-11-02 11:55:05 +01:00
threadutil.py more style consistency 2015-02-10 17:25:00 +01:00