liuch / dmarc-srg

A php parser, viewer and summary report generator for incoming DMARC reports.
GNU General Public License v3.0
218 stars 32 forks source link

Unknown tag: NP #68

Closed schleup closed 1 year ago

schleup commented 1 year ago

When fetching reports from noreply-dmarc-support@google.com I encounter an error: Unknown tag: NP

Most likely this is caused by the NP policy used in Google's records, like:

<policy_published>
    <domain>####.de</domain>
    <adkim>r</adkim>
    <aspf>r</aspf>
    <p>quarantine</p>
    <sp>quarantine</sp>
    <pct>100</pct>
    <np>quarantine</np>
  </policy_published>

In the code I find all policies from the snippet but NP is missing. Seems this is a new policy, since it's mentioned in the JPAAWG 2022 Keynote as new:

https://dmarc.org/presentations/JPAAWG-2022-Keynote-2.pdf

By the way, the domain concerned doesn't use the NP policy...

####. 300 IN TXT "v=DMARC1; p=quarantine; rua=mailto:####; ruf=####; rf=afrf; pct=100"

I'm using the latest version v1.7 from Github.

liuch commented 1 year ago

Thank you for the report, I'll fix it soon.

liuch commented 1 year ago

I have just fixed this issue: 20777cf6a8edecf0e123d8702a7ee3e6697928f5

Now reports are accepted without errors. The fix only adds a new rule and suggests updating the database. This is the first step. Then I'll add code to save and display this policy. So you will have time to update the database.

schleup commented 1 year ago

Thank you :-)

Just tested it, the Google reports are accepted and evaluated now.

liuch commented 1 year ago

I implemented saving and displaying this policy with the latest commit: 4f4ba5da3694d67cee30bac4ea24f513d3e56680

schleup commented 1 year ago

Thank you, this works perfectly as well:

image

ntnlabs commented 1 year ago

I upgraded from 1.3 to 1.7 and this is still present. The fix is pushed into a release?

liuch commented 1 year ago

This fix isn't in the latest release yet.

liuch commented 1 year ago

@ntnlabs, I just released version 1.8 which includes this fix.