diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-13 13:30:07 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-13 13:30:23 +0100 |
commit | 0125a1a77135813ca7ae93a1571c6919d640d72b (patch) | |
tree | ee9b5a7b2e2ed82cba4807239e4e135028ada618 /src/plugins/lua | |
parent | 96b89f654ee0d57987f7094707691fc04c631697 (diff) | |
download | rspamd-0125a1a77135813ca7ae93a1571c6919d640d72b.tar.gz rspamd-0125a1a77135813ca7ae93a1571c6919d640d72b.zip |
[Minor] Include module name when setting pre result
Diffstat (limited to 'src/plugins/lua')
-rw-r--r-- | src/plugins/lua/antivirus.lua | 2 | ||||
-rw-r--r-- | src/plugins/lua/dmarc.lua | 2 | ||||
-rw-r--r-- | src/plugins/lua/force_actions.lua | 4 | ||||
-rw-r--r-- | src/plugins/lua/greylist.lua | 4 | ||||
-rw-r--r-- | src/plugins/lua/metadata_exporter.lua | 2 | ||||
-rw-r--r-- | src/plugins/lua/multimap.lua | 6 | ||||
-rw-r--r-- | src/plugins/lua/ratelimit.lua | 2 | ||||
-rw-r--r-- | src/plugins/lua/replies.lua | 2 | ||||
-rw-r--r-- | src/plugins/lua/spamtrap.lua | 4 |
9 files changed, 14 insertions, 14 deletions
diff --git a/src/plugins/lua/antivirus.lua b/src/plugins/lua/antivirus.lua index 91a6c0a9b..025e36043 100644 --- a/src/plugins/lua/antivirus.lua +++ b/src/plugins/lua/antivirus.lua @@ -123,7 +123,7 @@ local function yield_result(task, rule, vname) lua_util.template(rule.message or 'Rejected', { SCANNER = rule['type'], VIRUS = vname, - })) + }), N) end end diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua index e632c9f02..b55c5d41f 100644 --- a/src/plugins/lua/dmarc.lua +++ b/src/plugins/lua/dmarc.lua @@ -201,7 +201,7 @@ local function maybe_force_action(task, disposition) if force_action then -- Don't do anything if pre-result has been already set if task:has_pre_result() then return end - task:set_pre_result(force_action, 'Action set by DMARC') + task:set_pre_result(force_action, 'Action set by DMARC', N) end end end diff --git a/src/plugins/lua/force_actions.lua b/src/plugins/lua/force_actions.lua index 6c898b8ff..eddd09dea 100644 --- a/src/plugins/lua/force_actions.lua +++ b/src/plugins/lua/force_actions.lua @@ -79,9 +79,9 @@ local function gen_cb(expr, act, pool, message, subject, raction, honor, limit) task:set_metric_subject(subject) end if type(message) == 'string' then - task:set_pre_result(act, message) + task:set_pre_result(act, message, N) else - task:set_pre_result(act) + task:set_pre_result(act, nil, N) end return true, act end diff --git a/src/plugins/lua/greylist.lua b/src/plugins/lua/greylist.lua index 0bf74bc74..7427f999e 100644 --- a/src/plugins/lua/greylist.lua +++ b/src/plugins/lua/greylist.lua @@ -157,13 +157,13 @@ local function greylist_message(task, end_time, why) if rspamd_lua_utils.is_rspamc_or_controller(task) then return end if settings.message_func then task:set_pre_result(settings['action'], - settings.message_func(task, end_time)) + settings.message_func(task, end_time), N) else local message = settings['message'] if settings.report_time then message = string.format("%s: %s", message, end_time) end - task:set_pre_result(settings['action'], message) + task:set_pre_result(settings['action'], message, N) end task:set_flag('greylisted') diff --git a/src/plugins/lua/metadata_exporter.lua b/src/plugins/lua/metadata_exporter.lua index 6c0eb6f82..57fe0f105 100644 --- a/src/plugins/lua/metadata_exporter.lua +++ b/src/plugins/lua/metadata_exporter.lua @@ -229,7 +229,7 @@ local selectors = { local function maybe_defer(task, rule) if rule.defer then rspamd_logger.warnx(task, 'deferring message') - task:set_pre_result('soft reject', 'deferred') + task:set_pre_result('soft reject', 'deferred', N) end end diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index 6a12d898a..4cc9af48b 100644 --- a/src/plugins/lua/multimap.lua +++ b/src/plugins/lua/multimap.lua @@ -555,9 +555,9 @@ local function multimap_callback(task, rule) r['message'] = r.message_func(task, r['symbol'], opt) end if r['message'] then - task:set_pre_result(r['action'], r['message']) + task:set_pre_result(r['action'], r['message'], N) else - task:set_pre_result(r['action'], 'Matched map: ' .. r['symbol']) + task:set_pre_result(r['action'], 'Matched map: ' .. r['symbol'], N) end end end @@ -731,7 +731,7 @@ local function multimap_callback(task, rule) elseif is_ok then task:insert_result(rule['symbol'], 1, rule['map']) if pre_filter then - task:set_pre_result(rule['action'], 'Matched map: ' .. rule['symbol']) + task:set_pre_result(rule['action'], 'Matched map: ' .. rule['symbol'], N) end end diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index 05b1f5ed8..61d19966b 100644 --- a/src/plugins/lua/ratelimit.lua +++ b/src/plugins/lua/ratelimit.lua @@ -556,7 +556,7 @@ local function ratelimit_cb(task) bucket.burst, bucket.rate, data[2], data[3], data[4]) task:set_pre_result('soft reject', - message_func(task, lim_name, prefix, bucket)) + message_func(task, lim_name, prefix, bucket), N) end end end diff --git a/src/plugins/lua/replies.lua b/src/plugins/lua/replies.lua index e16ef2b7d..fe15211ef 100644 --- a/src/plugins/lua/replies.lua +++ b/src/plugins/lua/replies.lua @@ -65,7 +65,7 @@ local function replies_check(task) (settings.use_local and ip_addr and ip_addr:is_local()) then rspamd_logger.infox(task, "not forcing action for local network or authorized user"); else - task:set_pre_result(settings['action'], settings['message']) + task:set_pre_result(settings['action'], settings['message'], N) end end end diff --git a/src/plugins/lua/spamtrap.lua b/src/plugins/lua/spamtrap.lua index 85af46dd2..97107c275 100644 --- a/src/plugins/lua/spamtrap.lua +++ b/src/plugins/lua/spamtrap.lua @@ -66,7 +66,7 @@ local function spamtrap_cb(task) rspamd_logger.infox(task, 'spamtrap found: <%s>', rcpt) if settings.smtp_message then task:set_pre_result(settings['action'], - lua_util.template(settings.smtp_message, { rcpt = rcpt})) + lua_util.template(settings.smtp_message, { rcpt = rcpt}), 'spamtrap') else local smtp_message = 'unknown error' if settings.action == 'no action' then @@ -74,7 +74,7 @@ local function spamtrap_cb(task) elseif settings.action == 'reject' then smtp_message = 'message rejected' end - task:set_pre_result(settings['action'], smtp_message) + task:set_pre_result(settings['action'], smtp_message, 'spamtrap') end end end |