Skip to content

Commit 5e5b688

Browse files
committed
5.2.20
- Don't overcount lookups caused by the `mx` mechanism (Closes #197)
1 parent ce6d82b commit 5e5b688

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 5.2.20
4+
5+
- Don't overcount lookups caused by the `mx` mechanism (Closes #197)
6+
37
## 5.2.19
48

59
- Make warning text consistent

checkdmarc/_constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
See the License for the specific language governing permissions and
2020
limitations under the License."""
2121

22-
__version__ = "5.12.19"
22+
__version__ = "5.12.20"
2323

2424
OS = platform.system()
2525
OS_RELEASE = platform.release()

checkdmarc/spf.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -454,16 +454,13 @@ def parse_spf_record(
454454
)
455455

456456
# RFC 7208 § 4.6.4: no more than 10 DNS queries total per evaluation
457-
if len(mx_hosts) > 9:
457+
if len(mx_hosts) > 10:
458458
raise SPFTooManyDNSLookups(
459-
f"{value} has more than 9 MX records - " "(RFC 7208 § 4.6.4)",
459+
f"{value} has more than 10 MX records - " "(RFC 7208 § 4.6.4)",
460460
dns_lookups=len(mx_hosts),
461461
)
462462
host_ips = {}
463463
for host in mx_hosts:
464-
# count one DNS query per MX target
465-
mechanism_dns_lookups += 1
466-
total_dns_lookups += 1
467464
hostname = host["hostname"]
468465
# --- perform A/AAAA resolution for each MX host ---
469466
try:

0 commit comments

Comments
 (0)