nodemailer / smtp-server

Create custom SMTP servers on the fly
Other
846 stars 145 forks source link

Too many unauthenticated commands while authOptional is true #164

Open jaspervann opened 3 years ago

jaspervann commented 3 years ago

The following line should check for this._server.options.authOptional, because if authOptional option is set to true, there may be infinite unauthenticated commands: https://github.com/nodemailer/smtp-server/blob/17fd809cf74d6ba5d9a4711d05ff4d379bbb6bb3/lib/smtp-connection.js#L454

Currently even whilst you set authOptional to true, the server will throw a "421 - Error: too many unauthenticated commands" after receiving _maxAllowedUnauthenticatedCommands unauthenticated commands. That's not desirable, because authentication in this case was not required.

jaspervann commented 3 years ago

The solution to issue #161 also resolves this problem.