[PATCH v4] Re: make maxage use UIDs to avoid timezone issues

Nicolas Sebrecht nicolas.s-dev at laposte.net
Thu Mar 26 02:18:50 GMT 2015


On Wed, Mar 25, 2015 at 09:05:47PM -0400, Janna Martl wrote:

> More quibbling about the _msgs_to_fetch() part -- I fixed a couple bugs in
> your latest version. (Also, you only need two queries if both maxage and
> maxsize are enabled.)
> 
>  offlineimap/folder/IMAP.py | 28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)

Thanks, will look at that tomorrow.

> To be clear, the thing I'm blaming for this is the general strategy of:
> (1) get local messages within maxage
> (2) min_uid = min(uid's of the messages in (1))
> (3) local messagelist = local messages with uid >= min_uid
> (4) remote messagelist = remote messages with uid >= min_uid
> 
> Even if we take out (3) (which is just there for edge cases), this is
> still a problem. General reason why: in the Maildir-IMAP case, both
> sides share a consistent notion of UID's. This is not the case for
> IMAP-IMAP.

Yes, we got it wrong to mix min_uid accross mailboxes. There are 2
min_uid, of course.  I can't believe we didn't think about that before.

I never looked at this deeply because I don't use IMAP/IMAP myself but
you will be highly interested by the content of the folder/UIDMaps.py
file. ,-)

I just did a quick read but I really looks easy to fix. This might
require to introduce one or two more methods to make it proper (not even
sure about that, though).

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list