fix(rust-bridge): correct Email.addHeader() calls and IBounceDetection interface
Use addHeader() instead of non-existent setHeader() for security result headers, and align IBounceDetection with actual Rust struct fields (bounce_type + category only).
This commit is contained in:
@@ -656,12 +656,12 @@ export class UnifiedEmailServer extends EventEmitter {
|
||||
const dkimSummary = result.dkim
|
||||
.map(d => `${d.status}${d.domain ? ` (${d.domain})` : ''}`)
|
||||
.join(', ');
|
||||
email.setHeader('X-DKIM-Result', dkimSummary);
|
||||
email.addHeader('X-DKIM-Result', dkimSummary);
|
||||
}
|
||||
|
||||
// Apply SPF result header
|
||||
if (result.spf) {
|
||||
email.setHeader('Received-SPF', `${result.spf.result} (domain: ${result.spf.domain}, ip: ${result.spf.ip})`);
|
||||
email.addHeader('Received-SPF', `${result.spf.result} (domain: ${result.spf.domain}, ip: ${result.spf.ip})`);
|
||||
|
||||
// Mark as spam on SPF hard fail
|
||||
if (result.spf.result === 'fail') {
|
||||
@@ -672,7 +672,7 @@ export class UnifiedEmailServer extends EventEmitter {
|
||||
|
||||
// Apply DMARC result header and policy
|
||||
if (result.dmarc) {
|
||||
email.setHeader('X-DMARC-Result', `${result.dmarc.action} (policy=${result.dmarc.policy}, dkim=${result.dmarc.dkim_result}, spf=${result.dmarc.spf_result})`);
|
||||
email.addHeader('X-DMARC-Result', `${result.dmarc.action} (policy=${result.dmarc.policy}, dkim=${result.dmarc.dkim_result}, spf=${result.dmarc.spf_result})`);
|
||||
|
||||
if (result.dmarc.action === 'reject') {
|
||||
email.mightBeSpam = true;
|
||||
|
||||
@@ -46,11 +46,7 @@ interface IValidationResult {
|
||||
|
||||
interface IBounceDetection {
|
||||
bounce_type: string;
|
||||
severity: string;
|
||||
category: string;
|
||||
should_retry: boolean;
|
||||
recommended_action: string;
|
||||
details: string;
|
||||
}
|
||||
|
||||
interface IReputationResult {
|
||||
|
||||
Reference in New Issue
Block a user