Improve DKIM summary to distinguish missing records from invalid signatures
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Use DNS records instead of authentication results to determine DKIM presence, enabling a three-state display: passed (green), published but invalid signature (yellow+red), or no DKIM at all (red).
This commit is contained in:
parent
35fc997390
commit
3c192f17fd
1 changed files with 22 additions and 6 deletions
|
|
@ -25,16 +25,32 @@
|
||||||
|
|
||||||
// Email sender information
|
// Email sender information
|
||||||
const mailFrom = report.header_analysis?.headers?.from?.value || "an unknown sender";
|
const mailFrom = report.header_analysis?.headers?.from?.value || "an unknown sender";
|
||||||
const hasDkim = report.authentication?.dkim && report.authentication?.dkim.length > 0;
|
const hasDkim =
|
||||||
const dkimPassed = hasDkim && report.authentication?.dkim?.some((d) => d.result === "pass");
|
report.dns_results?.dkim_records && report.dns_results?.dkim_records?.length > 0;
|
||||||
|
const dkimPassed =
|
||||||
|
report.authentication?.dkim &&
|
||||||
|
report.authentication?.dkim.length > 0 &&
|
||||||
|
report.authentication?.dkim?.some((d) => d.result === "pass");
|
||||||
|
|
||||||
segments.push({ text: "Received a " });
|
segments.push({ text: "Received a " });
|
||||||
segments.push({
|
segments.push({
|
||||||
text: dkimPassed ? "DKIM-signed" : "non-DKIM-signed",
|
text: hasDkim ? "DKIM-signed" : "non-DKIM-signed",
|
||||||
highlight: { color: dkimPassed ? "good" : "danger", bold: true },
|
highlight: {
|
||||||
link: "#authentication-dkim",
|
color: hasDkim ? (dkimPassed ? "good" : "warning") : "danger",
|
||||||
|
bold: true,
|
||||||
|
},
|
||||||
|
link: hasDkim && dkimPassed ? "#authentication-dkim" : "#dns-details",
|
||||||
});
|
});
|
||||||
segments.push({ text: " email from " });
|
segments.push({ text: " email" });
|
||||||
|
if (hasDkim && !dkimPassed) {
|
||||||
|
segments.push({ text: " with " });
|
||||||
|
segments.push({
|
||||||
|
text: "an invalid signature",
|
||||||
|
highlight: { color: "danger", bold: true },
|
||||||
|
link: "#authentication-dkim",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
segments.push({ text: " from " });
|
||||||
segments.push({
|
segments.push({
|
||||||
text: mailFrom,
|
text: mailFrom,
|
||||||
highlight: { emphasis: true },
|
highlight: { emphasis: true },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue