Skip to content

Commit d4e1cfd

Browse files
authored
Merge pull request #200 from immjs/patch-1
Do not impose an unauthenticated command limit when auth is optional
2 parents ce14fcc + 72db181 commit d4e1cfd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/smtp-connection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ class SMTPConnection extends EventEmitter {
496496
}
497497

498498
// block users that try to fiddle around without logging in
499-
if (!this.session.user && this._isSupported('AUTH') && commandName !== 'AUTH' && this._maxAllowedUnauthenticatedCommands !== false) {
499+
if (!this.session.user && this._isSupported('AUTH') && !this._server.options.authOptional && commandName !== 'AUTH' && this._maxAllowedUnauthenticatedCommands !== false) {
500500
this._unauthenticatedCommands++;
501501
if (this._unauthenticatedCommands >= this._maxAllowedUnauthenticatedCommands) {
502502
return this.send(421, 'Error: too many unauthenticated commands');

0 commit comments

Comments
 (0)