Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.trim()
);
// setup allowed auth methods
this.options.authMethods = [].concat(this.options.authMethods || []).map(method =>
(method || '')
.toString()
.toUpperCase()
.trim()
);
if (!this.options.authMethods.length) {
this.options.authMethods = ['LOGIN', 'PLAIN'];
}
this.logger = shared.getLogger(this.options, {
component: this.options.component || 'smtp-server'
});
// apply shorthand handlers
['onConnect', 'onAuth', 'onMailFrom', 'onRcptTo', 'onData', 'onClose'].forEach(handler => {
if (typeof this.options[handler] === 'function') {
this[handler] = this.options[handler];
}
});
/**
* Timeout after close has been called until pending connections are forcibly closed
*/
this._closeTimeout = false;
/**