feat: surface most severe SPF result and hide "via" badge on spoofed mail

This commit is contained in:
Linus Rath
2026-06-01 17:46:57 +02:00
parent 4659b81538
commit 3035fb046f
6 changed files with 173 additions and 14 deletions
+3 -1
View File
@@ -1134,7 +1134,9 @@ export class JMAPClient implements IJMAPClient {
const authResultsHeader = headersRecord['Authentication-Results'];
if (authResultsHeader) {
const value = Array.isArray(authResultsHeader) ? authResultsHeader[0] : authResultsHeader;
// Multiple Authentication-Results headers (or multiple SPF identities in
// one header) must all be considered so the most severe result wins.
const value = Array.isArray(authResultsHeader) ? authResultsHeader.join('; ') : authResultsHeader;
email.authenticationResults = parseAuthenticationResults(value);
}
+10
View File
@@ -75,6 +75,16 @@ export interface AuthenticationResults {
result: 'pass' | 'fail' | 'softfail' | 'neutral' | 'none' | 'temperror' | 'permerror';
domain?: string;
ip?: string;
/**
* All SPF results when the server evaluated multiple identities (HELO and
* MAIL FROM). Present only when more than one result was found; `result`
* above is the most severe of these.
*/
all?: Array<{
result: 'pass' | 'fail' | 'softfail' | 'neutral' | 'none' | 'temperror' | 'permerror';
domain?: string;
identity?: 'helo' | 'mailfrom';
}>;
};
dkim?: {
result: 'pass' | 'fail' | 'policy' | 'neutral' | 'temperror' | 'permerror';