They are now unnecessary because of the new reason_code field.
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));
}
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) {
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
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) {
*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) {
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",
}
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));
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);
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));
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" :
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",
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;
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));