From 8465ef359f88ddef7cad68a0c2e361bb0bfe58ff Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Fri, 3 Apr 2026 17:07:27 -0500 Subject: Add BIMI and MTA-STS checks to email security --- DomainDig/DomainViewModel.swift | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'DomainDig/DomainViewModel.swift') diff --git a/DomainDig/DomainViewModel.swift b/DomainDig/DomainViewModel.swift index 0ce2d8c..16eaabd 100644 --- a/DomainDig/DomainViewModel.swift +++ b/DomainDig/DomainViewModel.swift @@ -115,6 +115,7 @@ final class DomainViewModel { reachabilityResults: reachabilityResults, ipGeolocation: ipGeolocation, emailSecurity: emailSecurity, + mtaSts: emailSecurity?.mtaSts, ptrRecord: ptrRecord, redirectChain: redirectChain, portScanResults: portScanResults, @@ -482,7 +483,22 @@ final class DomainViewModel { lines.append("--------------") lines.append(" SPF: \(email.spf.found ? "✓" : "✗") \(email.spf.value ?? "No record found")") lines.append(" DMARC: \(email.dmarc.found ? "✓" : "✗") \(email.dmarc.value ?? "No record found")") - lines.append(" DKIM: \(email.dkim.found ? "✓" : "✗") \(email.dkim.value ?? "No record found")") + let dkimValue = if let selector = email.dkim.matchedSelector, + let value = email.dkim.value { + "\(value) (selector: \(selector))" + } else { + email.dkim.value ?? "No record found" + } + lines.append(" DKIM: \(email.dkim.found ? "✓" : "✗") \(dkimValue)") + let mtaDescription = if let mode = email.mtaSts?.policyMode { + "mode: \(mode)" + } else if email.mtaSts?.txtFound == true { + "Policy unavailable" + } else { + "No record found" + } + lines.append(" MTA-STS: \(email.mtaSts?.txtFound == true ? "✓" : "✗") \(mtaDescription)") + lines.append(" BIMI: \(email.bimi.found ? "✓" : "✗") \(email.bimi.value ?? "No record found")") } // SSL -- cgit v1.2.3