From: Timo Sirainen Date: Tue, 8 Jul 2008 10:56:54 +0000 (+0530) Subject: deliver: Don't let plugin section override other settings (at least for now). X-Git-Tag: 1.2.alpha1~189 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5fb4009ce8522d930e6fc78698395a267f2c42ab;p=thirdparty%2Fdovecot%2Fcore.git deliver: Don't let plugin section override other settings (at least for now). --HG-- branch : HEAD --- diff --git a/src/deliver/deliver.c b/src/deliver/deliver.c index 444d09ca63..a82ae27191 100644 --- a/src/deliver/deliver.c +++ b/src/deliver/deliver.c @@ -691,6 +691,7 @@ static void expand_envs(const char *user) const char *mail_env, *const *envs, *home; unsigned int i, count; string_t *str; + char *env, *p; home = getenv("HOME"); @@ -700,7 +701,19 @@ static void expand_envs(const char *user) for (i = 0; i < count; i++) { str_truncate(str, 0); var_expand(str, envs[i], table); - env_put(str_c(str)); + + env = str_c_modifiable(str); + p = strchr(env, '='); + if (p != NULL) { + *p = '\0'; + /* more or less temporary solution to allow lda section + to override plugin settings. after config rewrite + this should go away. */ + if (getenv(env) == NULL) { + *p = '='; + env_put(env); + } + } } mail_env = getenv("MAIL_LOCATION");