From d33c699343282fae32e0b966c17377595ee52db0 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Tue, 22 Nov 2016 19:38:36 +0100 Subject: wibble --- interimap | 2 ++ 1 file changed, 2 insertions(+) (limited to 'interimap') diff --git a/interimap b/interimap index 150c754..eccd3ab 100755 --- a/interimap +++ b/interimap @@ -1208,6 +1208,8 @@ while (1) { # we need to issue a NOOP command or go back to AUTH state since the # LIST command may not report the correct HIGHESTMODSEQ value for # the mailbox currently selected + # RFC3501: "The STATUS command MUST NOT be used as a "check for + # new messages in the selected mailbox" operation" if (defined $MAILBOX) { # Prefer UNSELECT over NOOP commands as it requires a single command per cycle if ($lIMAP->incapable('UNSELECT') or $rIMAP->incapable('UNSELECT')) { -- cgit v1.2.3 From 986edff592c159cb9057e960f380057ff06da939 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Tue, 22 Nov 2016 19:41:46 +0100 Subject: bugfix: when resuming a sync, only consider UIDs greater than a known UIDNEXT. --- interimap | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'interimap') diff --git a/interimap b/interimap index eccd3ab..7a36c4e 100755 --- a/interimap +++ b/interimap @@ -1088,6 +1088,18 @@ while (defined (my $row = $STH_LIST_INTERRUPTED->fetchrow_arrayref())) { # the _MODIFIED internal cache has been initialized with all our # UIDs. (Since there is no reliable HIGHESTMODSEQ, any flag # difference is treated as a conflict.) + $STH_GET_CACHE_BY_IDX->execute($IDX); + if (defined (my $cache = $STH_GET_CACHE_BY_IDX->fetchrow_hashref())) { + $lIMAP->set_cache($cache->{mailbox}, + UIDVALIDITY => $cache->{lUIDVALIDITY}, + UIDNEXT => $cache->{lUIDNEXT} + ); + $rIMAP->set_cache($cache->{mailbox}, + UIDVALIDITY => $cache->{rUIDVALIDITY}, + UIDNEXT => $cache->{rUIDNEXT} + ); + die if defined $STH_GET_CACHE_BY_IDX->fetch(); # sanity check + } sync_messages($IDX, $MAILBOX, [keys %lList], [keys %rList]); } -- cgit v1.2.3