fix(core): update

This commit is contained in:
2020-06-18 15:34:05 +00:00
parent 2117c2f5d9
commit 2b1f8a2718
6 changed files with 203 additions and 30 deletions

View File

@@ -0,0 +1,19 @@
import * as plugins from './smartmail.plugins';
export interface IEmailValidationResult {
valid: boolean;
reason: string;
}
export class EmailAddressValidator {
public smartdns = new plugins.smartdns.Smartdns({});
public async validate(emailArg: string): Promise<IEmailValidationResult> {
const emailArray = emailArg.split('@');
const result = await this.smartdns.getRecord(emailArray[1], 'MX');
return {
valid: !!result,
reason: 'todo'
};
}
}