From ee2520f2c0c2d806fd284c3d6b8a81a3822f5270 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Mon, 20 Apr 2026 15:28:12 -0500 Subject: feat(v1.8): improve result structure, history, and consistency - normalize sections and add summary card - fix resolver usage in reverse DNS - include custom port scans in history/export - standardize error handling - decompose ContentView into smaller views --- DomainDig/EmailSecurityService.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'DomainDig/EmailSecurityService.swift') diff --git a/DomainDig/EmailSecurityService.swift b/DomainDig/EmailSecurityService.swift index 50e5f73..c80d0f7 100644 --- a/DomainDig/EmailSecurityService.swift +++ b/DomainDig/EmailSecurityService.swift @@ -8,7 +8,7 @@ struct EmailSecurityService { /// Analyze email security records. SPF is parsed from existing TXT records; /// DMARC and DKIM require additional DoH queries. - static func analyze(domain: String, txtRecords: [DNSRecord]) async -> EmailSecurityResult { + static func analyze(domain: String, txtRecords: [DNSRecord]) async -> ServiceResult { // SPF: prefer the already-fetched apex TXT records, but fall back to a direct lookup // in case the earlier DNS section missed or normalized the record differently. let localSPFRecord = txtRecords.first(where: { isMatchingTXTRecord($0.value, prefix: "v=spf1") })?.value @@ -49,13 +49,16 @@ struct EmailSecurityService { value: bimiValue ) - return EmailSecurityResult( + let result = EmailSecurityResult( spf: spf, dmarc: dmarc, dkim: dkim, bimi: bimi, mtaSts: mtaSts ) + + let hasAnyRecord = result.spf.found || result.dmarc.found || result.dkim.found || result.bimi.found || result.mtaSts?.txtFound == true + return hasAnyRecord ? .success(result) : .empty("No email security records found") } /// Query a TXT record for the given subdomain via DoH. -- cgit v1.2.3