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