Re: CONDSTORE and replication in production?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 05, 2008 at 05:06:21PM +1100, Bron Gondwana wrote:
> Attached is a patch that makes rolling out condstore less painful, though
> the interface is a little unfriendly:
> 
> mailbox_default_options: 2

Oh yeah, indeed.  Alternatively.  Attached now.

Bron.
Index: cyrus-imapd-2.3.13/imap/mailbox.c
===================================================================
--- cyrus-imapd-2.3.13.orig/imap/mailbox.c	2008-11-05 13:58:46.000000000 +1100
+++ cyrus-imapd-2.3.13/imap/mailbox.c	2008-11-05 13:58:57.000000000 +1100
@@ -959,7 +959,10 @@
 	ntohl(*((bit32 *)(mailbox->index_base+OFFSET_HIGHESTMODSEQ)));
 #endif
 
-    if (!mailbox->exists) mailbox->options |= OPT_POP3_NEW_UIDL;
+    if (!mailbox->exists) {
+	mailbox->options = config_getint(IMAPOPT_MAILBOX_DEFAULT_OPTIONS);
+	mailbox->options |= OPT_POP3_NEW_UIDL;
+    }
 
     if (!mailbox_doing_reconstruct &&
 	(mailbox->minor_version < MAILBOX_MINOR_VERSION)) {
@@ -1637,7 +1640,8 @@
 	calculate_flagcounts = 1;
     }
     if (oldstart_offset < OFFSET_MAILBOX_OPTIONS-quota_offset+sizeof(bit32)) {
-	unsigned long options = !exists ? OPT_POP3_NEW_UIDL : 0;
+	unsigned long options = config_getint(IMAPOPT_MAILBOX_DEFAULT_OPTIONS);
+	if (!exists) options |= OPT_POP3_NEW_UIDL;
 	*((bit32 *)(buf+OFFSET_MAILBOX_OPTIONS)) = htonl(options);
     }
 
@@ -2730,7 +2734,7 @@
     mailbox.deleted = 0;
     mailbox.answered = 0;
     mailbox.flagged = 0;
-    mailbox.options = OPT_POP3_NEW_UIDL;
+    mailbox.options = config_getint(IMAPOPT_MAILBOX_DEFAULT_OPTIONS) | OPT_POP3_NEW_UIDL;
     mailbox.leaked_cache_records = 0;
     mailbox.highestmodseq = 1;
 
Index: cyrus-imapd-2.3.13/lib/imapoptions
===================================================================
--- cyrus-imapd-2.3.13.orig/lib/imapoptions	2008-11-05 13:58:43.000000000 +1100
+++ cyrus-imapd-2.3.13/lib/imapoptions	2008-11-05 13:59:11.000000000 +1100
@@ -534,6 +534,11 @@
 /* Include notations in the protocol telemetry logs indicating the number of
    seconds since the last command or response. */
 
+{ "mailbox_default_options", 0, INT }
+/* Default "options" field for the mailbox on create.  You'll want to know
+   what you're doing before setting this, but it can apply some default
+   annotations like condstore or duplicate supression */
+
 { "mailnotifier", NULL, STRING }
 /* Notifyd(8) method to use for "MAIL" notifications.  If not set, "MAIL"
    notifications are disabled. */
----
Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux