]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Don't send [NOMODSEQ] on SELECT/EXAMINE reply when condstore hasn't been enable...
authorTimo Sirainen <tss@iki.fi>
Mon, 2 Dec 2013 23:33:18 +0000 (01:33 +0200)
committerTimo Sirainen <tss@iki.fi>
Mon, 2 Dec 2013 23:33:18 +0000 (01:33 +0200)
This is definitely the better behavior and was also clearly intended by the
CONDSTORE RFC, although with some mixed language.

src/imap/cmd-select.c
src/lib-storage/index/index-status.c
src/lib-storage/mail-storage.h

index 6c7c550f62e946f01933fdaa850b2c7af33d238b..19ce02711692a15b14a00ef4e31a4704988a7dfe 100644 (file)
@@ -353,7 +353,7 @@ select_open(struct imap_select_context *ctx, const char *mailbox, bool readonly)
        if (status.nonpermanent_modseqs) {
                client_send_line(client,
                                 "* OK [NOMODSEQ] No permanent modsequences");
-       } else {
+       } else if (!status.no_modseq_tracking) {
                client_send_line(client,
                        t_strdup_printf("* OK [HIGHESTMODSEQ %llu] Highest",
                                (unsigned long long)status.highest_modseq));
index 1e7d5d7e29cb532f55c63efbc47ed7d43401351e..c522880daa7fe02f03809afd0859b598af9ec448 100644 (file)
@@ -138,7 +138,8 @@ void index_storage_get_open_status(struct mailbox *box,
        status_r->first_recent_uid = hdr->first_recent_uid;
        if ((items & STATUS_HIGHESTMODSEQ) != 0) {
                status_r->nonpermanent_modseqs =
-                       mail_index_is_in_memory(box->index) ||
+                       mail_index_is_in_memory(box->index);
+               status_r->no_modseq_tracking =
                        !mail_index_have_modseq_tracking(box->index);
                status_r->highest_modseq =
                        mail_index_modseq_get_highest(box->view);
index ad77cfc7c76695596ea222911342897165b80b13..1d439a4841859daf8616c4a3cdd8303427c48b63 100644 (file)
@@ -277,6 +277,9 @@ struct mailbox_status {
        unsigned int allow_new_keywords:1;
        /* Modseqs aren't permanent (index is in memory) (STATUS_HIGHESTMODSEQ) */
        unsigned int nonpermanent_modseqs:1;
+       /* Modseq tracking has never been enabled for this mailbox
+          yet. (STATUS_HIGHESTMODSEQ) */
+       unsigned int no_modseq_tracking:1;
 
        /* Messages have GUIDs (always set) */
        unsigned int have_guids:1;