dovecot-2.2: imap: Don't send [NOMODSEQ] on SELECT/EXAMINE reply...

dovecot at dovecot.org dovecot at dovecot.org
Tue Dec 3 01:33:48 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/7171fd6732e1
changeset: 17036:7171fd6732e1
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Dec 03 01:33:18 2013 +0200
description:
imap: Don't send [NOMODSEQ] on SELECT/EXAMINE reply when condstore hasn't been enabled yet.
This is definitely the better behavior and was also clearly intended by the
CONDSTORE RFC, although with some mixed language.

diffstat:

 src/imap/cmd-select.c                |  2 +-
 src/lib-storage/index/index-status.c |  3 ++-
 src/lib-storage/mail-storage.h       |  3 +++
 3 files changed, 6 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r 0c9ab8cf9c1a -r 7171fd6732e1 src/imap/cmd-select.c
--- a/src/imap/cmd-select.c	Mon Dec 02 18:47:52 2013 +0200
+++ b/src/imap/cmd-select.c	Tue Dec 03 01:33:18 2013 +0200
@@ -353,7 +353,7 @@
 	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));
diff -r 0c9ab8cf9c1a -r 7171fd6732e1 src/lib-storage/index/index-status.c
--- a/src/lib-storage/index/index-status.c	Mon Dec 02 18:47:52 2013 +0200
+++ b/src/lib-storage/index/index-status.c	Tue Dec 03 01:33:18 2013 +0200
@@ -138,7 +138,8 @@
 	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);
diff -r 0c9ab8cf9c1a -r 7171fd6732e1 src/lib-storage/mail-storage.h
--- a/src/lib-storage/mail-storage.h	Mon Dec 02 18:47:52 2013 +0200
+++ b/src/lib-storage/mail-storage.h	Tue Dec 03 01:33:18 2013 +0200
@@ -277,6 +277,9 @@
 	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;


More information about the dovecot-cvs mailing list