From: Vsevolod Stakhov Date: Mon, 10 Nov 2025 13:58:25 +0000 (+0000) Subject: [Fix] Allow custom actions with flags in config validation X-Git-Tag: 3.14.0~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ce5c814ffd300495f43e69d0906eae4593d4718;p=thirdparty%2Frspamd.git [Fix] Allow custom actions with flags in config validation The config validation was warning about unknown actions even when they were valid custom actions defined with flags like 'no_threshold'. Custom actions (e.g., malware, virus, hard-reject) are properly supported by the C code but the Lua validation didn't recognize them, causing spurious warnings. Fix by checking if an unknown action is defined as an object with flags before emitting the warning. --- diff --git a/lualib/lua_cfg_transform.lua b/lualib/lua_cfg_transform.lua index ec11ef2996..8060e26d52 100644 --- a/lualib/lua_cfg_transform.lua +++ b/lualib/lua_cfg_transform.lua @@ -350,9 +350,16 @@ return function(cfg) actions_set['grow_factor'] = true actions_set['subject'] = true - for k, _ in cfg:at('actions'):pairs() do + for k, v in cfg:at('actions'):pairs() do if not actions_set[k] then - logger.warnx(rspamd_config, 'unknown element in actions section: %s', k) + -- Check if this is a custom action with flags (e.g., no_threshold) + local is_custom_action = false + if v and v:type() == 'object' and v:at('flags') then + is_custom_action = true + end + if not is_custom_action then + logger.warnx(rspamd_config, 'unknown element in actions section: %s', k) + end end end