PARTIALLY REMOVING MAXAGE (was: [PATCH v4] make maxage use UIDs to avoid timezone issues)

Nicolas Sebrecht nicolas.s-dev at laposte.net
Mon Apr 6 09:45:17 UTC 2015


On Mon, Apr 06, 2015 at 12:29:11AM -0700, Janna Martl wrote:
> On Thu, Apr 02, 2015 at 10:50:21AM +0200, Nicolas Sebrecht wrote:
> > 
> > This is PATCH v8.
> 
> now v9.
>  
> I fixed some bugs and implemented your suggestions. This applies on top
> of version 8.

So, it's more PATCH v8 2/1. ,-)

> >> +        if localfolder.getmessagecount() or statusfolder.getmessagecount():
> >
> >Shouldn't it be:
> >        if localfolder.getmessagecount() > 0 and statusfolder.getmessagecount() > 0:
> 
> I'm not sure about this; it was pre-existing code that I just moved.

Ok, will keep things as-is. I'll add a note about that so it gets checked
later.

> 1. When using maxage, local and remote messagelists are supposed to only
> contain messages from at most maxage days ago. But local and remote used
> different timezones to calculate what "maxage days ago" means, resulting
> in removals on one side. Now, we ask the local folder for maxage days'
> worth of mail, find the lowest UID, and then ask the remote folder for
> all UID's starting with that lowest one.
> 
> 2. maxage was fundamentally wrong in the IMAP-IMAP case: it assumed that
> remote messages have UIDs in the same order as their local counterparts,
> which could be false, e.g. when messages are copied in quick succession.
> So, remove support for maxage in the IMAP-IMAP case.
> 
> 3. Add startdate option for IMAP-IMAP syncs: use messages from the given
> repository starting at startdate, and all messages from the other
> repository. In the first sync, the other repository must be empty.
> 
> 4. Allow maxage to be specified either as number of days to sync (as
> previously) or as a fixed date.
> ---
>  offlineimap/accounts.py            | 37 +++++++++++++++++++++++--------------
>  offlineimap/folder/Base.py         | 14 +++++++++-----
>  offlineimap/folder/GmailMaildir.py |  4 ++--
>  3 files changed, 34 insertions(+), 21 deletions(-)

Looks good to me. Did you test this patch?

This whole topic is not trivial so I intend to merge it and make a new
rc.

-- 
Nicolas Sebrecht



More information about the OfflineIMAP-project mailing list