From: Timo Sirainen Date: Wed, 22 Jan 2025 11:07:34 +0000 (+0200) Subject: config: Require named list filter lookups to use settings_filter_name X-Git-Tag: 2.4.1~257 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d3bc80dd9913e5d911871423db18778d4325917;p=thirdparty%2Fdovecot%2Fcore.git config: Require named list filter lookups to use settings_filter_name The config client callers are now responsible for doing lookups with e.g. settings_filter_name=namespace/inbox in the event, rather than relying on just namespace=inbox being in the event. This allows separating the filter name from the setting values. So for example userdb can change the mailbox name (mailbox/spam/name=Junk). --- diff --git a/src/config/config-dump-full.c b/src/config/config-dump-full.c index e5a6e48d26..3ad3ae0db2 100644 --- a/src/config/config-dump-full.c +++ b/src/config/config-dump-full.c @@ -148,21 +148,14 @@ config_dump_full_append_filter_query(string_t *str, const char *p = strchr(filter->filter_name, '/'); i_assert(p != NULL); const char *filter_key = t_strdup_until(filter->filter_name, p); - bool group = filter_key[0] == SETTINGS_INCLUDE_GROUP_PREFIX; if (strcmp(filter_key, SETTINGS_EVENT_MAILBOX_NAME_WITH_PREFIX) == 0) filter_key = SETTINGS_EVENT_MAILBOX_NAME_WITHOUT_PREFIX; - if (!group) { - str_printfa(str, "(%s=\"%s\" OR ", - filter_key, str_escape(p + 1)); - } /* the filter_name is used by settings_get_filter() for finding a specific filter without wildcards messing up the lookups. */ str_printfa(str, SETTINGS_EVENT_FILTER_NAME "=\"%s/%s\"", filter_key, wildcard_str_escape(settings_section_escape(p + 1))); - if (!group) - str_append_c(str, ')'); str_append(str, " AND "); } else if (filter->filter_name != NULL) { const char *filter_name = filter->filter_name;