On Thu, Nov 17, 2016 at 11:19:28PM +0800, Casper Ti. Vector wrote:
> When querying the imap mailbox for all messages with UID in [1,inf],
> isync currently hardcodes the upper limit to 1000000000, which can
> actually be exceeded, which results in missing messages on the slave.
> 

> This is not merely theoretical: I missed a message with UID=1343495243
> just now;
>
now, that's unexpected, as UIDs like that seem a bit insane.
it's also suboptimal that the server apparently sent no UIDNEXT, so this
fallback path was triggered in the first place.
maybe mail me the output of a run with -Dn for a closer look.

> By packet sniffering, I found Outlook Express using the IMAP command
> `UID FETCH 0:*', which seems a reasonable way provided that UIDs
> returned by the server does not overflow the integer type isync uses
> for these numbers.
> 
in --pull-new mode, mbsync issues a fetch for only the new messages. the
problem with * is that it represents the last message, and the imap uid
ranges are unordered (i'm not quite sure what crispin was smoking when
he specified that), which means that such a query would return the last
already seen message instead of an empty set if no new messages arrived.
that's not exactly horrible, but still unclean.

the 1e9 was just chosen to make the query string legible. sending the
INT_MAX verbatim would be more correct.

and it would be possible to special-case the 1:inf range to actually
send 1:* to make it less ugly.

------------------------------------------------------------------------------
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to