The p value of a DMARC record can take the values none, quarantine or reject

The validation is no more about the being similar to the expected config. Now wre check that the value of the p parameter of a DMARC record has the value none, quarantine or reject. No check for other parameters but it could be improved
This commit is contained in:
stanislas 2023-09-12 00:37:47 +02:00
parent ec6bf12a74
commit df1f3149ea

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