aboutsummaryrefslogtreecommitdiffstats
path: root/interimap
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2016-12-01 15:37:01 +0100
committerGuilhem Moulin <guilhem@fripost.org>2016-12-01 15:37:01 +0100
commit3edd36d6c419a6bb057a31270422e82e3a140873 (patch)
tree18560edb8ae1accc5a89d9533c2eb95b6ef8261e /interimap
parentbf57c46e0292f64a637fcee92abcdc0e79c6c53e (diff)
parentd5b28183b91b0931db1d185ea04cbeae4a70a677 (diff)
Merge tag 'upstream/0.3' into debian
Upstream version 0.3
Diffstat (limited to 'interimap')
-rwxr-xr-xinterimap14
1 files changed, 14 insertions, 0 deletions
diff --git a/interimap b/interimap
index 150c754..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]);
}
@@ -1208,6 +1220,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')) {