Compare commits

..

No commits in common. "b3935e759e7f9630fff8d3448789f10cc1947d66" and "d4748a3cb20900700b7c9d6a67b3342f263d9882" have entirely different histories.

2 changed files with 10 additions and 4 deletions

View File

@ -63,6 +63,9 @@ export class SMTPClient {
}
this.queue.push(stack);
this._poll();
if (this.queue.every((x) => x !== stack)) {
callback(null, message);
}
} else {
callback(new Error(why), msg);
}

View File

@ -120,7 +120,10 @@ export class SMTPConnection extends EventEmitter {
protected tls: boolean | SMTPSocketOptions = false;
protected port: number;
private greylistResponseTracker = new WeakSet<(...rest: any[]) => void>();
private greylistResponseTracker = new WeakMap<
(...rest: any[]) => void,
boolean
>();
/**
* SMTP class written using python's (2.7) smtplib.py as a base.
@ -408,9 +411,9 @@ export class SMTPConnection extends EventEmitter {
} else if (
(code === 450 || code === 451) &&
msg.message.toLowerCase().includes('greylist') &&
this.greylistResponseTracker.has(response) === false
this.greylistResponseTracker.get(response) === false
) {
this.greylistResponseTracker.add(response);
this.greylistResponseTracker.set(response, true);
setTimeout(() => {
this.send(cmd + CRLF, response);
}, GREYLIST_DELAY);
@ -432,7 +435,7 @@ export class SMTPConnection extends EventEmitter {
}
};
this.greylistResponseTracker.delete(response);
this.greylistResponseTracker.set(response, false);
this.send(cmd + CRLF, response);
}