]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Fix SORT error message when reaching mail_sort_max_read_count
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 5 Jun 2017 17:12:43 +0000 (20:12 +0300)
committerGitLab <gitlab@git.dovecot.net>
Mon, 5 Jun 2017 20:37:49 +0000 (23:37 +0300)
It should have been:
NO [LIMIT] Requested sort would have taken too long

Instead it was just:
NO [SERVERBUG] Mail field not cached

It was broken for CC, FROM, TO, SUBJECT, DISPLAYFROM and DISPLAYTO.
The numeric sorting was working correctly.

src/lib-storage/index/index-sort.c

index 18951ff773bd1356ce3f7ace4a8b605944afe08f..7dce357ab5e6527549cf3271ccc16d5422c70602 100644 (file)
@@ -530,7 +530,8 @@ int index_sort_header_get(struct mail_search_sort_program *program, uint32_t seq
                i_unreached();
        }
        if (ret < 0) {
-               if (mailbox_get_last_mail_error(mail->box) == MAIL_ERROR_EXPUNGED)
+               index_sort_program_set_mail_failed(program, mail);
+               if (!program->failed)
                        return 0;
                return -1;
        }