Mercurial > dovecot > core-2.2
changeset 1749:9ce1e589d3c1 HEAD
If location isn't given for namespace, use the default
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 06 Sep 2003 20:37:10 +0300 |
parents | 588326f1cd84 |
children | 4e14ba3c115b |
files | src/master/mail-process.c src/master/master-settings.c |
diffstat | 2 files changed, 11 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/master/mail-process.c Sat Sep 06 20:29:52 2003 +0300 +++ b/src/master/mail-process.c Sat Sep 06 20:37:10 2003 +0300 @@ -104,15 +104,21 @@ } static void env_put_namespace(struct namespace_settings *ns, + const char *default_location, const char *user, const char *home) { const char *location; unsigned int i; + if (default_location == NULL) + default_location = ""; + for (i = 1; ns != NULL; i++, ns = ns->next) { t_push(); - location = expand_mail_env(ns->location, user, home); + location = ns->location != NULL ? ns->location : + default_location; + location = expand_mail_env(location, user, home); env_put(t_strdup_printf("NAMESPACE_%u=%s", i, location)); if (ns->separator != NULL) { @@ -280,8 +286,10 @@ if (*mail == '\0' && set->default_mail_env != NULL) mail = expand_mail_env(set->default_mail_env, user, home_dir); - if (set->server->namespaces != NULL) - env_put_namespace(set->server->namespaces, user, home_dir); + if (set->server->namespaces != NULL) { + env_put_namespace(set->server->namespaces, + set->default_mail_env, user, home_dir); + } env_put(t_strconcat("MAIL=", mail, NULL)); env_put(t_strconcat("USER=", data + reply->virtual_user_idx, NULL));
--- a/src/master/master-settings.c Sat Sep 06 20:29:52 2003 +0300 +++ b/src/master/master-settings.c Sat Sep 06 20:37:10 2003 +0300 @@ -328,10 +328,6 @@ const char *name; name = ns->prefix != NULL ? ns->prefix : ""; - if (ns->location == NULL) { - i_error("Namespace '%s': Missing location", name); - return FALSE; - } if (ns->separator != NULL && ns->separator[0] != '\0' && ns->separator[1] != '\0') {