dovecot-2.0: doveadm: Added iterate_single_user mail context field.

dovecot at dovecot.org dovecot at dovecot.org
Tue Sep 21 16:55:36 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/dc98970aef85
changeset: 12141:dc98970aef85
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Sep 21 14:55:22 2010 +0100
description:
doveadm: Added iterate_single_user mail context field.

diffstat:

 src/doveadm/doveadm-mail.c |  8 ++++----
 src/doveadm/doveadm-mail.h |  3 +++
 2 files changed, 7 insertions(+), 4 deletions(-)

diffs (45 lines):

diff -r 942bb9258e49 -r dc98970aef85 src/doveadm/doveadm-mail.c
--- a/src/doveadm/doveadm-mail.c	Tue Sep 21 14:04:22 2010 +0100
+++ b/src/doveadm/doveadm-mail.c	Tue Sep 21 14:55:22 2010 +0100
@@ -366,7 +366,6 @@
 		MAIL_STORAGE_SERVICE_FLAG_NO_LOG_INIT;
 	struct doveadm_mail_cmd_context *ctx;
 	const char *getopt_args, *username, *wildcard_user;
-	bool iter_single_user;
 	int c;
 
 	if (doveadm_debug)
@@ -403,8 +402,9 @@
 			cmd->name, argv[0]);
 	}
 
-	iter_single_user = !ctx->iterate_all_users && wildcard_user == NULL;
-	if (doveadm_print_is_initialized() && !iter_single_user) {
+	ctx->iterate_single_user =
+		!ctx->iterate_all_users && wildcard_user == NULL;
+	if (doveadm_print_is_initialized() && !ctx->iterate_single_user) {
 		doveadm_print_header("username", "Username",
 				     DOVEADM_PRINT_HEADER_FLAG_STICKY |
 				     DOVEADM_PRINT_HEADER_FLAG_HIDE_TITLE);
@@ -412,7 +412,7 @@
 
 	ctx->v.init(ctx, (const void *)argv);
 
-	if (iter_single_user) {
+	if (ctx->iterate_single_user) {
 		doveadm_mail_single_user(ctx, username, service_flags);
 	} else {
 		service_flags |= MAIL_STORAGE_SERVICE_FLAG_TEMP_PRIV_DROP;
diff -r 942bb9258e49 -r dc98970aef85 src/doveadm/doveadm-mail.h
--- a/src/doveadm/doveadm-mail.h	Tue Sep 21 14:04:22 2010 +0100
+++ b/src/doveadm/doveadm-mail.h	Tue Sep 21 14:55:22 2010 +0100
@@ -48,6 +48,9 @@
 
 	ARRAY_DEFINE(module_contexts, union doveadm_mail_cmd_module_context *);
 
+	/* We're handling only a single user */
+	unsigned int iterate_single_user:1;
+	/* We're going through all users (not set for wildcard usernames) */
 	unsigned int iterate_all_users:1;
 	unsigned int failed:1;
 };


More information about the dovecot-cvs mailing list