From: Timo Sirainen Date: Thu, 11 Mar 2021 13:26:56 +0000 (+0200) Subject: doveadm: Remove mailbox_set_reason() calls X-Git-Tag: 2.3.18~352 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cfc7b74425746c3b7dee949ce6d8d27f9a3c069d;p=thirdparty%2Fdovecot%2Fcore.git doveadm: Remove mailbox_set_reason() calls They are now unnecessary because of the new reason_code field. --- diff --git a/src/doveadm/doveadm-mail-copymove.c b/src/doveadm/doveadm-mail-copymove.c index af25924d82..93b74547ee 100644 --- a/src/doveadm/doveadm-mail-copymove.c +++ b/src/doveadm/doveadm-mail-copymove.c @@ -112,7 +112,6 @@ cmd_copy_run(struct doveadm_mail_cmd_context *_ctx, struct mail_user *user) ns = mail_namespace_find(user->namespaces, ctx->destname); destbox = mailbox_alloc(ns->list, ctx->destname, MAILBOX_FLAG_SAVEONLY); - mailbox_set_reason(destbox, _ctx->cmd->name); if (mailbox_open(destbox) < 0) { i_error("Can't open mailbox '%s': %s", ctx->destname, mailbox_get_last_internal_error(destbox, NULL)); diff --git a/src/doveadm/doveadm-mail-import.c b/src/doveadm/doveadm-mail-import.c index b05e84b760..aec85d3ffd 100644 --- a/src/doveadm/doveadm-mail-import.c +++ b/src/doveadm/doveadm-mail-import.c @@ -63,7 +63,6 @@ dest_mailbox_open_or_create(struct import_cmd_context *ctx, } box = mailbox_alloc(ns->list, name, MAILBOX_FLAG_SAVEONLY); - mailbox_set_reason(box, ctx->ctx.cmd->name); if (mailbox_create(box, NULL, FALSE) < 0) { errstr = mailbox_get_last_internal_error(box, &error); if (error != MAIL_ERROR_EXISTS) { diff --git a/src/doveadm/doveadm-mail-index.c b/src/doveadm/doveadm-mail-index.c index ac0e4c9010..524f373a11 100644 --- a/src/doveadm/doveadm-mail-index.c +++ b/src/doveadm/doveadm-mail-index.c @@ -114,7 +114,6 @@ cmd_index_box(struct index_cmd_context *ctx, const struct mailbox_info *info) box = mailbox_alloc(info->ns->list, info->vname, MAILBOX_FLAG_IGNORE_ACLS); - mailbox_set_reason(box, ctx->ctx.cmd->name); if (ctx->max_recent_msgs != 0) { /* index only if there aren't too many recent messages. don't bother syncing the mailbox, that alone can take a diff --git a/src/doveadm/doveadm-mail-iter.c b/src/doveadm/doveadm-mail-iter.c index eb040aee14..0bf3cc56a9 100644 --- a/src/doveadm/doveadm-mail-iter.c +++ b/src/doveadm/doveadm-mail-iter.c @@ -37,7 +37,6 @@ int doveadm_mail_iter_init(struct doveadm_mail_cmd_context *ctx, iter->ctx = ctx; iter->box = mailbox_alloc(info->ns->list, info->vname, MAILBOX_FLAG_IGNORE_ACLS | readonly_flag); - mailbox_set_reason(iter->box, ctx->cmd->name); iter->search_args = search_args; if (mailbox_sync(iter->box, MAILBOX_SYNC_FLAG_FULL_READ) < 0) { diff --git a/src/doveadm/doveadm-mail-mailbox-metadata.c b/src/doveadm/doveadm-mail-mailbox-metadata.c index 4791414bf2..593555b05a 100644 --- a/src/doveadm/doveadm-mail-mailbox-metadata.c +++ b/src/doveadm/doveadm-mail-mailbox-metadata.c @@ -66,7 +66,6 @@ cmd_mailbox_metadata_get_mailbox(struct metadata_cmd_context *mctx, *box_r = mailbox_alloc((*ns_r)->list, mctx->mailbox, MAILBOX_FLAG_ATTRIBUTE_SESSION); } - mailbox_set_reason(*box_r, mctx->ctx.cmd->name); if (op == DOVEADM_METADATA_OP_SET && mailbox_open(*box_r) < 0) { diff --git a/src/doveadm/doveadm-mail-mailbox-status.c b/src/doveadm/doveadm-mail-mailbox-status.c index 60a979cb02..9f470952fc 100644 --- a/src/doveadm/doveadm-mail-mailbox-status.c +++ b/src/doveadm/doveadm-mail-mailbox-status.c @@ -136,7 +136,6 @@ status_mailbox(struct status_cmd_context *ctx, const struct mailbox_info *info) struct mailbox_metadata metadata; box = doveadm_mailbox_find(ctx->ctx.cur_mail_user, info->vname); - mailbox_set_reason(box, ctx->ctx.cmd->name); if (mailbox_get_status(box, ctx->status_items, &status) < 0 || mailbox_get_metadata(box, ctx->metadata_items, &metadata) < 0) { i_error("Mailbox %s: Failed to lookup mailbox status: %s", diff --git a/src/doveadm/doveadm-mail-mailbox.c b/src/doveadm/doveadm-mail-mailbox.c index e25079077e..2b2c453c19 100644 --- a/src/doveadm/doveadm-mail-mailbox.c +++ b/src/doveadm/doveadm-mail-mailbox.c @@ -241,7 +241,6 @@ cmd_mailbox_create_run(struct doveadm_mail_cmd_context *_ctx, } box = mailbox_alloc(ns->list, name, 0); - mailbox_set_reason(box, _ctx->cmd->name); if (mailbox_create(box, &ctx->update, directory) < 0) { i_error("Can't create mailbox %s: %s", name, mailbox_get_last_internal_error(box, NULL)); @@ -370,7 +369,6 @@ cmd_mailbox_delete_run(struct doveadm_mail_cmd_context *_ctx, array_foreach_elem(mailboxes, name) { ns = mail_namespace_find(user->namespaces, name); box = mailbox_alloc(ns->list, name, mailbox_flags); - mailbox_set_reason(box, _ctx->cmd->name); storage = mailbox_get_storage(box); ret2 = ctx->require_empty ? mailbox_delete_empty(box) : mailbox_delete(box); @@ -463,8 +461,6 @@ cmd_mailbox_rename_run(struct doveadm_mail_cmd_context *_ctx, newns = mail_namespace_find(user->namespaces, newname); oldbox = mailbox_alloc(oldns->list, oldname, 0); newbox = mailbox_alloc(newns->list, newname, 0); - mailbox_set_reason(oldbox, _ctx->cmd->name); - mailbox_set_reason(newbox, _ctx->cmd->name); if (mailbox_rename(oldbox, newbox) < 0) { i_error("Can't rename mailbox %s to %s: %s", oldname, newname, mailbox_get_last_internal_error(oldbox, NULL)); @@ -527,7 +523,6 @@ cmd_mailbox_subscribe_run(struct doveadm_mail_cmd_context *_ctx, array_foreach_elem(&ctx->mailboxes, name) { ns = mail_namespace_find(user->namespaces, name); box = mailbox_alloc(ns->list, name, 0); - mailbox_set_reason(box, _ctx->cmd->name); if (mailbox_set_subscribed(box, ctx->ctx.subscriptions) < 0) { i_error("Can't %s mailbox %s: %s", name, ctx->ctx.subscriptions ? "subscribe to" : @@ -655,7 +650,6 @@ int cmd_mailbox_update_run(struct doveadm_mail_cmd_context *_ctx, ns = mail_namespace_find(user->namespaces, ctx->mailbox); box = mailbox_alloc(ns->list, ctx->mailbox, 0); - mailbox_set_reason(box, _ctx->cmd->name); if ((ret = mailbox_update(box, &(ctx->update))) != 0) { i_error("Cannot update %s: %s", diff --git a/src/doveadm/doveadm-mail-save.c b/src/doveadm/doveadm-mail-save.c index 7b5e6ba136..d8312c8227 100644 --- a/src/doveadm/doveadm-mail-save.c +++ b/src/doveadm/doveadm-mail-save.c @@ -91,7 +91,6 @@ cmd_save_run(struct doveadm_mail_cmd_context *_ctx, struct mail_user *user) ns = mail_namespace_find(user->namespaces, ctx->mailbox); box = mailbox_alloc(ns->list, ctx->mailbox, MAILBOX_FLAG_SAVEONLY); - mailbox_set_reason(box, _ctx->cmd->name); ret = cmd_save_to_mailbox(ctx, box, _ctx->cmd_input); mailbox_free(&box); return ret; diff --git a/src/doveadm/doveadm-mail.c b/src/doveadm/doveadm-mail.c index cc8e03b901..574c3b7f34 100644 --- a/src/doveadm/doveadm-mail.c +++ b/src/doveadm/doveadm-mail.c @@ -298,7 +298,6 @@ static int cmd_force_resync_box(struct doveadm_mail_cmd_context *_ctx, flags |= MAILBOX_FLAG_FSCK; box = mailbox_alloc(info->ns->list, info->vname, flags); - mailbox_set_reason(box, _ctx->cmd->name); if (mailbox_open(box) < 0) { i_error("Opening mailbox %s failed: %s", info->vname, mailbox_get_last_internal_error(box, NULL));