aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2016-08-30 22:48:13 +0200
committerAndrew Lewis <nerf@judo.za.org>2016-08-30 22:48:13 +0200
commit29a701bbd03931a9d5cff1e75927b9171371227d (patch)
treee2ccbc3d4315675e8702037edc8edcf7a3c70411 /src
parent4cda052e317aecc95842c5c650591cdb9d1965a8 (diff)
downloadrspamd-29a701bbd03931a9d5cff1e75927b9171371227d.tar.gz
rspamd-29a701bbd03931a9d5cff1e75927b9171371227d.zip
[Minor] Fix forcing actions in DMARC plugin
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/dmarc.lua13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua
index 1c290b31f..fc85c4766 100644
--- a/src/plugins/lua/dmarc.lua
+++ b/src/plugins/lua/dmarc.lua
@@ -55,13 +55,6 @@ local elts_re = rspamd_regexp.create_cached("\\s*\\\\{0,1};\\s*")
local dmarc_reporting = false
local dmarc_actions = {}
-local function maybe_force_action(disposition)
- local force_action = dmarc_actions[disposition]
- if force_action then
- task:set_pre_result(force_action, 'Action set by DMARC')
- end
-end
-
local function dmarc_report(task, spf_ok, dkim_ok, disposition)
local ip = task:get_from_ip()
if not ip:is_valid() then
@@ -75,6 +68,12 @@ local function dmarc_report(task, spf_ok, dkim_ok, disposition)
end
local function dmarc_callback(task)
+ local function maybe_force_action(disposition)
+ local force_action = dmarc_actions[disposition]
+ if force_action then
+ task:set_pre_result(force_action, 'Action set by DMARC')
+ end
+ end
local from = task:get_from(2)
local dmarc_domain
local ip_addr = task:get_ip()