Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handleResponse uses resolve for both good and bad responses #7

Open
rcjsuen opened this issue Jul 15, 2024 · 0 comments
Open

handleResponse uses resolve for both good and bad responses #7

rcjsuen opened this issue Jul 15, 2024 · 0 comments

Comments

@rcjsuen
Copy link

rcjsuen commented Jul 15, 2024

The current implementation has resolve called on a string for both good and bad responses. This is a little confusing and can make it difficult to determine if an error has happened or not.

maildove/src/maildove.ts

Lines 252 to 258 in c5a8dbb

this.queue.length = 0;
this.sock.removeAllListeners('close');
this.sock.removeAllListeners('end');
resolve(domain);
return;

maildove/src/maildove.ts

Lines 303 to 308 in c5a8dbb

default:
if (code >= smtpCodes.NegativeCompletion) {
console.error('SMTP server responds with error code', code);
this.sock.end();
resolve(`SMTP server responded with code: ${code} + ${msg}`);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant