dovecot-2.2: director: Log a warning when using "director host f...

dovecot at dovecot.org dovecot at dovecot.org
Mon Aug 18 20:41:48 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/bd381e882485
changeset: 17725:bd381e882485
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Aug 18 22:39:56 2014 +0200
description:
director: Log a warning when using "director host flush" for all hosts.

diffstat:

 src/director/doveadm-connection.c |  5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diffs (20 lines):

diff -r 3d30ae287699 -r bd381e882485 src/director/doveadm-connection.c
--- a/src/director/doveadm-connection.c	Mon Aug 18 10:43:59 2014 +0200
+++ b/src/director/doveadm-connection.c	Mon Aug 18 22:39:56 2014 +0200
@@ -238,11 +238,16 @@
 doveadm_cmd_host_flush_all(struct doveadm_connection *conn)
 {
 	struct mail_host *const *hostp;
+	unsigned int total_user_count = 0;
 
 	array_foreach(mail_hosts_get(conn->dir->mail_hosts), hostp) {
+		total_user_count += (*hostp)->user_count;
 		director_flush_host(conn->dir, conn->dir->self_host,
 				    NULL, *hostp);
 	}
+	i_warning("Flushed all backend hosts with %u users. This is an unsafe "
+		  "operation and may cause the same users to end up in multiple backends.",
+		  total_user_count);
 	o_stream_nsend(conn->output, "OK\n", 3);
 }
 


More information about the dovecot-cvs mailing list