domainaware / checkdmarc

A parser for SPF and DMARC DNS records
https://domainaware.github.io/checkdmarc
Apache License 2.0
244 stars 76 forks source link

ISSUE-94: Fixing the issue with double counting void DNS lookups. #95

Closed aharpour closed 1 year ago

aharpour commented 1 year ago

Hello,

Some time ago, I reported an issue regarding the double counting of void look-ups in checkdmarc.py (https://github.com/domainaware/checkdmarc/issues/94). Today, I investigated the matter and identified the root cause. In checkdmarc.py, specifically on lines 1727 and 1748, the variable void_lookup_mechanism_count is incremented, followed by the raising of an exception called SPFTooManyVoidDNSLookups. However, in the exception handler at line 1887, void_lookup_mechanism_count is incremented again, resulting in double counting. I remove the incrementation on lines 1727 and 1748 and let the exception handler take care of the incrementing and validation of the value of void_lookup_mechanism_count. I created and tested a number of test cases. As far as I could test everything is working perfectly now.

Best regards Ebrahim Aharpour

seanthegeek commented 1 year ago

Thanks!