import * as plugins from '../plugins.js'; import { MtaService } from './mta.classes.mta.js'; class DKIMVerifier { public mtaRef: MtaService; constructor(mtaRefArg: MtaService) { this.mtaRef = mtaRefArg; } async verify(email: string): Promise { console.log('Trying to verify DKIM now...'); try { const verification = await plugins.mailauth.authenticate(email, { /* resolver: (...args) => { console.log(args); } */ }); console.log(verification); if (verification && verification.dkim.results[0].status.result === 'pass') { console.log('DKIM Verification result: pass'); return true; } else { console.error('DKIM Verification failed:', verification?.error || 'Unknown error'); return false; } } catch (error) { console.error('DKIM Verification failed:', error); return false; } } } export { DKIMVerifier };