]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
director: Log a warning when using "director host flush" for all hosts.
authorTimo Sirainen <tss@iki.fi>
Mon, 18 Aug 2014 20:39:56 +0000 (22:39 +0200)
committerTimo Sirainen <tss@iki.fi>
Mon, 18 Aug 2014 20:39:56 +0000 (22:39 +0200)
src/director/doveadm-connection.c

index 02442d8df98bb5e343d0e6c850198ab579e3863b..1e39b4543c9d0abeea9ca2547cd725e43799904c 100644 (file)
@@ -238,11 +238,16 @@ static void
 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);
 }