dovecot-1.1: deliver: Allow overriding a boolean setting to "no"...

dovecot at dovecot.org dovecot at dovecot.org
Sat Dec 13 14:00:07 EET 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/6dc81e6c0074
changeset: 8042:6dc81e6c0074
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Dec 13 13:59:56 2008 +0200
description:
deliver: Allow overriding a boolean setting to "no" in protocol lda section.

diffstat:

1 file changed, 6 insertions(+), 6 deletions(-)
src/deliver/deliver.c |   12 ++++++------

diffs (46 lines):

diff -r b40079598a1c -r 6dc81e6c0074 src/deliver/deliver.c
--- a/src/deliver/deliver.c	Sat Dec 13 13:53:26 2008 +0200
+++ b/src/deliver/deliver.c	Sat Dec 13 13:59:56 2008 +0200
@@ -310,7 +310,7 @@ static void config_file_init(const char 
 static void config_file_init(const char *path)
 {
 	struct istream *input;
-	const char *key, *value, *str;
+	const char *key, *value, *str, *ukey;
 	char *line, *p, quote;
 	int fd, sections = 0;
 	bool lda_section = FALSE, pop3_section = FALSE, plugin_section = FALSE;
@@ -459,28 +459,28 @@ static void config_file_init(const char 
 			value = str_unescape(p_strndup(unsafe_data_stack_pool,
 						       value+1, len - 2));
 		}
+		ukey = t_str_ucase(key);
 		if (setting_is_bool(key) && strcasecmp(value, "yes") != 0) {
 			for (i = 0; i < N_ELEMENTS(default_yes_settings); i++) {
 				if (strcmp(default_yes_settings[i].name,
 					   key) == 0)
 					default_yes_settings[i].set = FALSE;
 			}
+			env_remove(ukey);
 			continue;
 		}
 
 		if (lda_section) {
-			str = p_strconcat(plugin_pool,
-					  t_str_ucase(key), "=", value, NULL);
+			str = p_strconcat(plugin_pool, ukey, "=", value, NULL);
 			array_append(&lda_envs, &str, 1);
 		}
 		if (!plugin_section) {
-			env_put(t_strconcat(t_str_ucase(key), "=",
-					    value, NULL));
+			env_put(t_strconcat(ukey, "=", value, NULL));
 		} else {
 			/* %variables need to be expanded.
 			   store these for later. */
 			value = p_strconcat(plugin_pool,
-					    t_str_ucase(key), "=", value, NULL);
+					    ukey, "=", value, NULL);
 			array_append(&plugin_envs, &value, 1);
 		}
 	}


More information about the dovecot-cvs mailing list