dovecot-2.2: expire plugin: Don't crash when doveadm is run with...

dovecot at dovecot.org dovecot at dovecot.org
Sat Jan 5 01:14:35 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/75dc4cb4bfe0
changeset: 15545:75dc4cb4bfe0
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Nov 30 03:14:10 2012 +0200
description:
expire plugin: Don't crash when doveadm is run with proxying

diffstat:

 src/doveadm/client-connection.c     |  1 +
 src/doveadm/doveadm-mail.h          |  2 ++
 src/plugins/expire/doveadm-expire.c |  5 ++++-
 3 files changed, 7 insertions(+), 1 deletions(-)

diffs (38 lines):

diff -r f77e87298a66 -r 75dc4cb4bfe0 src/doveadm/client-connection.c
--- a/src/doveadm/client-connection.c	Thu Nov 29 12:43:54 2012 +0200
+++ b/src/doveadm/client-connection.c	Fri Nov 30 03:14:10 2012 +0200
@@ -57,6 +57,7 @@
 
 	ctx = doveadm_mail_cmd_init(cmd, set);
 	ctx->full_args = (const void *)(argv + 1);
+	ctx->proxying = TRUE;
 
 	ctx->service_flags |=
 		MAIL_STORAGE_SERVICE_FLAG_NO_LOG_INIT |
diff -r f77e87298a66 -r 75dc4cb4bfe0 src/doveadm/doveadm-mail.h
--- a/src/doveadm/doveadm-mail.h	Thu Nov 29 12:43:54 2012 +0200
+++ b/src/doveadm/doveadm-mail.h	Fri Nov 30 03:14:10 2012 +0200
@@ -62,6 +62,8 @@
 	/* if non-zero, exit with this code */
 	int exit_code;
 
+	/* This command is being called by a remote doveadm client. */
+	unsigned int proxying:1;
 	/* We're handling only a single user */
 	unsigned int iterate_single_user:1;
 	/* We're going through all users (not set for wildcard usernames) */
diff -r f77e87298a66 -r 75dc4cb4bfe0 src/plugins/expire/doveadm-expire.c
--- a/src/plugins/expire/doveadm-expire.c	Thu Nov 29 12:43:54 2012 +0200
+++ b/src/plugins/expire/doveadm-expire.c	Fri Nov 30 03:14:10 2012 +0200
@@ -374,7 +374,10 @@
 	if (expire_dict == NULL)
 		return;
 
-	if (ctx->iterate_single_user) {
+	/* doveadm proxying uses expire database only locally. the remote
+	   doveadm handles each user one at a time (even though
+	   iterate_single_user=FALSE) */
+	if (ctx->iterate_single_user || ctx->proxying) {
 		if (doveadm_debug) {
 			i_debug("expire: Iterating only a single user, "
 				"ignoring expire database");


More information about the dovecot-cvs mailing list