dovecot-2.0: autocreate: Disable plugin when running from dsync.

dovecot at dovecot.org dovecot at dovecot.org
Thu Mar 24 00:15:00 EET 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/4242a7bf8918
changeset: 12701:4242a7bf8918
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Mar 24 00:14:58 2011 +0200
description:
autocreate: Disable plugin when running from dsync.

diffstat:

 src/plugins/autocreate/Makefile.am         |  1 +
 src/plugins/autocreate/autocreate-plugin.c |  7 +++++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diffs (35 lines):

diff -r 84354efc93bd -r 4242a7bf8918 src/plugins/autocreate/Makefile.am
--- a/src/plugins/autocreate/Makefile.am	Thu Mar 24 00:10:59 2011 +0200
+++ b/src/plugins/autocreate/Makefile.am	Thu Mar 24 00:14:58 2011 +0200
@@ -1,6 +1,7 @@
 AM_CPPFLAGS = \
 	-I$(top_srcdir)/src/lib \
 	-I$(top_srcdir)/src/lib-mail \
+	-I$(top_srcdir)/src/lib-master \
 	-I$(top_srcdir)/src/lib-imap \
 	-I$(top_srcdir)/src/lib-storage
 
diff -r 84354efc93bd -r 4242a7bf8918 src/plugins/autocreate/autocreate-plugin.c
--- a/src/plugins/autocreate/autocreate-plugin.c	Thu Mar 24 00:10:59 2011 +0200
+++ b/src/plugins/autocreate/autocreate-plugin.c	Thu Mar 24 00:14:58 2011 +0200
@@ -1,6 +1,7 @@
 /* Copyright (c) 2007-2011 Dovecot authors, see the included COPYING file */
 
 #include "lib.h"
+#include "master-service.h"
 #include "mail-storage.h"
 #include "mail-storage-hooks.h"
 #include "mail-namespace.h"
@@ -98,6 +99,12 @@
 static void
 autocreate_mail_namespaces_created(struct mail_namespace *namespaces)
 {
+	if (strcmp(master_service_get_name(master_service), "dsync") == 0) {
+		/* kludge: disable autocreate plugin for dsync,
+		   since it'll only make things worse. this is fixed more
+		   nicely in v2.1 code. */
+		return;
+	}
 	autocreate_mailboxes(namespaces);
 	autosubscribe_mailboxes(namespaces);
 }


More information about the dovecot-cvs mailing list