changeset 1772:c5fa45f0ebf6 HEAD

Support %vars in namespace prefix.
author Timo Sirainen <tss@iki.fi>
date Mon, 15 Sep 2003 16:59:08 +0300
parents 63254344ea0e
children 9547667cfa19
files src/master/mail-process.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/master/mail-process.c	Wed Sep 10 05:16:30 2003 +0300
+++ b/src/master/mail-process.c	Mon Sep 15 16:59:08 2003 +0300
@@ -109,6 +109,7 @@
 {
 	const char *location;
 	unsigned int i;
+	string_t *str;
 
 	if (default_location == NULL)
 		default_location = "";
@@ -130,8 +131,11 @@
 						i, ns->type));
 		}
 		if (ns->prefix != NULL) {
-			env_put(t_strdup_printf("NAMESPACE_%u_PREFIX=%s",
-						i, ns->prefix));
+			/* expand variables, eg. ~%u/ can be useful */
+			str = t_str_new(256);
+			str_printfa(str, "NAMESPACE_%u_PREFIX=", i);
+			var_expand(str, ns->prefix, user, home);
+			env_put(str_c(str));
 		}
 		if (ns->inbox)
 			env_put(t_strdup_printf("NAMESPACE_%u_INBOX=1", i));