diff --git a/lib/smtp-connection.js b/lib/smtp-connection.js index 280c952..3c08170 100644 --- a/lib/smtp-connection.js +++ b/lib/smtp-connection.js @@ -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'); @@ -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'); diff --git a/lib/smtp-server.js b/lib/smtp-server.js index 4c91e24..8604698 100644 --- a/lib/smtp-server.js +++ b/lib/smtp-server.js @@ -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'); diff --git a/package-lock.json b/package-lock.json index e623484..38fda41 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,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", @@ -2309,7 +2310,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, "engines": { "node": ">=6" } diff --git a/package.json b/package.json index 5109293..f335956 100644 --- a/package.json +++ b/package.json @@ -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",