]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: index/dbox-single - Replace i_<log>() with e_<log>()
authorMarco Bettini <marco.bettini@open-xchange.com>
Thu, 7 Jul 2022 08:01:09 +0000 (08:01 +0000)
committerMarco Bettini <marco.bettini@open-xchange.com>
Thu, 4 Aug 2022 12:05:27 +0000 (12:05 +0000)
src/lib-storage/index/dbox-single/sdbox-file.c
src/lib-storage/index/dbox-single/sdbox-storage.c
src/lib-storage/index/dbox-single/sdbox-sync-rebuild.c

index fed111a77fee88e6e81ba987e4dfa363f177ca87..a7bec9ec5a851d2f102138ca252b5479ecd6c093 100644 (file)
@@ -417,6 +417,7 @@ sdbox_unlink_attachments(struct sdbox_file *sfile,
 
 int sdbox_file_unlink_with_attachments(struct sdbox_file *sfile)
 {
+       struct event *event = sfile->mbox->box.event;
        ARRAY_TYPE(mail_attachment_extref) extrefs;
        const char *extrefs_line;
        pool_t pool;
@@ -433,7 +434,7 @@ int sdbox_file_unlink_with_attachments(struct sdbox_file *sfile)
        pool = pool_alloconly_create("sdbox attachments unlink", 1024);
        p_array_init(&extrefs, pool, 16);
        if (!index_attachment_parse_extrefs(extrefs_line, pool, &extrefs)) {
-               i_warning("%s: Ignoring corrupted extref: %s",
+               e_warning(event, "%s: Ignoring corrupted extref: %s",
                          sfile->file.cur_path, extrefs_line);
                array_clear(&extrefs);
        }
index ee7b023ee85fed22591c1031cf5401c4c6e477ba..219873ef234a515c66795bac6e99428bae7fad3d 100644 (file)
@@ -59,19 +59,19 @@ static int sdbox_storage_create(struct mail_storage *_storage,
 static const char *
 sdbox_storage_find_root_dir(const struct mail_namespace *ns)
 {
-       bool debug = ns->mail_set->mail_debug;
+       struct event *event = ns->user->event;
        const char *home, *path;
 
        if (ns->owner != NULL &&
            mail_user_get_home(ns->owner, &home) > 0) {
                path = t_strconcat(home, "/sdbox", NULL);
                if (access(path, R_OK|W_OK|X_OK) == 0) {
-                       if (debug)
-                               i_debug("sdbox: root exists (%s)", path);
+                       e_debug(event,
+                               "sdbox autodetect: root exists (%s)", path);
                        return path;
                }
-               if (debug)
-                       i_debug("sdbox: access(%s, rwx): failed: %m", path);
+               e_debug(event,
+                       "sdbox autodetect: access(%s, rwx): failed: %m", path);
        }
        return NULL;
 }
@@ -79,7 +79,7 @@ sdbox_storage_find_root_dir(const struct mail_namespace *ns)
 static bool sdbox_storage_autodetect(const struct mail_namespace *ns,
                                     struct mailbox_list_settings *set)
 {
-       bool debug = ns->mail_set->mail_debug;
+       struct event *event = ns->user->event;
        struct stat st;
        const char *path, *root_dir;
 
@@ -88,8 +88,8 @@ static bool sdbox_storage_autodetect(const struct mail_namespace *ns,
        else {
                root_dir = sdbox_storage_find_root_dir(ns);
                if (root_dir == NULL) {
-                       if (debug)
-                               i_debug("sdbox: couldn't find root dir");
+                       e_debug(event,
+                               "sdbox autodetect: couldn't find root dir");
                        return FALSE;
                }
        }
@@ -98,14 +98,12 @@ static bool sdbox_storage_autodetect(const struct mail_namespace *ns,
           autodetect ordering to catch mdbox before we get here. */
        path = t_strconcat(root_dir, "/"DBOX_MAILBOX_DIR_NAME, NULL);
        if (stat(path, &st) < 0) {
-               if (debug)
-                       i_debug("sdbox autodetect: stat(%s) failed: %m", path);
+               e_debug(event, "sdbox autodetect: stat(%s) failed: %m", path);
                return FALSE;
        }
 
        if (!S_ISDIR(st.st_mode)) {
-               if (debug)
-                       i_debug("sdbox autodetect: %s not a directory", path);
+               e_debug(event, "sdbox autodetect: %s not a directory", path);
                return FALSE;
        }
 
index c4feeca17aa82f2136ff37014bb3dc39ee556452..e9a4c639ba6f5616e5542039bc9c2d3ca31b1a63 100644 (file)
@@ -46,7 +46,8 @@ sdbox_sync_add_file_index(struct index_rebuild_context *ctx,
                if (ret < 0)
                        return -1;
 
-               i_warning("sdbox: Skipping unfixable file: %s", file->cur_path);
+               e_warning(ctx->box->event, "Skipping unfixable file: %s",
+                         file->cur_path);
                return 0;
        }
 
@@ -77,8 +78,7 @@ sdbox_sync_add_file(struct index_rebuild_context *ctx,
                return 0;
 
        if (str_to_uint32(fname, &uid) < 0 || uid == 0) {
-               i_warning("sdbox %s: Ignoring invalid filename %s",
-                         mailbox_get_path(ctx->box), fname);
+               e_warning(mbox->box.event, "Ignoring invalid filename %s", fname);
                return 0;
        }
 
@@ -188,7 +188,7 @@ int sdbox_sync_index_rebuild(struct sdbox_mailbox *mbox, bool force)
                        return 0;
                }
        }
-       i_warning("sdbox %s: Rebuilding index", mailbox_get_path(&mbox->box));
+       e_warning(mbox->box.event, "Rebuilding index");
 
        if (dbox_verify_alt_storage(mbox->box.list) < 0) {
                mailbox_set_critical(&mbox->box,