if (mail_namespace_get_sep(ns) != mail_namespace_get_sep(ns2)) {
e_error(ctx->ctx.cctx->event,
"Mail locations must use the same hierarchy separator "
- "(specify namespace prefix=\"%s\" "
- "{ separator } explicitly)", ns->prefix);
+ "(specify namespace %s { separator } explicitly)",
+ ns->set->name);
ctx->ctx.exit_code = EX_CONFIG;
mail_user_deinit(&user2);
return -1;
paths_are_equal(ns, ns2, MAILBOX_LIST_PATH_TYPE_INDEX)) {
e_error(ctx->ctx.cctx->event,
"Both source and destination mail_location "
- "points to same directory: %s (namespace "
- "prefix=\"%s\" { location } is set explicitly?)",
+ "points to same directory: %s (namespace %s "
+ "{ location } is set explicitly?)",
mailbox_list_get_root_forced(user->namespaces->list,
MAILBOX_LIST_PATH_TYPE_MAILBOX),
- ns->prefix);
+ ns->set->name);
ctx->ctx.exit_code = EX_CONFIG;
mail_user_deinit(&user2);
return -1;
{
if (mail_storage_purge(storage) < 0) {
e_error(mailbox_list_get_event(ns->list),
- "Purging namespace '%s' failed: %s", ns->prefix,
+ "Purging namespace %s failed: %s", ns->set->name,
mail_storage_get_last_internal_error(storage, NULL));
doveadm_mail_failed_storage(ctx, storage);
return -1;
storage = mail_namespace_get_default_storage(ns);
if (mail_storage_purge(storage) < 0) {
e_error(ctx->cctx->event,
- "Purging namespace '%s' failed: %s", ns->prefix,
+ "Purging namespace %s failed: %s", ns->set->name,
mail_storage_get_last_internal_error(storage, NULL));
doveadm_mail_failed_storage(ctx, storage);
ret = -1;
first_ns = ns;
} else if (brain->hierarchy_sep != sep) {
i_fatal("Synced namespaces have conflicting separators "
- "('%c' for prefix=\"%s\", '%c' for prefix=\"%s\")",
- brain->hierarchy_sep, first_ns->prefix,
- sep, ns->prefix);
+ "('%c' for %s, '%c' for %s)",
+ brain->hierarchy_sep, first_ns->set->name,
+ sep, ns->set->name);
} else if (brain->escape_char != escape_char) {
i_fatal("Synced namespaces have conflicting escape chars "
- "('%c' for prefix=\"%s\", '%c' for prefix=\"%s\")",
- brain->escape_char, first_ns->prefix,
- escape_char, ns->prefix);
+ "('%c' for %s, '%c' for %s)",
+ brain->escape_char, first_ns->set->name,
+ escape_char, ns->set->name);
}
}
if (brain->hierarchy_sep != '\0')
if (!dsync_brain_want_namespace(brain, ns))
continue;
e_debug(brain->event, "Namespace %s has location %s",
- ns->prefix, ns->set->location);
+ ns->set->name, ns->set->location);
if (dsync_mailbox_tree_fill(brain->local_mailbox_tree, ns,
brain->sync_box,
brain->sync_box_guid,
storage = mail_namespace_get_default_storage(ns);
if (mail_storage_purge(storage) < 0) {
e_error(brain->event,
- "Purging namespace '%s' failed: %s", ns->prefix,
+ "Purging namespace %s failed: %s", ns->set->name,
mail_storage_get_last_internal_error(storage, NULL));
}
}
node->ns = info->ns;
} else {
e_error(event,
- "Mailbox '%s' exists in two namespaces: '%s' and '%s'",
- vname, node->ns->prefix, info->ns->prefix);
+ "Mailbox '%s' exists in two namespaces: %s and %s",
+ vname, node->ns->set->name, info->ns->set->name);
return -1;
}
*node_r = node;
}
}
if (mailbox_log_iter_deinit(&iter) < 0) {
- e_error(event, "Mailbox log iteration for namespace '%s' failed",
- ns->prefix);
+ e_error(event, "Mailbox log iteration for namespace %s failed",
+ ns->set->name);
return -1;
}
return 0;
}
} T_END;
if (mailbox_list_iter_deinit(&iter) < 0) {
- e_error(event, "Mailbox listing for namespace '%s' failed: %s",
- ns->prefix, mailbox_list_get_last_internal_error(ns->list, error_r));
+ e_error(event, "Mailbox listing for namespace %s failed: %s",
+ ns->set->name, mailbox_list_get_last_internal_error(ns->list, error_r));
ret = -1;
}
}
}
if (mailbox_list_iter_deinit(&iter) < 0) {
- e_error(event, "Mailbox listing for namespace '%s' failed: %s",
- ns->prefix, mailbox_list_get_last_internal_error(ns->list, error_r));
+ e_error(event, "Mailbox listing for namespace %s failed: %s",
+ ns->set->name, mailbox_list_get_last_internal_error(ns->list, error_r));
ret = -1;
}
if (ret < 0)
mailbox_list_get_global_temp_prefix(fs_list) :
mailbox_list_get_temp_prefix(fs_list);
} else {
- i_panic("imapc: Can't return a temp prefix for '%s'",
- _list->ns->prefix);
+ i_panic("imapc: Can't return a temp prefix for namespace %s",
+ _list->ns->set->name);
}
}
static const char *
shared_list_get_temp_prefix(struct mailbox_list *list, bool global ATTR_UNUSED)
{
- i_panic("shared mailbox list: Can't return a temp prefix for '%s'",
- list->ns->prefix);
+ i_panic("shared mailbox list: Can't return a temp prefix for namespace %s",
+ list->ns->set->name);
}
static const char *
&owner, &error) < 0) {
if (owner == NULL || !owner->nonexistent) {
mailbox_list_set_critical(list,
- "Couldn't create namespace '%s' for user %s: %s",
- ns->prefix, userdomain, error);
+ "Couldn't create namespace %s for user %s: %s",
+ ns->set->name, userdomain, error);
if (owner != NULL)
mail_user_deinit(&owner);
io_loop_context_switch(old_ioloop_ctx);
} else {
/* we'll need to look up the user's home directory */
if ((ret = mail_user_get_home(owner, &tab[3].value)) < 0) {
- mailbox_list_set_critical(ns->list, "Namespace '%s': "
+ mailbox_list_set_critical(ns->list, "Namespace %s: "
"Could not lookup home for user %s",
- ns->prefix, owner->username);
+ ns->set->name, owner->username);
mail_user_deinit(&owner);
return -1;
}
if (mail_storage_create(new_ns, NULL, _storage->flags |
MAIL_STORAGE_FLAG_NO_AUTOVERIFY, &error) < 0) {
- mailbox_list_set_critical(ns->list, "Namespace '%s': %s",
- new_ns->prefix, error);
+ mailbox_list_set_critical(ns->list, "Namespace %s: %s",
+ new_ns->set->name, error);
/* owner gets freed by namespace deinit */
mail_namespace_destroy(new_ns);
return -1;
array_foreach_modifiable(&ctx->rebuild_namespaces, rebuild_ns) {
e_debug(ctx->storage->event,
- "Rebuilding list index for namespace '%s'",
- rebuild_ns->ns->prefix);
+ "Rebuilding list index for namespace %s",
+ rebuild_ns->ns->set->name);
if (mail_storage_list_index_fill_storage_mailboxes(ctx, rebuild_ns->ns->list) < 0)
return -1;
if (mail_storage_list_index_find_indexed_mailboxes(ctx, rebuild_ns) < 0)
}
if (mail_storage_create(ns, driver, 0, &error) < 0) {
- *error_r = t_strdup_printf("Namespace '%s': %s",
- ns->prefix, error);
+ *error_r = t_strdup_printf("Namespace %s: %s",
+ ns->set->name, error);
mail_namespace_free(ns);
return -1;
}
*error_r = t_strdup_printf(
"Namespace %s can't have alias_for=%s "
"to a different storage type (%s vs %s)",
- ns->prefix, ns->alias_for->prefix,
+ ns->set->name, ns->alias_for->prefix,
ns->storage->name, ns->alias_for->storage->name);
return FALSE;
}
*error_r = t_strdup_printf(
"Namespace %s can't have alias_for=%s "
"to a different storage (different root dirs)",
- ns->prefix, ns->alias_for->prefix);
+ ns->set->name, ns->alias_for->prefix);
return FALSE;
}
return TRUE;
if (strcmp(ns_list_index_path, ns2_list_index_path) == 0 &&
strcmp(ns_mailboxes_root, ns2_mailboxes_root) != 0) {
*error_r = t_strdup_printf(
- "Namespaces '%s' and '%s' have different mailboxes paths, but duplicate LISTINDEX path. "
+ "Namespaces %s and %s have different mailboxes paths, but duplicate LISTINDEX path. "
"Add a unique LISTINDEX=<fname>",
- ns->prefix, ns2->prefix);
+ ns->set->name, ns2->set->name);
return TRUE;
}
}
}
if (alias_ns == NULL) {
*error_r = t_strdup_printf(
- "Namespace '%s': alias_for points to "
+ "Namespace %s: alias_for points to "
"unknown namespace name: %s",
- ns->prefix != NULL ? ns->prefix : "",
- ns->alias_for);
+ ns->name, ns->alias_for);
settings_free(ns);
return FALSE;
}
if (alias_ns->alias_for[0] != '\0') {
*error_r = t_strdup_printf(
- "Namespace '%s': alias_for chaining isn't "
+ "Namespace %s: alias_for chaining isn't "
"allowed: %s -> %s",
- ns->prefix != NULL ? ns->prefix : "",
- ns->alias_for, alias_ns->alias_for);
+ ns->name, ns->alias_for, alias_ns->alias_for);
settings_free(alias_ns);
settings_free(ns);
return FALSE;
const char **error_r)
{
struct mail_namespace_settings *ns = _set;
- const char *name;
int ret;
- name = ns->prefix != NULL ? ns->prefix : "";
-
#ifndef CONFIG_BINARY
i_assert(ns->location[0] == SETTING_STRVAR_UNEXPANDED[0] ||
ns->location[0] == SETTING_STRVAR_EXPANDED[0]);
#endif
if (ns->separator[0] != '\0' && ns->separator[1] != '\0') {
- *error_r = t_strdup_printf("Namespace '%s': "
+ *error_r = t_strdup_printf("Namespace %s: "
"Hierarchy separator must be only one character long",
- name);
+ ns->name);
return FALSE;
}
- if (!uni_utf8_str_is_valid(name)) {
- *error_r = t_strdup_printf("Namespace prefix not valid UTF8: %s",
- name);
+ if (!uni_utf8_str_is_valid(ns->prefix)) {
+ *error_r = t_strdup_printf("Namespace %s: prefix not valid UTF8: %s",
+ ns->name, ns->prefix);
return FALSE;
}
if (mail_storage_verify_root(root_dir, type_name, &error) < 0) {
e_debug(list->event,
"Namespace %s: Creating storage despite: %s",
- list->ns->prefix, error);
+ list->ns->set->name, error);
}
return 0;
}
!str_begins_with(list->ns->prefix, "INBOX")) {
mailbox_list_set_critical(list,
"Invalid server configuration: "
- "Namespace prefix=%s must be uppercase INBOX",
- list->ns->prefix);
+ "Namespace %s: prefix=%s must be uppercase INBOX",
+ list->ns->set->name, list->ns->prefix);
open_error = MAIL_ERROR_TEMP;
} else {
vname = t_strconcat("INBOX", suffix, NULL);
error = mailbox_list_get_last_error(ns->list, error_code_r);
e_error(ns->list->event,
- "Failed to find mailbox with SPECIAL-USE flag '%s' "
- "in namespace '%s': %s",
- special_use, ns->prefix, error);
+ "Namespace %s: Failed to find mailbox with SPECIAL-USE flag '%s': %s",
+ ns->set->name, special_use, error);
return -1;
}
return ret;
{
if (!nullequals(list1->set.alt_dir, list2->set.alt_dir)) {
*error_r = t_strdup_printf("Namespace %s has alt dir, %s doesn't",
- list1->ns->prefix, list2->ns->prefix);
+ list1->ns->set->name, list2->ns->set->name);
return FALSE;
}
if (!nullequals(list1->set.index_dir, list2->set.index_dir)) {
*error_r = t_strdup_printf("Namespace %s has index dir, %s doesn't",
- list1->ns->prefix, list2->ns->prefix);
+ list1->ns->set->name, list2->ns->set->name);
return FALSE;
}
if (!nullequals(list1->set.index_cache_dir, list2->set.index_cache_dir)) {
*error_r = t_strdup_printf("Namespace %s has index cache dir, %s doesn't",
- list1->ns->prefix, list2->ns->prefix);
+ list1->ns->set->name, list2->ns->set->name);
return FALSE;
}
if (!nullequals(list1->set.control_dir, list2->set.control_dir)) {
*error_r = t_strdup_printf("Namespace %s has control dir, %s doesn't",
- list1->ns->prefix, list2->ns->prefix);
+ list1->ns->set->name, list2->ns->set->name);
return FALSE;
}
return TRUE;
storage_r, &error) < 0) {
mailbox_list_set_critical(list,
"Namespace %s: Failed to create storage '%s': %s",
- list->ns->prefix, driver, error);
+ list->ns->set->name, driver, error);
return -1;
}
return 0;
e_debug(list->event,
"Namespace %s: %s doesn't exist yet, "
"using default permissions",
- list->ns->prefix, path);
+ list->ns->set->name, path);
}
return FALSE;
}
if (name == NULL) {
e_debug(list->event,
"Namespace %s: Using permissions from %s: "
- "mode=0%o gid=%s", list->ns->prefix,
+ "mode=0%o gid=%s", list->ns->set->name,
path != NULL ? path : "",
(int)permissions_r->dir_create_mode,
permissions_r->file_create_gid == (gid_t)-1 ? "default" :
"Can't open mailbox %s: %s", mailbox, errstr);
else {
e_error(box->event,
- "Mailbox '%s' in namespace '%s' doesn't exist in %s",
- box->name, ns->prefix, path);
+ "Mailbox '%s' in namespace %s doesn't exist in %s",
+ box->name, ns->set->name, path);
}
mailbox_free(&box);
return -1;
*retry_r = FALSE;
- e_info(box->event, "Mailbox '%s' is in namespace '%s'",
- box->name, box->list->ns->prefix);
+ e_info(box->event, "Mailbox '%s' is in namespace %s",
+ box->name, box->list->ns->set->name);
if (mailbox_get_path_to(box, MAILBOX_LIST_PATH_TYPE_MAILBOX, &path) > 0)
e_info(box->event, "Mailbox path: %s", path);
if (!mailbox_list_get_root_path(list, MAILBOX_LIST_PATH_TYPE_INDEX, &path)) {
e_debug(list->event,
- "fts: Indexes disabled for namespace '%s'",
- list->ns->prefix);
+ "fts: Indexes disabled for namespace %s",
+ list->ns->set->name);
return;
}
if (iter->iter != NULL) {
if (mailbox_list_iter_deinit(&iter->iter) < 0) {
error2 = t_strdup_printf(
- "Listing namespace '%s' failed: %s",
- iter->ns->prefix,
+ "Listing namespace %s failed: %s",
+ iter->ns->set->name,
mailbox_list_get_last_internal_error(iter->ns->list, NULL));
ret = -1;
}
}
if (mailbox_list_iter_deinit(&iter->iter) < 0) {
iter->error = t_strdup_printf(
- "Listing namespace '%s' failed: %s",
- iter->ns->prefix,
+ "Listing namespace %s failed: %s", iter->ns->set->name,
mailbox_list_get_last_internal_error(iter->ns->list, NULL));
}
if (iter->ns->prefix_len > 0 &&
if ((storage->class_flags &
MAIL_STORAGE_CLASS_FLAG_NOQUOTA) == 0) {
e_warning(root->root.backend.event,
- "Namespace '%s' is not imapc, "
+ "Namespace %s is not imapc, "
"skipping for imapc quota",
- root->imapc_ns->prefix);
+ root->imapc_ns->set->name);
}
return FALSE;
}
if ((storage->class_flags &
MAIL_STORAGE_CLASS_FLAG_NOQUOTA) == 0) {
e_warning(root->root.backend.event,
- "Namespace '%s' is not Maildir, "
+ "Namespace %s is not Maildir, "
"skipping for Maildir++ quota",
- root->maildirsize_ns->prefix);
+ root->maildirsize_ns->set->name);
}
root->maildirsize_path = NULL;
return FALSE;