[PATCH] Handle maxage for davmail correctly

Nicolas Sebrecht nicolas.s-dev at laposte.net
Sat May 7 13:54:52 BST 2016


On Sat, May 07, 2016 at 12:32:10PM +0200, Łukasz Żarnowiecki wrote:

> "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.

Looks so obvious once we know it...

> Closes #327
> 
> Signed-off-by: Łukasz Żarnowiecki <dolohow at outlook.com>

Thank you very much! Applied.

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list