o_stream_nsend(conn->output, "\n-\n", 3);
} else if (ret == 0) {
o_stream_nsend_str(conn->output, "\n-NOUSER\n");
+ } else if (mctx->exit_code == DOVEADM_EX_NOREPLICATE) {
+ o_stream_nsend_str(conn->output, "\n-NOREPLICATE\n");
} else if (mctx->exit_code != 0) {
/* maybe not an error, but not a full success either */
o_stream_nsend_str(conn->output,
enum mail_error mail_error;
if (!cli) {
+ if (ctx->replicator_notify &&
+ mail_user_plugin_getenv_bool(_ctx->cur_mail_user, "noreplicate")) {
+ return DOVEADM_EX_NOREPLICATE;
+ }
+
/* doveadm-server connection. start with a success reply.
after that follows the regular dsync protocol. */
ctx->fd_in = ctx->fd_out = -1;
#define DOVEADM_EX_NOTPOSSIBLE EX_DATAERR
#define DOVEADM_EX_UNKNOWN -1
+#define DOVEADM_EX_NOREPLICATE 1001
+
enum doveadm_client_type {
DOVEADM_CONNECTION_TYPE_CLI = 0,
DOVEADM_CONNECTION_TYPE_TCP,