mirror of
https://github.com/domainaware/parsedmarc.git
synced 2026-04-04 20:58:53 +00:00
Add alignment booleans to JSON output
This commit is contained in:
@@ -6,6 +6,7 @@ Collector (HEC)
|
||||
- Use a browser-like `User-Agent` when downloading the Public Suffix List, to
|
||||
avoid being blocked by security proxies
|
||||
- Reduce default DNS timeout to 0.5 seconds
|
||||
- Add alignment booleans to JSON output
|
||||
|
||||
3.9.7
|
||||
-----
|
||||
|
||||
@@ -350,6 +350,12 @@ def _parse_report_record(record, nameservers=None, timeout=0.5):
|
||||
if "spf" in policy_evaluated:
|
||||
new_policy_evaluated["spf"] = policy_evaluated["spf"]
|
||||
reasons = []
|
||||
spf_aligned = policy_evaluated["spf"] == "pass"
|
||||
dkim_aligned = policy_evaluated["dkim"] == "pass"
|
||||
dmarc_aligned = spf_aligned or dkim_aligned
|
||||
new_record["alignment"]["spf"] = spf_aligned
|
||||
new_record["alignment"]["dkim"] = dkim_aligned
|
||||
new_record["alignment"]["dmarc"] = dmarc_aligned
|
||||
if "reason" in policy_evaluated:
|
||||
if type(policy_evaluated["reason"]) == list:
|
||||
reasons = policy_evaluated["reason"]
|
||||
|
||||
Reference in New Issue
Block a user