]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Support alt names for known actions in settings
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 17 Jul 2019 13:07:05 +0000 (14:07 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 17 Jul 2019 13:07:05 +0000 (14:07 +0100)
src/lua/lua_task.c

index cd33b43ae69aea9eb7a66478cc72a27b9f05d1d1..55fdfc31e9693dfe4aea39711cc18b40633b1fac 100644 (file)
@@ -4979,6 +4979,13 @@ lua_task_set_settings (lua_State *L)
                                struct rspamd_action_result *act_res = &mres->actions_limits[i];
                                elt = ucl_object_lookup (act, act_res->action->name);
 
+                               if (elt == NULL &&
+                                       act_res->action->action_type != METRIC_ACTION_CUSTOM) {
+                                       /* Also try alt name ... */
+                                       elt = ucl_object_lookup (act,
+                                                       rspamd_action_to_str_alt (act_res->action->action_type));
+                               }
+
                                if (elt) {
                                        if (ucl_object_type (elt) == UCL_FLOAT ||
                                                                ucl_object_type (elt) == UCL_INT) {