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

onAuth is executed twice when an Error is provided as parameter on the callback #154

Open
neilpalima opened this issue Jul 21, 2020 · 1 comment

Comments

@neilpalima
Copy link

Is there a config that will not call the onAuth twice? Is this the expected behavior?

Sample code. console.log was executed twice.

onAuth: async (auth: SMTPServerAuthentication, session: SMTPServerSession, callback: CallbackOnAuthInterface) => {

        console.log("Here");
        callback(new Error('Invalid username or password.'));
}
@penguoir
Copy link

I think this depends on your server config. If the server has two auth methods then the client will retry authentication with each method. The default for the server authentication methods is ["PLAIN", "LOGIN"] so that's why you're seeing two console.logs.

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

2 participants