From: Timo Sirainen Date: Wed, 1 Apr 2020 21:27:43 +0000 (+0300) Subject: lib-index: Fix mail_cache_get_first_new_seq() when all mails are old X-Git-Tag: 2.3.11.2~377 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4578450eec92abefd63bd0705de10238813683fb;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Fix mail_cache_get_first_new_seq() when all mails are old Instead of returning "all messages are old", it returned "all messages are new". --- diff --git a/src/lib-index/mail-cache.c b/src/lib-index/mail-cache.c index 48645db13e..781352bb8e 100644 --- a/src/lib-index/mail-cache.c +++ b/src/lib-index/mail-cache.c @@ -977,7 +977,7 @@ uint32_t mail_cache_get_first_new_seq(struct mail_index_view *view) (uint32_t)-1, &first_new_seq, &message_count)) { /* all messages are too old */ - return message_count+1; + return idx_hdr->messages_count+1; } return first_new_seq; }