{
struct rspamd_task *task = lua_check_task (L, 1);
ucl_object_t *settings;
- const ucl_object_t *act, *elt, *metric_elt;
+ const ucl_object_t *act, *elt, *metric_elt, *vars, *cur;
+ ucl_object_iter_t it = NULL;
struct rspamd_metric_result *mres;
guint i;
}
}
+ vars = ucl_object_lookup (task->settings, "variables");
+ if (vars && ucl_object_type (vars) == UCL_OBJECT) {
+ /* Set memory pool variables */
+ while ((cur = ucl_object_iterate (vars, &it, true)) != NULL) {
+ if (ucl_object_type (cur) == UCL_STRING) {
+ rspamd_mempool_set_variable (task->task_pool,
+ ucl_object_key (cur), rspamd_mempool_strdup (
+ task->task_pool,
+ ucl_object_tostring (cur)
+ ), NULL);
+ }
+ }
+ }
+
rspamd_symbols_cache_process_settings (task, task->cfg->cache);
}
else {