[dovecot-cvs] dovecot/src/master mail-process.c,1.33,1.34 master-settings.c,1.32,1.33

cras at procontrol.fi cras at procontrol.fi
Sat Sep 6 21:37:12 EEST 2003


Update of /home/cvs/dovecot/src/master
In directory danu:/tmp/cvs-serv19281/master

Modified Files:
	mail-process.c master-settings.c 
Log Message:
If location isn't given for namespace, use the default



Index: mail-process.c
===================================================================
RCS file: /home/cvs/dovecot/src/master/mail-process.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- mail-process.c	25 Aug 2003 03:02:49 -0000	1.33
+++ mail-process.c	6 Sep 2003 17:37:10 -0000	1.34
@@ -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));

Index: master-settings.c
===================================================================
RCS file: /home/cvs/dovecot/src/master/master-settings.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- master-settings.c	24 Aug 2003 23:10:20 -0000	1.32
+++ master-settings.c	6 Sep 2003 17:37:10 -0000	1.33
@@ -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') {



More information about the dovecot-cvs mailing list