]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
global: Remove mailbox_set_reason() calls
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 11 Mar 2021 17:06:00 +0000 (19:06 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 29 Sep 2021 10:09:58 +0000 (10:09 +0000)
These ones that are left are all rather unnecessary.

src/lib-imap-storage/imap-metadata.c
src/lib-imap-storage/imap-msgpart-url.c
src/lib-imap-urlauth/imap-urlauth-backend.c
src/lib-lda/mail-deliver.c
src/lib-storage/mail-storage.c
src/lmtp/lmtp-local.c
src/plugins/quota/quota-status.c
src/plugins/virtual/virtual-storage.c

index 34b5064312752968e114b826fa527c8e3231493e..eb791a495afed57146da64baf70518984e78adf0 100644 (file)
@@ -246,7 +246,6 @@ imap_metadata_transaction_begin_server(struct mail_user *user)
        /* Server metadata shouldn't depend on INBOX's ACLs, so ignore them. */
        box = mailbox_alloc(ns->list, "INBOX", MAILBOX_FLAG_IGNORE_ACLS |
                            MAILBOX_FLAG_ATTRIBUTE_SESSION);
-       mailbox_set_reason(box, "Server METADATA");
        imtrans = imap_metadata_transaction_begin(box);
        imtrans->server = TRUE;
        return imtrans;
index 8f821aa1888699d58d575c40e7acf114652f07f1..2469dd3c8b1a22904b86ed1b4dbe016642f93aed 100644 (file)
@@ -127,10 +127,8 @@ int imap_msgpart_url_open_mailbox(struct imap_msgpart_url *mpurl,
        if (mpurl->selected_box != NULL &&
            mailbox_equals(mpurl->selected_box, ns, mpurl->mailbox))
                box = mpurl->selected_box;
-       else {
+       else
                box = mailbox_alloc(ns->list, mpurl->mailbox, flags);
-               mailbox_set_reason(box, "Read IMAP URL");
-       }
        if (mailbox_open(box) < 0) {
                *client_error_r = mail_storage_get_last_error(mailbox_get_storage(box),
                                                              error_code_r);
index 84af3c220b0e8a817728530ccfd04ecb7d97b687..de2b9c9e57c0961eba67b1ac16b66593a9a92620 100644 (file)
@@ -161,7 +161,6 @@ int imap_urlauth_backend_reset_all_keys(struct mail_user *user)
                                                 MAILBOX_LIST_ITER_RETURN_NO_FLAGS);
        while ((info = mailbox_list_iter_next(iter)) != NULL) {
                box = mailbox_alloc(info->ns->list, info->vname, 0);
-               mailbox_set_reason(box, "URLAUTH reset all keys");
                if (imap_urlauth_backend_mailbox_reset_key(box) < 0)
                        ret = -1;
                mailbox_free(&box);
index 46ee3876bcd97616d8a97797e7efa365ea2f3df9..e0f69da216b03c3131504e5ec024dd52bb373c43 100644 (file)
@@ -697,8 +697,6 @@ mail_deliver_fields_update_post_commit(struct mailbox *orig_box, uint32_t uid)
           synced, so it'll contain the newly written mail. this is racy, so
           it's possible another process has already deleted the mail. */
        box = mailbox_alloc(orig_box->list, orig_box->vname, 0);
-       mailbox_set_reason(box, "lib-lda storage-id");
-
        mail = mail_deliver_open_mail(box, uid, MAIL_FETCH_STORAGE_ID, &t);
        if (mail != NULL) {
                if (mail_get_special(mail, MAIL_FETCH_STORAGE_ID, &storage_id) < 0 ||
@@ -790,9 +788,6 @@ static void mail_deliver_mailbox_allocated(struct mailbox *box)
        if (muser->deliver_ctx == NULL)
                return;
 
-       if ((box->flags & MAILBOX_FLAG_POST_SESSION) != 0)
-               mailbox_set_reason(box, "lib-lda delivery");
-
        mbox = p_new(box->pool, struct mail_deliver_mailbox, 1);
        mbox->module_ctx.super = *v;
        box->vlast = &mbox->module_ctx.super;
index d7792507a331ac96dca85af25880e449b00b386f..51dba8ae6ae27317c221d0b24dbd9013719fb58e 100644 (file)
@@ -1723,7 +1723,6 @@ static void mailbox_copy_cache_decisions_from_inbox(struct mailbox *box)
 
        /* this should be NoSelect but since inbox can never be
           NoSelect we use EXISTENCE_NONE to avoid creating inbox by accident */
-       mailbox_set_reason(inbox, "copy caching decisions");
        if (mailbox_exists(inbox, FALSE, &existence) == 0 &&
            existence != MAILBOX_EXISTENCE_NONE &&
            mailbox_open(inbox) == 0 &&
index 055641efa4dc32a93b56b24d620547a856fdc2d1..8e6b8bd412243c898e48fce3868c70545637d453 100644 (file)
@@ -196,7 +196,6 @@ lmtp_local_rcpt_check_quota(struct lmtp_local_recipient *llrcpt)
                        mail_storage_service_user_get_log_prefix(llrcpt->service_user));
                ns = mail_namespace_find_inbox(user->namespaces);
                box = mailbox_alloc(ns->list, "INBOX", 0);
-               mailbox_set_reason(box, "over-quota check");
                ret = mailbox_get_status(box, STATUS_CHECK_OVER_QUOTA, &status);
                if (ret < 0) {
                        error = mailbox_get_last_error(box, &mail_error);
index e24a032ac0af3da29415b757c38cff53d7e3b60f..7db0cb42623339136b15253d52da106acf3cc7ec 100644 (file)
@@ -85,7 +85,6 @@ quota_check(struct mail_user *user, uoff_t mail_size, const char **error_r)
 
        ns = mail_namespace_find_inbox(user->namespaces);
        box = mailbox_alloc(ns->list, "INBOX", MAILBOX_FLAG_POST_SESSION);
-       mailbox_set_reason(box, "quota status");
 
        ctx = quota_transaction_begin(box);
        const char *internal_error;
index a01510f91787cf34ef949ab065c7ca4e38cc3e84..2f31503d5391d25e7d0b95ff4962176a82f9edca 100644 (file)
@@ -193,9 +193,6 @@ static int virtual_backend_box_alloc(struct virtual_mailbox *mbox,
        ns = mail_namespace_find(user->namespaces, mailbox);
        bbox->box = mailbox_alloc(ns->list, mailbox, flags);
        MODULE_CONTEXT_SET(bbox->box, virtual_storage_module, bbox);
-       mailbox_set_reason(bbox->box, mbox->box.reason == NULL ?
-               t_strdup_printf("virtual mailbox %s", mailbox_get_vname(&mbox->box)) :
-               t_strdup_printf("virtual mailbox %s: %s", mailbox_get_vname(&mbox->box), mbox->box.reason));
 
        if (bbox == mbox->save_bbox) {
                /* Assume that the save_bbox exists, whether or not it truly