local strict_policy = false
local quarantine_policy = false
local found_policy = false
- local failed_policy = false
+ local failed_policy
local rua
for _,r in ipairs(results) do
return
else
if found_policy then
- failed_policy = true
+ failed_policy = 'Multiple policies defined in DNS'
return
else
found_policy = true
if dkim_pol == 's' then
strict_dkim = true
elseif dkim_pol ~= 'r' then
- failed_policy = true
+ failed_policy = 'adkim tag has invalid value'
return
end
end
if spf_pol == 's' then
strict_spf = true
elseif spf_pol ~= 'r' then
- failed_policy = true
+ failed_policy = 'aspf tag has invalid value'
return
end
end
strict_policy = true
quarantine_policy = true
elseif (policy ~= 'none') then
- failed_policy = true
+ failed_policy = 'p tag has invalid value'
return
end
end
quarantine_policy = false
end
else
- failed_policy = true
+ failed_policy = 'sp tag has invalid value'
return
end
end
end
end
- if failed_policy then return end
+ if failed_policy then
+ task:insert_result('DMARC_BAD_POLICY', res, lookup_domain .. ' : ' .. failed_policy)
+ return
+ end
-- Check dkim and spf symbols
local spf_ok = false
end
end
- -- XXX: handle rua and push data to redis
end
-- Do initial request