From: Timo Sirainen Date: Thu, 11 Mar 2021 17:06:00 +0000 (+0200) Subject: global: Remove mailbox_set_reason() calls X-Git-Tag: 2.3.18~334 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f1db5fbfb3194a79bf6b10f3c72e6dcc2b099ed5;p=thirdparty%2Fdovecot%2Fcore.git global: Remove mailbox_set_reason() calls These ones that are left are all rather unnecessary. --- diff --git a/src/lib-imap-storage/imap-metadata.c b/src/lib-imap-storage/imap-metadata.c index 34b5064312..eb791a495a 100644 --- a/src/lib-imap-storage/imap-metadata.c +++ b/src/lib-imap-storage/imap-metadata.c @@ -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; diff --git a/src/lib-imap-storage/imap-msgpart-url.c b/src/lib-imap-storage/imap-msgpart-url.c index 8f821aa188..2469dd3c8b 100644 --- a/src/lib-imap-storage/imap-msgpart-url.c +++ b/src/lib-imap-storage/imap-msgpart-url.c @@ -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); diff --git a/src/lib-imap-urlauth/imap-urlauth-backend.c b/src/lib-imap-urlauth/imap-urlauth-backend.c index 84af3c220b..de2b9c9e57 100644 --- a/src/lib-imap-urlauth/imap-urlauth-backend.c +++ b/src/lib-imap-urlauth/imap-urlauth-backend.c @@ -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); diff --git a/src/lib-lda/mail-deliver.c b/src/lib-lda/mail-deliver.c index 46ee3876bc..e0f69da216 100644 --- a/src/lib-lda/mail-deliver.c +++ b/src/lib-lda/mail-deliver.c @@ -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; diff --git a/src/lib-storage/mail-storage.c b/src/lib-storage/mail-storage.c index d7792507a3..51dba8ae6a 100644 --- a/src/lib-storage/mail-storage.c +++ b/src/lib-storage/mail-storage.c @@ -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 && diff --git a/src/lmtp/lmtp-local.c b/src/lmtp/lmtp-local.c index 055641efa4..8e6b8bd412 100644 --- a/src/lmtp/lmtp-local.c +++ b/src/lmtp/lmtp-local.c @@ -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); diff --git a/src/plugins/quota/quota-status.c b/src/plugins/quota/quota-status.c index e24a032ac0..7db0cb4262 100644 --- a/src/plugins/quota/quota-status.c +++ b/src/plugins/quota/quota-status.c @@ -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; diff --git a/src/plugins/virtual/virtual-storage.c b/src/plugins/virtual/virtual-storage.c index a01510f917..2f31503d53 100644 --- a/src/plugins/virtual/virtual-storage.c +++ b/src/plugins/virtual/virtual-storage.c @@ -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