aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/cfg_rcl.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-02-22 10:00:08 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-02-22 10:00:08 +0000
commit01b4b738a7dc7ec64c1bf2451ca5e1bfa5961ceb (patch)
tree0fe060bbf28655d414825ce83f34bacf8d23bb06 /src/libserver/cfg_rcl.c
parent72d9ed6d599a41f430fde499ade11ae755a08540 (diff)
downloadrspamd-01b4b738a7dc7ec64c1bf2451ca5e1bfa5961ceb.tar.gz
rspamd-01b4b738a7dc7ec64c1bf2451ca5e1bfa5961ceb.zip
[Minor] Fix non-standard actions setup
Diffstat (limited to 'src/libserver/cfg_rcl.c')
-rw-r--r--src/libserver/cfg_rcl.c33
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);
}
}