]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Remove mailbox_set_reason()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 11 Mar 2021 17:07:10 +0000 (19:07 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 29 Sep 2021 10:09:58 +0000 (10:09 +0000)
Event reason_codes should be used instead. Keep the "Mailbox opened"
debug message mainly because it's often used in CI tests.

src/lib-storage/mail-storage-private.h
src/lib-storage/mail-storage.c
src/lib-storage/mail-storage.h

index bdea31d0d2ab1e5844a490f10f1cf1c285a8a73f..9537a5b6dea60678328a1dd4db39f1c3e3701940 100644 (file)
@@ -390,8 +390,6 @@ struct mailbox {
        /* Filled lazily when mailbox is opened, use mailbox_get_index_path()
           to access it */
        const char *_index_path;
-       /* Reason for why mailbox is being accessed or NULL if unknown. */
-       const char *reason;
 
        /* default vfuncs for new struct mails. */
        const struct mail_vfuncs *mail_vfuncs;
index 51dba8ae6ae27317c221d0b24dbd9013719fb58e..732e74a153926c7150aa5287df87f3f4cf607272 100644 (file)
@@ -1091,13 +1091,6 @@ mailbox_alloc_for_user(struct mail_user *user, const char *mname,
        return box;
 }
 
-void mailbox_set_reason(struct mailbox *box, const char *reason)
-{
-       i_assert(reason != NULL);
-
-       box->reason = p_strdup(box->pool, reason);
-}
-
 bool mailbox_is_autocreated(struct mailbox *box)
 {
        if (box->inbox_user)
@@ -1462,14 +1455,9 @@ mailbox_open_full(struct mailbox *box, struct istream *input)
        if (box->opened)
                return 0;
 
-       if (box->reason != NULL) {
-               e_debug(box->event,
-                       "Mailbox opened because: %s",
-                       box->reason);
-       }
-
        switch (box->open_error) {
        case 0:
+               e_debug(box->event, "Mailbox opened");
                break;
        case MAIL_ERROR_NOTFOUND:
                mail_storage_set_error(box->storage, MAIL_ERROR_NOTFOUND,
index 25a98b269eee3d0a8d295ea908b9255efbfdf385..8487d520bc551aa47b729d8e6e5a8cbfebac5df1 100644 (file)
@@ -529,9 +529,6 @@ struct mailbox *
 mailbox_alloc_for_user(struct mail_user *user, const char *mname,
                       enum mailbox_flags flags);
 
-/* Set a human-readable reason for why this mailbox is being accessed.
-   This is used for logging purposes. */
-void mailbox_set_reason(struct mailbox *box, const char *reason);
 /* Get mailbox existence state. If auto_boxes=FALSE, return
    MAILBOX_EXISTENCE_NONE for autocreated mailboxes that haven't been
    physically created yet */