# 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]);
}