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;
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);
}
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;
}
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;
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;
}
}
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;
}
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;
}
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;
}
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,