47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
/**
|
|
* Result of a DKIM verification
|
|
*/
|
|
export interface IDkimVerificationResult {
|
|
isValid: boolean;
|
|
domain?: string;
|
|
selector?: string;
|
|
status?: string;
|
|
details?: any;
|
|
errorMessage?: string;
|
|
signatureFields?: Record<string, string>;
|
|
}
|
|
/**
|
|
* Enhanced DKIM verifier using smartmail capabilities
|
|
*/
|
|
export declare class DKIMVerifier {
|
|
private verificationCache;
|
|
private cacheTtl;
|
|
constructor();
|
|
/**
|
|
* Verify DKIM signature for an email
|
|
* @param emailData The raw email data
|
|
* @param options Verification options
|
|
* @returns Verification result
|
|
*/
|
|
verify(emailData: string, options?: {
|
|
useCache?: boolean;
|
|
returnDetails?: boolean;
|
|
}): Promise<IDkimVerificationResult>;
|
|
/**
|
|
* Fetch DKIM public key from DNS
|
|
* @param domain The domain
|
|
* @param selector The DKIM selector
|
|
* @returns The DKIM public key or null if not found
|
|
*/
|
|
private fetchDkimKey;
|
|
/**
|
|
* Clear the verification cache
|
|
*/
|
|
clearCache(): void;
|
|
/**
|
|
* Get the size of the verification cache
|
|
* @returns Number of cached items
|
|
*/
|
|
getCacheSize(): number;
|
|
}
|