summaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/dmarc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/lua/dmarc.lua')
-rw-r--r--src/plugins/lua/dmarc.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua
index 45a30054a..ef86cfd07 100644
--- a/src/plugins/lua/dmarc.lua
+++ b/src/plugins/lua/dmarc.lua
@@ -38,6 +38,7 @@ local dmarc_redis_key_prefix = "dmarc_"
local dmarc_domain = nil
local elts_re = rspamd_regexp.create_cached("\\\\{0,1};\\s+")
local dmarc_reporting = false
+local dmarc_actions = {}
local function dmarc_report(task, spf_ok, dkim_ok, disposition)
local ip = task:get_from_ip()
@@ -267,6 +268,11 @@ local function dmarc_callback(task)
end
end
+ local force_action = dmarc_actions[disposition]
+ if force_action then
+ task:set_pre_result(force_action, 'Action set by DMARC')
+ end
+
end
-- Do initial request
@@ -286,6 +292,9 @@ end
if opts['reporting'] == true then
dmarc_reporting = true
end
+if type(opts['actions']) == 'table' then
+ dmarc_actions = opts['actions']
+end
redis_params = rspamd_parse_redis_server('dmarc')
if not redis_params then