Skip to content

Commit

Permalink
fix(deps): use punycode module
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Feb 2, 2024
1 parent 0dbc8e1 commit 438c617
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
10 changes: 8 additions & 2 deletions lib/smtp-connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const ipv6normalize = require('ipv6-normalize');
const sasl = require('./sasl');
const crypto = require('crypto');
const os = require('os');
const punycode = require('punycode');
const punycode = require('punycode/');
const EventEmitter = require('events');
const base32 = require('base32.js');

Expand Down Expand Up @@ -496,7 +496,13 @@ class SMTPConnection extends EventEmitter {
}

// block users that try to fiddle around without logging in
if (!this.session.user && this._isSupported('AUTH') && !this._server.options.authOptional && commandName !== 'AUTH' && this._maxAllowedUnauthenticatedCommands !== false) {
if (
!this.session.user &&
this._isSupported('AUTH') &&
!this._server.options.authOptional &&
commandName !== 'AUTH' &&
this._maxAllowedUnauthenticatedCommands !== false
) {
this._unauthenticatedCommands++;
if (this._unauthenticatedCommands >= this._maxAllowedUnauthenticatedCommands) {
return this.send(421, 'Error: too many unauthenticated commands');
Expand Down
2 changes: 1 addition & 1 deletion lib/smtp-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const SMTPConnection = require('./smtp-connection').SMTPConnection;
const tlsOptions = require('./tls-options');
const EventEmitter = require('events');
const shared = require('nodemailer/lib/shared');
const punycode = require('punycode');
const punycode = require('punycode/');
const crypto = require('crypto');
const base32 = require('base32.js');

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"dependencies": {
"base32.js": "0.1.0",
"ipv6-normalize": "1.0.1",
"nodemailer": "6.9.9"
"nodemailer": "6.9.9",
"punycode": "2.3.1"
},
"devDependencies": {
"chai": "4.4.1",
Expand Down

0 comments on commit 438c617

Please sign in to comment.