]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Fix mail_cache_get_first_new_seq() when all mails are old
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 1 Apr 2020 21:27:43 +0000 (00:27 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 15 Apr 2020 09:41:43 +0000 (12:41 +0300)
Instead of returning "all messages are old", it returned "all messages are
new".

src/lib-index/mail-cache.c

index 48645db13ea166e56d681279d2743e349beccdb1..781352bb8e11afa8a85462256685ec9007ef6666 100644 (file)
@@ -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;
 }