diff options
-rw-r--r-- | src/libserver/cfg_rcl.c | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c index f2a49212c..9fa0af418 100644 --- a/src/libserver/cfg_rcl.c +++ b/src/libserver/cfg_rcl.c @@ -579,30 +579,23 @@ rspamd_rcl_actions_handler (rspamd_mempool_t *pool, const ucl_object_t *obj, it = ucl_object_iterate_new (obj); while ((cur = ucl_object_iterate_safe (it, true)) != NULL) { - if (!rspamd_action_from_str (ucl_object_key (cur), &action_value)) { - continue; + if (ucl_object_type (cur) == UCL_NULL) { + rspamd_config_maybe_disable_action (cfg, ucl_object_key (cur), + ucl_object_get_priority (cur)); } else { - if (ucl_object_type (cur) == UCL_NULL) { - rspamd_config_maybe_disable_action (cfg, ucl_object_key (cur), - ucl_object_get_priority (cur)); - } - else { - if (!ucl_object_todouble_safe (cur, &action_score)) { - g_set_error (err, - CFG_RCL_ERROR, - EINVAL, - "invalid action definition: '%s'", - ucl_object_key (cur)); - ucl_object_iterate_free (it); + if (!rspamd_config_set_action_score (cfg, + ucl_object_key (cur), + cur)) { + g_set_error (err, + CFG_RCL_ERROR, + EINVAL, + "invalid action definition for: '%s'", + ucl_object_key (cur)); + ucl_object_iterate_free (it); - return FALSE; - } + return FALSE; } - - rspamd_config_set_action_score (cfg, - ucl_object_key (cur), - cur); } } |