Mercurial > dovecot > core-2.2
changeset 14194:488fe9d417eb
lib-storage: When autocreating a namespace, don't fill out location setting unless necessary.
This fixes running dsync when there are no namespaces defined.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 21 Feb 2012 02:59:25 +0200 |
parents | 10994a5b64e1 |
children | 7d0d76df719f |
files | src/lib-storage/mail-namespace.c |
diffstat | 1 files changed, 6 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/mail-namespace.c Tue Feb 21 02:43:52 2012 +0200 +++ b/src/lib-storage/mail-namespace.c Tue Feb 21 02:59:25 2012 +0200 @@ -320,7 +320,7 @@ { struct mail_namespace_settings *inbox_set, *unexpanded_inbox_set; struct mail_namespace *ns; - const struct mail_storage_settings *mail_set, *unexpanded_mail_set; + const struct mail_storage_settings *mail_set; const char *error, *driver, *location_source; i_assert(location == NULL || *location != '\0'); @@ -345,13 +345,8 @@ inbox_set->location = p_strdup(user->pool, location); location_source = "mail_location parameter"; } else 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; + /* don't actually set it to namespace, since we'll default to + it anyway */ location_source = "mail_location setting"; } else { location_source = "environment MAIL"; @@ -367,10 +362,12 @@ location_source = "environment MAILDIR"; } } - if (*unexpanded_inbox_set->location == '\0') { + if (*inbox_set->location != '\0') { unexpanded_inbox_set->location = p_strconcat(user->pool, SETTING_STRVAR_EXPANDED, inbox_set->location, NULL); + } else { + unexpanded_inbox_set->location = SETTING_STRVAR_UNEXPANDED; } ns->set = inbox_set;