interface IDkimVerificationResult { is_valid: boolean; domain: string | null; selector: string | null; status: string; details: string | null; } interface ISpfResult { result: string; domain: string; ip: string; explanation: string | null; } interface IDmarcResult { passed: boolean; policy: string; domain: string; dkim_result: string; spf_result: string; action: string; details: string | null; } interface IEmailSecurityResult { dkim: IDkimVerificationResult[]; spf: ISpfResult | null; dmarc: IDmarcResult | null; } interface IValidationResult { valid: boolean; formatValid: boolean; score: number; error: string | null; } interface IBounceDetection { bounce_type: string; category: string; } interface IReputationResult { ip: string; score: number; risk_level: string; ip_type: string; dnsbl_results: Array<{ server: string; listed: boolean; response: string | null; }>; listed_count: number; total_checked: number; } interface IContentScanResult { threatScore: number; threatType: string | null; threatDetails: string | null; scannedElements: string[]; } interface IVersionInfo { bin: string; core: string; security: string; smtp: string; } /** * Bridge between TypeScript and the Rust `mailer-bin` binary. * * Uses `@push.rocks/smartrust` for JSON-over-stdin/stdout IPC. * Singleton — access via `RustSecurityBridge.getInstance()`. */ export declare class RustSecurityBridge { private static instance; private bridge; private _running; private constructor(); /** Get or create the singleton instance. */ static getInstance(): RustSecurityBridge; /** Whether the Rust process is currently running and accepting commands. */ get running(): boolean; /** * Spawn the Rust binary and wait for the ready signal. * @returns `true` if the binary started successfully, `false` otherwise. */ start(): Promise; /** Kill the Rust process. */ stop(): Promise; /** Ping the Rust process. */ ping(): Promise; /** Get version information for all Rust crates. */ getVersion(): Promise; /** Validate an email address. */ validateEmail(email: string): Promise; /** Detect bounce type from SMTP response / diagnostic code. */ detectBounce(opts: { smtpResponse?: string; diagnosticCode?: string; statusCode?: string; }): Promise; /** Scan email content for threats (phishing, spam, malware, etc.). */ scanContent(opts: { subject?: string; textBody?: string; htmlBody?: string; attachmentNames?: string[]; }): Promise; /** Check IP reputation via DNSBL. */ checkIpReputation(ip: string): Promise; /** Verify DKIM signatures on a raw email message. */ verifyDkim(rawMessage: string): Promise; /** Sign an email with DKIM. */ signDkim(opts: { rawMessage: string; domain: string; selector?: string; privateKey: string; }): Promise<{ header: string; signedMessage: string; }>; /** Check SPF for a sender. */ checkSpf(opts: { ip: string; heloDomain: string; hostname?: string; mailFrom: string; }): Promise; /** * Compound email security verification: DKIM + SPF + DMARC in one IPC call. * * This is the preferred method for inbound email verification — it avoids * 3 sequential round-trips and correctly passes raw mail-auth types internally. */ verifyEmail(opts: { rawMessage: string; ip: string; heloDomain: string; hostname?: string; mailFrom: string; }): Promise; } export type { IDkimVerificationResult, ISpfResult, IDmarcResult, IEmailSecurityResult, IValidationResult, IBounceDetection, IContentScanResult, IReputationResult as IRustReputationResult, IVersionInfo, };