]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
deliver: Don't let plugin section override other settings (at least for now).
authorTimo Sirainen <tss@iki.fi>
Tue, 8 Jul 2008 10:56:54 +0000 (16:26 +0530)
committerTimo Sirainen <tss@iki.fi>
Tue, 8 Jul 2008 10:56:54 +0000 (16:26 +0530)
--HG--
branch : HEAD

src/deliver/deliver.c

index 444d09ca63a4bdb35729e1eec52c43fbcd31e2d4..a82ae27191388d5cca7211645c9cce4b06cfa53a 100644 (file)
@@ -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");