aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/dmarc.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua
index b55c5d41f..af43a5b8c 100644
--- a/src/plugins/lua/dmarc.lua
+++ b/src/plugins/lua/dmarc.lua
@@ -415,12 +415,15 @@ local function dmarc_validate_policy(task, policy, hdrfromdom, dmarc_esld)
policy.domain .. ' : ' .. reason_str, policy.dmarc_policy)
disposition = what
else
- if (math.random(100) > policy.pct) then
+ local coin = math.random(100)
+ if (coin > policy.pct) then
if (not no_sampling_domains or
not no_sampling_domains:get_key(policy.domain)) then
task:insert_result(dmarc_symbols['softfail'], 1.0,
policy.domain .. ' : ' .. reason_str, policy.dmarc_policy, "sampled_out")
sampled_out = true
+ lua_util.debugm(N, task, 'changed dmarc policy from %s to %s, sampled out: %s < %s',
+ what, 'softfail', coin, policy.pct)
else
task:insert_result(dmarc_symbols[what], 1.0,
policy.domain .. ' : ' .. reason_str, policy.dmarc_policy, "local_policy")