From: Aki Tuomi Date: Tue, 28 May 2019 07:40:15 +0000 (+0300) Subject: doveadm-dsync: Do not attempt to sync noreplicate user X-Git-Tag: 2.3.9~457 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=987ccb17ee0b54ec848a5cb3f068d822facbab7b;p=thirdparty%2Fdovecot%2Fcore.git doveadm-dsync: Do not attempt to sync noreplicate user --- diff --git a/src/doveadm/doveadm-dsync.c b/src/doveadm/doveadm-dsync.c index b0c057e182..3bac6e0540 100644 --- a/src/doveadm/doveadm-dsync.c +++ b/src/doveadm/doveadm-dsync.c @@ -578,10 +578,19 @@ cmd_dsync_run(struct doveadm_mail_cmd_context *_ctx, struct mail_user *user) enum dsync_brain_flags brain_flags; enum mail_error mail_error = 0, mail_error2; bool remote_errors_logged = FALSE; + bool cli = (cctx->conn_type == DOVEADM_CONNECTION_TYPE_CLI); const char *changes_during_sync, *changes_during_sync2 = NULL; bool remote_only_changes; int ret = 0; + /* replicator_notify indicates here automated attempt, + we still want to allow manual sync/backup */ + if (!cli && ctx->replicator_notify && + mail_user_plugin_getenv_bool(_ctx->cur_mail_user, "noreplicate")) { + ctx->ctx.exit_code = DOVEADM_EX_NOREPLICATE; + return -1; + } + i_zero(&set); if (cctx->remote_ip.family != 0) { /* include the doveadm client's IP address in the ps output */