Mercurial > dovecot > core-2.2
changeset 11499:9f546fe13fc5 HEAD
lib-storage: Set mail_namespace.unexpanded_set also when no namespaces are defined.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 08 Jun 2010 20:32:23 +0100 |
parents | 190a5278e58b |
children | 6f85840f8171 |
files | src/lib-storage/mail-namespace.c |
diffstat | 1 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/mail-namespace.c Tue Jun 08 19:34:14 2010 +0100 +++ b/src/lib-storage/mail-namespace.c Tue Jun 08 20:32:23 2010 +0100 @@ -253,11 +253,11 @@ int mail_namespaces_init(struct mail_user *user, const char **error_r) { - const struct mail_storage_settings *mail_set; + const struct mail_storage_settings *mail_set, *unexpanded_mail_set; struct mail_namespace_settings *const *ns_set; struct mail_namespace_settings *const *unexpanded_ns_set; struct mail_namespace *namespaces, *ns, **ns_p; - struct mail_namespace_settings *inbox_set; + struct mail_namespace_settings *inbox_set, *unexpanded_inbox_set; const char *error, *driver, *location_source; unsigned int i, count, count2; @@ -310,9 +310,18 @@ *inbox_set = mail_namespace_default_settings; inbox_set->inbox = TRUE; + unexpanded_inbox_set = p_new(user->pool, struct mail_namespace_settings, 1); + *unexpanded_inbox_set = *inbox_set; + driver = NULL; if (*mail_set->mail_location != '\0') { + unexpanded_mail_set = mail_user_set_get_driver_settings( + user->set_info, user->unexpanded_set, + MAIL_STORAGE_SET_DRIVER_NAME); + inbox_set->location = mail_set->mail_location; + unexpanded_inbox_set->location = + unexpanded_mail_set->mail_location; location_source = "mail_location setting"; } else { location_source = "environment MAIL"; @@ -329,7 +338,11 @@ } } + if (unexpanded_inbox_set->location == NULL) + unexpanded_inbox_set->location = inbox_set->location; + ns->set = inbox_set; + ns->unexpanded_set = unexpanded_inbox_set; ns->mail_set = mail_set; ns->prefix = i_strdup(ns->set->prefix); ns->user = user;