From: Timo Sirainen Date: Thu, 11 Mar 2021 13:44:47 +0000 (+0200) Subject: imap: Remove mailbox_set_reason() calls X-Git-Tag: 2.3.18~348 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b41063291ed4fa232d594aa8f8af45d52349bb12;p=thirdparty%2Fdovecot%2Fcore.git imap: Remove mailbox_set_reason() calls They are now unnecessary because of the new reason_code field. --- diff --git a/src/imap/cmd-create.c b/src/imap/cmd-create.c index 75f23b4159..2459173c27 100644 --- a/src/imap/cmd-create.c +++ b/src/imap/cmd-create.c @@ -39,7 +39,6 @@ bool cmd_create(struct client_command_context *cmd) box = mailbox_alloc(ns->list, mailbox, 0); event_add_str(cmd->global_event, "mailbox", mailbox_get_vname(box)); - mailbox_set_reason(box, "CREATE"); if (mailbox_create(box, NULL, directory) < 0) client_send_box_error(cmd, box); else diff --git a/src/imap/cmd-delete.c b/src/imap/cmd-delete.c index f8bb053b20..e095321cdb 100644 --- a/src/imap/cmd-delete.c +++ b/src/imap/cmd-delete.c @@ -22,7 +22,6 @@ bool cmd_delete(struct client_command_context *cmd) box = mailbox_alloc(ns->list, name, 0); event_add_str(cmd->global_event, "mailbox", mailbox_get_vname(box)); - mailbox_set_reason(box, "DELETE"); if (mailbox_is_any_inbox(box)) { /* IMAP protocol allows this, but I think it's safer to not allow it. */ diff --git a/src/imap/cmd-getmetadata.c b/src/imap/cmd-getmetadata.c index 676d4e466f..ec23135c6c 100644 --- a/src/imap/cmd-getmetadata.c +++ b/src/imap/cmd-getmetadata.c @@ -437,7 +437,6 @@ cmd_getmetadata_try_mailbox(struct imap_getmetadata_context *ctx, ctx->box = mailbox_alloc(ns->list, mailbox, MAILBOX_FLAG_READONLY); event_add_str(ctx->cmd->global_event, "mailbox", mailbox_get_vname(ctx->box)); - mailbox_set_reason(ctx->box, "GETMETADATA"); enum mailbox_existence existence; if (mailbox_exists(ctx->box, TRUE, &existence) < 0) { diff --git a/src/imap/cmd-notify.c b/src/imap/cmd-notify.c index 5c7564c49e..e043e97268 100644 --- a/src/imap/cmd-notify.c +++ b/src/imap/cmd-notify.c @@ -441,7 +441,6 @@ imap_notify_box_send_status(struct client_command_context *cmd, items.flags |= IMAP_STATUS_ITEM_HIGHESTMODSEQ; box = mailbox_alloc(info->ns->list, info->vname, MAILBOX_FLAG_READONLY); - mailbox_set_reason(box, "NOTIFY send STATUS"); (void)mailbox_enable(box, client_enabled_mailbox_features(ctx->client)); if (imap_status_get(cmd, info->ns, info->vname, &items, &result) < 0) { diff --git a/src/imap/cmd-rename.c b/src/imap/cmd-rename.c index db706221b4..45b44fd183 100644 --- a/src/imap/cmd-rename.c +++ b/src/imap/cmd-rename.c @@ -37,8 +37,6 @@ bool cmd_rename(struct client_command_context *cmd) old_box = mailbox_alloc(old_ns->list, oldname, 0); new_box = mailbox_alloc(new_ns->list, newname, 0); - mailbox_set_reason(old_box, "RENAME from"); - mailbox_set_reason(new_box, "RENAME to"); event_add_str(cmd->global_event, "old_mailbox", mailbox_get_vname(old_box)); event_add_str(cmd->global_event, "new_mailbox", diff --git a/src/imap/cmd-resetkey.c b/src/imap/cmd-resetkey.c index 230056d38e..34759949c3 100644 --- a/src/imap/cmd-resetkey.c +++ b/src/imap/cmd-resetkey.c @@ -50,7 +50,6 @@ cmd_resetkey_mailbox(struct client_command_context *cmd, /* open mailbox */ box = mailbox_alloc(ns->list, mailbox, flags); event_add_str(cmd->global_event, "mailbox", mailbox_get_vname(box)); - mailbox_set_reason(box, "RESETKEY"); if (mailbox_open(box) < 0) { client_send_box_error(cmd, box); mailbox_free(&box); diff --git a/src/imap/cmd-select.c b/src/imap/cmd-select.c index 6a45b2de20..c9af870ec4 100644 --- a/src/imap/cmd-select.c +++ b/src/imap/cmd-select.c @@ -285,7 +285,6 @@ select_open(struct imap_select_context *ctx, const char *mailbox, bool readonly) ctx->box = mailbox_alloc(ctx->ns->list, mailbox, flags); event_add_str(ctx->cmd->global_event, "mailbox", mailbox_get_vname(ctx->box)); - mailbox_set_reason(ctx->box, readonly ? "EXAMINE" : "SELECT"); if (mailbox_open(ctx->box) < 0) { client_send_box_error(ctx->cmd, ctx->box); mailbox_free(&ctx->box); diff --git a/src/imap/cmd-setmetadata.c b/src/imap/cmd-setmetadata.c index 614a166595..247afce0df 100644 --- a/src/imap/cmd-setmetadata.c +++ b/src/imap/cmd-setmetadata.c @@ -324,7 +324,6 @@ cmd_setmetadata_mailbox(struct imap_setmetadata_context *ctx, else { ctx->box = mailbox_alloc(ns->list, mailbox, MAILBOX_FLAG_ATTRIBUTE_SESSION); - mailbox_set_reason(ctx->box, "SETMETADATA"); enum mailbox_existence existence; if (mailbox_exists(ctx->box, TRUE, &existence) < 0) { client_send_box_error(cmd, ctx->box); diff --git a/src/imap/cmd-subscribe.c b/src/imap/cmd-subscribe.c index 24741af497..03c2684c08 100644 --- a/src/imap/cmd-subscribe.c +++ b/src/imap/cmd-subscribe.c @@ -49,7 +49,6 @@ bool cmd_subscribe_full(struct client_command_context *cmd, bool subscribe) box = mailbox_alloc(ns->list, mailbox, 0); event_add_str(cmd->global_event, "mailbox", mailbox_get_vname(box)); - mailbox_set_reason(box, subscribe ? "SUBSCRIBE" : "UNSUBSCRIBE"); if (subscribe) { if (!subscribe_is_valid_name(cmd, box)) { mailbox_free(&box); @@ -65,7 +64,6 @@ bool cmd_subscribe_full(struct client_command_context *cmd, bool subscribe) /* try to unsubscribe both "box" and "box/" */ const char *name2 = t_strdup_printf("%s%c", mailbox, sep); box2 = mailbox_alloc(ns->list, name2, 0); - mailbox_set_reason(box2, "UNSUBSCRIBE"); if (mailbox_set_subscribed(box2, FALSE) == 0) unsubscribed_mailbox2 = TRUE; mailbox_free(&box2); diff --git a/src/imap/imap-commands-util.c b/src/imap/imap-commands-util.c index f6194811f1..2d454a7d7d 100644 --- a/src/imap/imap-commands-util.c +++ b/src/imap/imap-commands-util.c @@ -112,7 +112,6 @@ int client_open_save_dest_box(struct client_command_context *cmd, return 0; } box = mailbox_alloc(ns->list, name, MAILBOX_FLAG_SAVEONLY); - mailbox_set_reason(box, cmd->name); if (mailbox_open(box) < 0) { error_string = mailbox_get_last_error(box, &error); if (error == MAIL_ERROR_NOTFOUND) { diff --git a/src/imap/imap-notify.c b/src/imap/imap-notify.c index ea441a2793..fa2c9ef4c1 100644 --- a/src/imap/imap-notify.c +++ b/src/imap/imap-notify.c @@ -55,7 +55,6 @@ static int imap_notify_status(struct imap_notify_namespace *notify_ns, items.flags |= IMAP_STATUS_ITEM_HIGHESTMODSEQ; box = mailbox_alloc(notify_ns->ns->list, rec->vname, 0); - mailbox_set_reason(box, "NOTIFY STATUS"); if ((rec->events & MAILBOX_LIST_NOTIFY_UIDVALIDITY) != 0) { items.flags |= IMAP_STATUS_ITEM_UIDVALIDITY | IMAP_STATUS_ITEM_UIDNEXT | IMAP_STATUS_ITEM_MESSAGES | @@ -198,7 +197,6 @@ bool imap_notify_match_mailbox(struct imap_notify_namespace *notify_ns, switch (notify_boxes->type) { case IMAP_NOTIFY_TYPE_SUBSCRIBED: box = mailbox_alloc(notify_ns->ns->list, vname, 0); - mailbox_set_reason(box, "NOTIFY is subscribed"); ret = mailbox_is_subscribed(box); mailbox_free(&box); return ret; diff --git a/src/imap/imap-state.c b/src/imap/imap-state.c index bdae5189f0..2b064ec809 100644 --- a/src/imap/imap-state.c +++ b/src/imap/imap-state.c @@ -571,7 +571,6 @@ import_state_mailbox_open(struct client *client, else flags |= MAILBOX_FLAG_DROP_RECENT; box = mailbox_alloc(ns->list, state->vname, flags); - mailbox_set_reason(box, "unhibernate"); if (mailbox_open(box) < 0) { *error_r = t_strdup_printf("Couldn't open mailbox: %s", mailbox_get_last_internal_error(box, NULL)); diff --git a/src/imap/imap-status.c b/src/imap/imap-status.c index ef521cb2f2..341e537ac2 100644 --- a/src/imap/imap-status.c +++ b/src/imap/imap-status.c @@ -109,7 +109,6 @@ int imap_status_get(struct client_command_context *cmd, } else { /* open the mailbox */ box = mailbox_alloc(ns->list, mailbox, MAILBOX_FLAG_READONLY); - mailbox_set_reason(box, "STATUS"); (void)mailbox_enable(box, client_enabled_mailbox_features(client)); }