From f40704db6f601f7053baca42f6c8bf60fae2e170 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 13 Mar 2020 12:24:39 +0200 Subject: [PATCH] imap: Fix using SEARCH RELEVANCY option with MIN/MAX It should return only the one MIN/MAX mail's relevancy, not all of them. Similarly the SEARCHRES $ should be updated only to the MIN/MAX mail, not all mails. --- src/imap/imap-search.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/imap/imap-search.h b/src/imap/imap-search.h index f8d14c9588..7e89513360 100644 --- a/src/imap/imap-search.h +++ b/src/imap/imap-search.h @@ -14,10 +14,11 @@ enum search_return_options { SEARCH_RETURN_UPDATE = 0x0080, SEARCH_RETURN_PARTIAL = 0x0100, SEARCH_RETURN_RELEVANCY = 0x0200 -/* Options that don't return any seq/uid results */ +/* Options that don't return any seq/uid results, and also don't affect + SEARCHRES $ when combined with MIN/MAX. */ #define SEARCH_RETURN_NORESULTS \ (SEARCH_RETURN_ESEARCH | SEARCH_RETURN_MODSEQ | SEARCH_RETURN_SAVE | \ - SEARCH_RETURN_UPDATE) + SEARCH_RETURN_UPDATE | SEARCH_RETURN_RELEVANCY) }; struct imap_search_context { -- 2.47.3