diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-12-18 16:12:30 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-12-18 16:12:30 +0000 |
commit | 9d0a607a0674adc815d41ad7d64084028048f970 (patch) | |
tree | b93644181ef43001d8dc8c68c3fa4fccea200c06 /lualib/lua_scanners | |
parent | 7ec92c421a5d1da6d26b6f2cdfed3cc585481155 (diff) | |
download | rspamd-9d0a607a0674adc815d41ad7d64084028048f970.tar.gz rspamd-9d0a607a0674adc815d41ad7d64084028048f970.zip |
[Feature] Vadesecure: Implement settings_outbound feature as recommended by Vade
Diffstat (limited to 'lualib/lua_scanners')
-rw-r--r-- | lualib/lua_scanners/vadesecure.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lualib/lua_scanners/vadesecure.lua b/lualib/lua_scanners/vadesecure.lua index 238120286..cbad42d4f 100644 --- a/lualib/lua_scanners/vadesecure.lua +++ b/lualib/lua_scanners/vadesecure.lua @@ -46,6 +46,7 @@ local function vade_config(opts) log_spamcause = true, symbol_fail = 'VADE_FAIL', symbol = 'VADE_CHECK', + settings_outbound = nil, -- Set when there is a settings id for outbound messages symbols = { clean = { symbol = 'VADE_CLEAN', @@ -195,6 +196,26 @@ local function vade_check(task, content, digest, rule) hdrs['X-Inet'] = tostring(fip) end + if rule.settings_outbound then + local settings_id = task:get_settings_id() + + if settings_id then + local lua_settings = require "lua_settings" + -- Convert to string + settings_id = lua_settings.settings_by_id(settings_id) + + if settings_id then + settings_id = settings_id.name or '' + + if settings_id == rule.settings_outbound then + lua_util.debugm(rule.name, task, '%s settings has matched outbound', + settings_id) + hdrs['X-Params'] = 'mode=smtpout' + end + end + end + end + local request_data = { task = task, url = url, |