commit f4db972: [Minor] Support alt names for known actions in settings

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Jul 17 13:14:05 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-07-17 14:07:05 +0100
URL: https://github.com/rspamd/rspamd/commit/f4db97263b0f33629fe3246e6d2bc6f87ea472d0 (HEAD -> master)

[Minor] Support alt names for known actions in settings

---
 src/lua/lua_task.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index cd33b43ae..55fdfc31e 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -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) {


More information about the Commits mailing list