Skip to content

Commit 76d8773

Browse files
committed
Fix a mechanism parsing
1 parent dc511bd commit 76d8773

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@
3030
"hosts": {
3131
"mx1.example.com": ["203.0.113.10"]
3232
}
33+
},
34+
{
35+
"mechanism": "a",
36+
"value": "example.com",
37+
"dns_lookups": 1,
38+
"void_dns_lookups": 0,
39+
"action", "pass",
40+
"addresses": [
41+
"23.192.228.80",
42+
"2600:1406:5e00:6::17ce:bc12"
43+
]
3344
}
3445
]
3546
```

checkdmarc/spf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,12 +416,12 @@ def parse_spf_record(
416416
pairs = [
417417
("mechanism", mechanism),
418418
("value", value),
419-
("addresses", a_records),
420419
("dns_lookups", mechanism_dns_lookups),
421420
("void_dns_lookups", mechanism_void_dns_lookups),
422421
("action", action),
422+
("addresses", a_records),
423423
]
424-
parsed["mechanisms"].append(pairs)
424+
parsed["mechanisms"].append(OrderedDict(pairs))
425425

426426
elif mechanism == "mx":
427427
mechanism_dns_lookups += 1

0 commit comments

Comments
 (0)