Native DKIM: align with auth results header

This commit is contained in:
M66B 2024-05-28 07:59:20 +02:00
parent e5f21d6f1a
commit 9be5d1b385
1 changed files with 30 additions and 4 deletions

View File

@ -3516,8 +3516,21 @@ class Core {
boolean aligned = helper.isAligned(context, signers, message.return_path, message.smtp_from, message.from);
if (aligned)
message.dmarc = true;
else if (message.dmarc != null)
message.dmarc = false;
else if (message.dmarc != null) {
boolean found = false;
String asigner = helper.getSigner(authentication);
String adomain = UriHelper.getRootDomain(context, asigner);
if (adomain != null)
for (String signer : signers) {
String sdomain = UriHelper.getRootDomain(context, signer);
if (adomain.equalsIgnoreCase(sdomain)) {
found = true;
break;
}
}
if (!found)
message.dmarc = false;
}
}
}
@ -4690,8 +4703,21 @@ class Core {
boolean aligned = helper.isAligned(context, signers, message.return_path, message.smtp_from, message.from);
if (aligned)
message.dmarc = true;
else if (message.dmarc != null)
message.dmarc = false;
else if (message.dmarc != null) {
boolean found = false;
String asigner = helper.getSigner(authentication);
String adomain = UriHelper.getRootDomain(context, asigner);
if (adomain != null)
for (String signer : signers) {
String sdomain = UriHelper.getRootDomain(context, signer);
if (adomain.equalsIgnoreCase(sdomain)) {
found = true;
break;
}
}
if (!found)
message.dmarc = false;
}
}
}