Merge pull request #1713 from yorffuoj/enh-improve-diagnosis-for-dmarc-records

diagnosis: be more flexible regarding accepted values for DMARC DNS records
This commit is contained in:
Alexandre Aubin 2023-09-27 16:53:33 +02:00 committed by GitHub
commit dd161e8d63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -215,6 +215,11 @@ class MyDiagnoser(Diagnoser):
for part in current
if not part.startswith("ip4:") and not part.startswith("ip6:")
}
if "v=DMARC1" in r["value"]:
for param in current:
key, value = param.split("=")
if key == "p":
return value in ["none", "quarantine", "reject"]
return expected == current
elif r["type"] == "MX":
# For MX, we want to ignore the priority