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

Uncaught error for DMARC query when ignoring unrelated records #130

Closed FestiveKyle closed 1 month ago

FestiveKyle commented 3 months ago

There is an uncaught error when ignoring unrelated records during the DMARC check if there is no DMARC record present.

    "dmarc": {
        "record": null,
        "valid": false,
        "location": null,
        "error": "list index out of range"
    },

Stems from here in dmarc.py:

        dmarc_record = [record for record in records if record.startswith(
            txt_prefix)][0]