Allow query-format strings in answers.
[apps/pfixtools.git] / postlicyd / filter.c
index 1ba19b5..d145f42 100644 (file)
@@ -289,6 +289,10 @@ bool filter_add_hook(filter_t *filter, const char *name, int name_len,
     }
     hook.async   = false;
     hook.postfix = (strncmp(value, "postfix:", 8) == 0);
+    if (hook.postfix && query_format(NULL, 0, value + 8, NULL) == -1) {
+        err("invalid formatted text \"%s\"", value + 8);
+        return false;
+    }
     hook.value = m_strdup(hook.postfix ? value + 8 : value);
     hook.filter_id = -1;
     array_add(filter->hooks, hook);