imap: off by one error in iteration

memfd
Manos Pitsidianakis 2020-06-11 11:42:02 +03:00
parent 2d3f49d64d
commit 2d862e39f4
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 4 additions and 2 deletions

View File

@ -389,8 +389,10 @@ impl MailBackend for ImapType {
.insert((mailbox_hash, uid), env.hash());
envelopes.push((uid, env));
}
exists =
std::cmp::max(std::cmp::max(exists.saturating_sub(500), 1), max_uid);
exists = std::cmp::max(
std::cmp::max(exists.saturating_sub(500), 1),
max_uid + 1,
);
debug!("sending payload for {}", mailbox_hash);
if uid_store.cache_headers {
cache::save_envelopes(