This patch is running but it only run with mail_plugins.

This is because I can't select the "mail_plugins" value from any
function to get this throw the name key.

Maybe this need more hard development to do this as generic "property"
for any config value.

2011/6/9 Antonio Perez-Aranda <[email protected]>:
> Well, this "extrange" vaues is NULL.
>
> Maybe, the set_parser is a new environment to set settings but then
> ¿when is make the config merge?
>
> 2011/6/9 Antonio Perez-Aranda <[email protected]>:
>> This line:
>>
>> value = settings_parse_get_value(set_parser, key, &type);
>>
>> Is returning a empty value. Maybe, set_parser has been cleared?
>>
>> If I try to get another keys from my config that I can watch with
>> doveadm I get "extrange" values like this with i_debug()
>>
>>  * mail_debug -> #001
>>  * mail_location -> #010
>>  * auth_realms -> #020#002
>>
>>
>> 2011/6/8 Antonio Perez-Aranda <[email protected]>:
>>> It must run on dovecot 2.0.13?
>>>
>>> We are upgrading to 2.0.13 and with this I get the follow message:
>>>
>>> Jun  8 16:15:03 kvm3 dovecot: imap: Debug: Unknown userdb setting:
>>> +mail_plugins=fts fts_solr�G
>>>
>>>
>>> 2011/6/7 Timo Sirainen <[email protected]>:
>>>> On Tue, 2011-06-07 at 16:16 +0200, Antonio Perez-Aranda wrote:
>>>>> Greats, I'm working on patch from this morning, but it's very hard to
>>>>> debug on settings-parser
>>>>
>>>> I don't think you should need to touch that code. It's a bit difficult
>>>> for me also to follow..
>>>>
>>>>> How can I enable i_debug on settings-parser.c ?
>>>>
>>>> What do you mean? You could add i_debug() calls and it should work just
>>>> the same as everywhere.
>>>>
>>>> Did you try the patch in my previous mail? I think that should be
>>>> enough. You could then use:
>>>>
>>>> user_attrs = .., mailPlugins=+mail_plugins
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Antonio Pérez-Aranda Alcaide
>>> [email protected]
>>>
>>> Yaco Sistemas S.L.
>>> http://www.yaco.es/
>>> C/ Rioja 5, 41001 Sevilla
>>> Teléfono +34 954 50 00 57
>>> Fax      +34 954 50 09 29
>>>
>>
>>
>>
>> --
>> Antonio Pérez-Aranda Alcaide
>> [email protected]
>>
>> Yaco Sistemas S.L.
>> http://www.yaco.es/
>> C/ Rioja 5, 41001 Sevilla
>> Teléfono +34 954 50 00 57
>> Fax      +34 954 50 09 29
>>
>
>
>
> --
> Antonio Pérez-Aranda Alcaide
> [email protected]
>
> Yaco Sistemas S.L.
> http://www.yaco.es/
> C/ Rioja 5, 41001 Sevilla
> Teléfono +34 954 50 00 57
> Fax      +34 954 50 09 29
>



-- 
Antonio Pérez-Aranda Alcaide
[email protected]

Yaco Sistemas S.L.
http://www.yaco.es/
C/ Rioja 5, 41001 Sevilla
Teléfono +34 954 50 00 57
Fax      +34 954 50 09 29
diff -r aa8dfa085a99 src/lib-storage/mail-storage-service.c
--- a/src/lib-storage/mail-storage-service.c	Wed May 11 17:59:56 2011 +0300
+++ b/src/lib-storage/mail-storage-service.c	Thu Jun 09 20:30:50 2011 +0400
@@ -107,14 +107,23 @@
 {
 	struct setting_parser_context *set_parser = user->set_parser;
 	bool mail_debug;
-	const char *key;
+	const char *key, *orig_key;
+	bool append = FALSE;
 	int ret;
 
 	mail_debug = mail_user_set_get_mail_debug(user->user_info,
 						  user->user_set);
 	if (strchr(line, '=') == NULL)
 		line = t_strconcat(line, "=yes", NULL);
-	key = t_strcut(line, '=');
+	orig_key = key = t_strcut(line, '=');
+	i_debug(key);
+	if (key[0] == '+') {
+		key++;
+                line++;
+		append = TRUE;
+                i_debug(key);
+
+	}
 
 	if (!settings_parse_is_valid_key(set_parser, key)) {
 		/* assume it's a plugin setting */
@@ -131,6 +140,19 @@
 		return 1;
 	}
 
+        if (append && (strcmp(key, "mail_plugins") == 0)) {
+		const void *value;
+                value = user->user_set->mail_plugins;
+
+		if (value != NULL){
+			line = t_strconcat(line, value, NULL);
+		}
+	}
+	else {
+		i_error("Ignoring %s userdb setting. "
+			"'+' can only be used for mail_plugins strings.", orig_key);
+	}
+
 	ret = settings_parse_line(set_parser, line);
 	if (mail_debug && ret >= 0) {
 		i_debug(ret == 0 ?

Reply via email to