]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm: Remove mailbox_set_reason() calls
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 11 Mar 2021 13:26:56 +0000 (15:26 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 29 Sep 2021 10:09:58 +0000 (10:09 +0000)
They are now unnecessary because of the new reason_code field.

src/doveadm/doveadm-mail-copymove.c
src/doveadm/doveadm-mail-import.c
src/doveadm/doveadm-mail-index.c
src/doveadm/doveadm-mail-iter.c
src/doveadm/doveadm-mail-mailbox-metadata.c
src/doveadm/doveadm-mail-mailbox-status.c
src/doveadm/doveadm-mail-mailbox.c
src/doveadm/doveadm-mail-save.c
src/doveadm/doveadm-mail.c

index af25924d82cc898f16b29f4c62077dbe00c92361..93b74547eee1eea84ac759e0d8b5c680eed33339 100644 (file)
@@ -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));
index b05e84b7606ab876bfa51b217f61705c382b8a78..aec85d3ffdaf536a38c489bb07ba1d3b67a9aaed 100644 (file)
@@ -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) {
index ac0e4c9010b9c0b6f30f992262f71224094995ba..524f373a11f8ab95bebe36e2924755558bba2b99 100644 (file)
@@ -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
index eb040aee147da9098d0402fb9850dbd55742dbdb..0bf3cc56a90e0629b5fca7ac3463564accc18191 100644 (file)
@@ -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) {
index 4791414bf259cfccd7e330c69e67641153030f61..593555b05ad74e44726686548ccfb6e0df494dbc 100644 (file)
@@ -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) {
index 60a979cb02fedda20616120b06d65edf2656d6c1..9f470952fc568a5422bf09ba54fc079211be293b 100644 (file)
@@ -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",
index e25079077ee9b2b2e2cc17c85377d33e176128d8..2b2c453c19e7d8ad87abc0e744383df6b6935eaf 100644 (file)
@@ -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",
index 7b5e6ba13685896992591fe6e4c75c1874fe41c6..d8312c8227bdf2fd60bdce8c9332962e6ef1d5b5 100644 (file)
@@ -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;
index cc8e03b9017d929500f282f68e5d0c3cc7ca6070..574c3b7f3453b14c34b5ddc9991771d861ac40dd 100644 (file)
@@ -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));