From: Timo Sirainen Date: Mon, 5 Jun 2017 17:12:43 +0000 (+0300) Subject: lib-storage: Fix SORT error message when reaching mail_sort_max_read_count X-Git-Tag: 2.3.0.rc1~1517 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5774da7bb2c1209904dd37f7cc08ecb9b4c5f572;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Fix SORT error message when reaching mail_sort_max_read_count 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. --- diff --git a/src/lib-storage/index/index-sort.c b/src/lib-storage/index/index-sort.c index 18951ff773..7dce357ab5 100644 --- a/src/lib-storage/index/index-sort.c +++ b/src/lib-storage/index/index-sort.c @@ -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; }