diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-10-26 14:53:33 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-10-26 14:53:33 +0100 |
commit | 89f419a1f7ae12c63d51c9b5ad7e9284ca133d07 (patch) | |
tree | 719dceecbafe04f71e944a0a17baebd6cf697d93 /src/plugins/lua/spamtrap.lua | |
parent | 50c99730b9d5523701f852ba3e92fd0a3d9591aa (diff) | |
download | rspamd-89f419a1f7ae12c63d51c9b5ad7e9284ca133d07.tar.gz rspamd-89f419a1f7ae12c63d51c9b5ad7e9284ca133d07.zip |
[Minor] Unify set_pre_result invocations
Diffstat (limited to 'src/plugins/lua/spamtrap.lua')
-rw-r--r-- | src/plugins/lua/spamtrap.lua | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/lua/spamtrap.lua b/src/plugins/lua/spamtrap.lua index 0803d7d64..6147ad680 100644 --- a/src/plugins/lua/spamtrap.lua +++ b/src/plugins/lua/spamtrap.lua @@ -63,23 +63,23 @@ local function spamtrap_cb(task) end task:insert_result(settings['symbol'], 1, rcpt) - if settings['action'] then + if settings.action then rspamd_logger.infox(task, 'spamtrap found: <%s>', rcpt) + local smtp_message if settings.smtp_message then - task:set_pre_result(settings['action'], - lua_util.template(settings.smtp_message, { rcpt = rcpt}), 'spamtrap') + smtp_message = lua_util.template(settings.smtp_message, { rcpt = rcpt}) else - local smtp_message = 'unknown error' + smtp_message = 'unknown error' if settings.action == 'no action' then smtp_message = 'message accepted' elseif settings.action == 'reject' then smtp_message = 'message rejected' end - task:set_pre_result{action = settings['action'], - message = smtp_message, - module = 'spamtrap', - flags = act_flags} end + task:set_pre_result{action = settings.action, + message = smtp_message, + module = 'spamtrap', + flags = act_flags} end end |