]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Fix using SEARCH RELEVANCY option with MIN/MAX
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 13 Mar 2020 10:24:39 +0000 (12:24 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Fri, 20 Mar 2020 08:03:57 +0000 (08:03 +0000)
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

index f8d14c9588e03981037b46156fd8418fb7fb3099..7e8951336080ae4e3e398485f6efe8872ec96648 100644 (file)
@@ -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 {