From 9716dc82c293895a17fb9be87eac135ebd39f4a3 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 26 Jan 2022 20:58:56 +0000 Subject: [PATCH] [Minor] Improve documentation --- src/lua/lua_config.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c index 8b0a4a46c..414f06f36 100644 --- a/src/lua/lua_config.c +++ b/src/lua/lua_config.c @@ -426,8 +426,18 @@ LUA_FUNCTION_DEF (config, get_key); * @return {boolean} true if condition has been added * @example +local condition_map = rspamd_config:add_map{ + type = "hash", + urls = ['file:///path/to/file'], + description = 'SMTP from map that allows FUZZY_DENIED skip for the listed addresses' +} rspamd_config:add_condition('FUZZY_DENIED', function(task) - if some_map:find_key(task:get_from()) then return false end + local E = {} + -- Check for the smtp from address adding fail safe checks + if condition_map:find_key(((task:get_from('smtp') or E)[1] or E).addr) then + return false + end + -- Allow execution otherwise return true end) */ -- 2.39.5