# HG changeset patch # User Timo Sirainen # Date 1189299537 -10800 # Node ID 6bd13d514294fa1bf8b315f2c410c990e3cbfca6 # Parent a445f128744ef2c87843c43b8d10b9db0c780ae3 Fixed home directory handling which got broken by previous changes. diff -r a445f128744e -r 6bd13d514294 src/deliver/auth-client.c --- a/src/deliver/auth-client.c Sat Sep 08 03:50:25 2007 +0300 +++ b/src/deliver/auth-client.c Sun Sep 09 03:58:57 2007 +0300 @@ -90,6 +90,10 @@ chroot = *tmp + 7; } else { char *field = i_strdup(*tmp); + + if (strncmp(field, "home=", 5) == 0) + env_put(t_strconcat("HOME=", field + 5, NULL)); + array_append(conn->extra_fields, &field, 1); } } diff -r a445f128744e -r 6bd13d514294 src/deliver/deliver.c --- a/src/deliver/deliver.c Sat Sep 08 03:50:25 2007 +0300 +++ b/src/deliver/deliver.c Sun Sep 09 03:58:57 2007 +0300 @@ -516,12 +516,14 @@ static void expand_envs(const char *destination) { const struct var_expand_table *table; - const char *mail_env, *const *envs; + const char *mail_env, *const *envs, *home; unsigned int i, count; string_t *str; + home = getenv("HOME"); + str = t_str_new(256); - table = get_var_expand_table(destination, getenv("HOME")); + table = get_var_expand_table(destination, home); envs = array_get(&plugin_envs, &count); for (i = 0; i < count; i++) { str_truncate(str, 0); @@ -533,7 +535,9 @@ if (mail_env != NULL) { /* get the table again in case plugin envs provided the home directory (yea, kludgy) */ - table = get_var_expand_table(destination, getenv("HOME")); + if (home == NULL) + home = getenv("HOME"); + table = get_var_expand_table(destination, home); mail_env = expand_mail_env(mail_env, table); } env_put(t_strconcat("MAIL=", mail_env, NULL));