From: Marco Bettini Date: Thu, 7 Jul 2022 08:01:09 +0000 (+0000) Subject: lib-storage: index/dbox-single - Replace i_() with e_() X-Git-Tag: 2.4.0~3712 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d459dde43e2ace1839f1faf0b8f81d213ebdb094;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: index/dbox-single - Replace i_() with e_() --- diff --git a/src/lib-storage/index/dbox-single/sdbox-file.c b/src/lib-storage/index/dbox-single/sdbox-file.c index fed111a77f..a7bec9ec5a 100644 --- a/src/lib-storage/index/dbox-single/sdbox-file.c +++ b/src/lib-storage/index/dbox-single/sdbox-file.c @@ -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); } diff --git a/src/lib-storage/index/dbox-single/sdbox-storage.c b/src/lib-storage/index/dbox-single/sdbox-storage.c index ee7b023ee8..219873ef23 100644 --- a/src/lib-storage/index/dbox-single/sdbox-storage.c +++ b/src/lib-storage/index/dbox-single/sdbox-storage.c @@ -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; } diff --git a/src/lib-storage/index/dbox-single/sdbox-sync-rebuild.c b/src/lib-storage/index/dbox-single/sdbox-sync-rebuild.c index c4feeca17a..e9a4c639ba 100644 --- a/src/lib-storage/index/dbox-single/sdbox-sync-rebuild.c +++ b/src/lib-storage/index/dbox-single/sdbox-sync-rebuild.c @@ -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,