node_modules: update

This commit is contained in:
dawidd6 authored and github-actions[bot] committed 2026-11-20 17:41:12 +00:00
1 parent 0989b5499d
commit a20949df3b
21 files changed
+129 -34

No files matched your search

+3 -3
View File
@@ -94,9 +94,9 @@
} }
}, },
"node_modules/nodemailer": { "node_modules/nodemailer": {
"version": "10.5.0", "version": "10.6.1",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-10.5.0.tgz", "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-10.6.1.tgz",
"integrity": "sha512-L/w/HH5MqpzMDuZD7fQdt/+KqymuvrpaApaIjAH2XA3ILePwlcvXCVVvP75xVrXCEt2ggK2marrrHHFB5Qu0kA==", "integrity": "sha512-d7kfFfS/tR4Aca+SBvRaQ+MXKNv7d2JiRe5TxaRcFT/kYMh4GGPnW9aKksTIEvyEbA7d/7HYWE4YPDEHxzJj/g==",
"license": "MIT-0", "license": "MIT-0",
"engines": { "engines": {
"node": ">=20.0.0" "node": ">=20.0.0"
+21
View File
@@ -1,5 +1,26 @@
# CHANGELOG # CHANGELOG
## [10.6.1](https://github.com/nodemailer/nodemailer/compare/v10.6.0...v10.6.1) (2026-11-20)
### Bug Fixes
* **dkim:** sign List-Unsubscribe-Post by default ([#1922](https://github.com/nodemailer/nodemailer/issues/1922)) ([f91077c](https://github.com/nodemailer/nodemailer/commit/f91077c5bbc175fbb853d3c1cf3131c30283d52b))
* **fetch:** identify cookies by name, domain and path ([#1920](https://github.com/nodemailer/nodemailer/issues/1920)) ([91a298f](https://github.com/nodemailer/nodemailer/commit/91a298fc112017decdeb2b401238e901dd4b2256))
## [10.6.0](https://github.com/nodemailer/nodemailer/compare/v10.5.0...v10.6.0) (2026-11-15)
### Features
* **smtp:** add configurable socketCloseTimeout ([#1916](https://github.com/nodemailer/nodemailer/issues/1916)) ([7f04d0b](https://github.com/nodemailer/nodemailer/commit/7f04d0b78e887191c89775cf4a3063462b222aad)), closes [#1915](https://github.com/nodemailer/nodemailer/issues/1915)
### Bug Fixes
* let Set-Cookie Max-Age take precedence over Expires ([#1917](https://github.com/nodemailer/nodemailer/issues/1917)) ([d6d6d44](https://github.com/nodemailer/nodemailer/commit/d6d6d44f5fbdf61936032d8865a1312c89c1804e))
* **smtp-connection:** close the TLS socket of an upgraded connection on Node 27 ([4135015](https://github.com/nodemailer/nodemailer/commit/4135015175398aaad5ac6e1866e91a758c432417))
## [10.5.0](https://github.com/nodemailer/nodemailer/compare/v10.4.1...v10.5.0) (2026-11-10) ## [10.5.0](https://github.com/nodemailer/nodemailer/compare/v10.4.1...v10.5.0) (2026-11-10)
+4
View File
@@ -35,6 +35,10 @@ Work already started by a plugin or a custom `getSocket` hook requires that code
Other bundled transports (stream, JSON, sendmail and SES) ignore the signal once the message is handed to them, so the message is sent normally. A signal that is already aborted, or aborts while plugins run, still cancels the send with `EABORT` on every transport, as that happens before the transport is called. A `signal` value that is not an `AbortSignal` fails the send with `ECONFIG`. Custom transports can opt in with `supportsAbortSignal: true`; their `send()` must register its abort listener synchronously, check for a pre-aborted signal, stop the work it owns, invoke its callback once, and remove the listener on completion. Other bundled transports (stream, JSON, sendmail and SES) ignore the signal once the message is handed to them, so the message is sent normally. A signal that is already aborted, or aborts while plugins run, still cancels the send with `EABORT` on every transport, as that happens before the transport is called. A `signal` value that is not an `AbortSignal` fails the send with `ECONFIG`. Custom transports can opt in with `supportsAbortSignal: true`; their `send()` must register its abort listener synchronously, check for a pre-aborted signal, stop the work it owns, invoke its callback once, and remove the listener on completion.
## SMTP socket close timeout
When an SMTP connection closes, Nodemailer ends the socket and destroys it if the server has not closed its side within `socketCloseTimeout` milliseconds (default 5000). Set it to `0` to destroy the socket right away. This applies to SMTP and pooled SMTP, including aborted sends and `transporter.close({ force: true })`. It does not tell you whether the server accepted a message that was in flight.
## Having an issue? ## Having an issue?
#### First review the docs #### First review the docs
+3 -2
View File
@@ -62,12 +62,13 @@ function unsupportedHashAlgoError(hashAlgo) {
*/ */
function sign(headers, hashAlgo, bodyHash, options) { function sign(headers, hashAlgo, bodyHash, options) {
options = options || {}; options = options || {};
// all listed fields from RFC4871 #5.5 // all listed fields from RFC4871 #5.5, plus List-Unsubscribe-Post: RFC 8058 only allows
// one-click unsubscribe when the signature covers it next to List-Unsubscribe
const defaultFieldNames = 'From:Sender:Reply-To:Subject:Date:Message-ID:To:' + const defaultFieldNames = 'From:Sender:Reply-To:Subject:Date:Message-ID:To:' +
'Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:' + 'Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:' +
'Content-Description:Resent-Date:Resent-From:Resent-Sender:' + 'Content-Description:Resent-Date:Resent-From:Resent-Sender:' +
'Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:' + 'Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:' +
'List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:' + 'List-Id:List-Help:List-Unsubscribe:List-Unsubscribe-Post:List-Subscribe:List-Post:' +
'List-Owner:List-Archive:OTP-Token'; 'List-Owner:List-Archive:OTP-Token';
const fieldNames = options.headerFieldNames || defaultFieldNames; const fieldNames = options.headerFieldNames || defaultFieldNames;
const canonicalizedHeaderData = relaxedHeaders(headers, fieldNames, options.skipFields); const canonicalizedHeaderData = relaxedHeaders(headers, fieldNames, options.skipFields);
+3 -1
View File
@@ -71,7 +71,9 @@ declare class Cookies {
*/ */
add(cookie: Cookie): boolean; add(cookie: Cookie): boolean;
/** /**
* Checks if two cookie objects are the same * Checks if two cookie objects are the same cookie. A cookie is identified by its
* name, domain and path (RFC 6265 section 5.3), the Secure and HttpOnly flags are
* attributes of the stored cookie that an update replaces
* *
* @param a Cookie to check against * @param a Cookie to check against
* @param b Cookie to check against * @param b Cookie to check against
+12 -3
View File
@@ -89,6 +89,10 @@ class Cookies {
if (!cookie.expires) { if (!cookie.expires) {
cookie.expires = new Date(Date.now() + (Number(this.options.sessionTimeout || SESSION_TIMEOUT) || SESSION_TIMEOUT) * 1000); cookie.expires = new Date(Date.now() + (Number(this.options.sessionTimeout || SESSION_TIMEOUT) || SESSION_TIMEOUT) * 1000);
} }
// a non-secure url can not set a Secure cookie, nor overwrite or delete one (RFC 6265bis section 5.7)
if (urlparts.protocol !== 'https:' && (cookie.secure || this.cookies.some(stored => stored.secure && this.compare(stored, cookie)))) {
return false;
}
return this.add(cookie); return this.add(cookie);
} }
/** /**
@@ -131,6 +135,7 @@ class Cookies {
parse(cookieStr) { parse(cookieStr) {
const cookie = {}; const cookie = {};
let hasNameValue = false; let hasNameValue = false;
let hasMaxAge = false;
(cookieStr || '') (cookieStr || '')
.toString() .toString()
.split(';') .split(';')
@@ -158,7 +163,8 @@ class Cookies {
case 'expires': { case 'expires': {
const expires = new Date(value); const expires = new Date(value);
// ignore date if can not parse it // ignore date if can not parse it
if (expires.toString() !== 'Invalid Date') { if (expires.toString() !== 'Invalid Date' && !hasMaxAge) {
// Max-Age has precedence when both attributes are present (RFC 6265 5.3)
cookie.expires = expires; cookie.expires = expires;
} }
break; break;
@@ -175,6 +181,7 @@ class Cookies {
break; break;
case 'max-age': case 'max-age':
cookie.expires = new Date(Date.now() + (Number(value) || 0) * 1000); cookie.expires = new Date(Date.now() + (Number(value) || 0) * 1000);
hasMaxAge = true;
break; break;
case 'secure': case 'secure':
cookie.secure = true; cookie.secure = true;
@@ -244,14 +251,16 @@ class Cookies {
return true; return true;
} }
/** /**
* Checks if two cookie objects are the same * Checks if two cookie objects are the same cookie. A cookie is identified by its
* name, domain and path (RFC 6265 section 5.3), the Secure and HttpOnly flags are
* attributes of the stored cookie that an update replaces
* *
* @param a Cookie to check against * @param a Cookie to check against
* @param b Cookie to check against * @param b Cookie to check against
* @returns True, if the cookies are the same * @returns True, if the cookies are the same
*/ */
compare(a, b) { compare(a, b) {
return a.name === b.name && a.path === b.path && a.domain === b.domain && a.secure === b.secure && a.httponly === b.httponly; return a.name === b.name && a.path === b.path && a.domain === b.domain;
} }
/** /**
* Checks if a cookie is expired * Checks if a cookie is expired
+1 -1
View File
@@ -1,3 +1,3 @@
export declare const name = "nodemailer"; export declare const name = "nodemailer";
export declare const version = "10.5.0"; export declare const version = "10.6.1";
export declare const homepage = "https://nodemailer.com/"; export declare const homepage = "https://nodemailer.com/";
+1 -1
View File
@@ -3,5 +3,5 @@
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.homepage = exports.version = exports.name = void 0; exports.homepage = exports.version = exports.name = void 0;
exports.name = 'nodemailer'; exports.name = 'nodemailer';
exports.version = '10.5.0'; exports.version = '10.6.1';
exports.homepage = 'https://nodemailer.com/'; exports.homepage = 'https://nodemailer.com/';
+3
View File
@@ -42,6 +42,8 @@ export interface SMTPConnectionOptions {
greetingTimeout?: number | undefined; greetingTimeout?: number | undefined;
/** Time of inactivity in ms until the connection is closed, defaults to 10 minutes */ /** Time of inactivity in ms until the connection is closed, defaults to 10 minutes */
socketTimeout?: number | undefined; socketTimeout?: number | undefined;
/** Time in ms to wait for the peer to close after ending the socket, defaults to 5 seconds. Set to 0 to destroy it immediately */
socketCloseTimeout?: number | undefined;
/** Largest single server response to accept in bytes, defaults to 1 MB */ /** Largest single server response to accept in bytes, defaults to 1 MB */
maxResponseSize?: number | undefined; maxResponseSize?: number | undefined;
/** Time to wait in ms for the DNS requests to be resolved, defaults to 30 seconds */ /** Time to wait in ms for the DNS requests to be resolved, defaults to 30 seconds */
@@ -307,6 +309,7 @@ export type SMTPConnectionResponseAction = (str: string) => void;
* * **greetingTimeout** - Time to wait in ms until greeting message is received from the server (defaults to 30 seconds) * * **greetingTimeout** - Time to wait in ms until greeting message is received from the server (defaults to 30 seconds)
* * **connectionTimeout** - how many milliseconds to wait for the connection to establish (defaults to 2 minutes) * * **connectionTimeout** - how many milliseconds to wait for the connection to establish (defaults to 2 minutes)
* * **socketTimeout** - Time of inactivity until the connection is closed (defaults to 10 minutes) * * **socketTimeout** - Time of inactivity until the connection is closed (defaults to 10 minutes)
* * **socketCloseTimeout** - Time in ms to wait for the peer to close after ending the socket (defaults to 5 seconds, 0 destroys immediately)
* * **maxResponseSize** - Largest single server response to accept in bytes (defaults to 1 MB) * * **maxResponseSize** - Largest single server response to accept in bytes (defaults to 1 MB)
* * **dnsTimeout** - Time to wait in ms for the DNS requests to be resolved (defaults to 30 seconds) * * **dnsTimeout** - Time to wait in ms for the DNS requests to be resolved (defaults to 30 seconds)
* * **lmtp** - if true, uses LMTP instead of SMTP protocol * * **lmtp** - if true, uses LMTP instead of SMTP protocol
+11 -3
View File
@@ -145,6 +145,7 @@ function maskAuthCommand(cmd) {
* * **greetingTimeout** - Time to wait in ms until greeting message is received from the server (defaults to 30 seconds) * * **greetingTimeout** - Time to wait in ms until greeting message is received from the server (defaults to 30 seconds)
* * **connectionTimeout** - how many milliseconds to wait for the connection to establish (defaults to 2 minutes) * * **connectionTimeout** - how many milliseconds to wait for the connection to establish (defaults to 2 minutes)
* * **socketTimeout** - Time of inactivity until the connection is closed (defaults to 10 minutes) * * **socketTimeout** - Time of inactivity until the connection is closed (defaults to 10 minutes)
* * **socketCloseTimeout** - Time in ms to wait for the peer to close after ending the socket (defaults to 5 seconds, 0 destroys immediately)
* * **maxResponseSize** - Largest single server response to accept in bytes (defaults to 1 MB) * * **maxResponseSize** - Largest single server response to accept in bytes (defaults to 1 MB)
* * **dnsTimeout** - Time to wait in ms for the DNS requests to be resolved (defaults to 30 seconds) * * **dnsTimeout** - Time to wait in ms for the DNS requests to be resolved (defaults to 30 seconds)
* * **lmtp** - if true, uses LMTP instead of SMTP protocol * * **lmtp** - if true, uses LMTP instead of SMTP protocol
@@ -468,11 +469,18 @@ class SMTPConnection extends node_events_1.EventEmitter {
return; return;
} }
this._closing = true; this._closing = true;
const closeMethod = this.stage === 'init' ? 'destroy' : 'end'; // anything but a non-negative finite number keeps the default grace period
const configuredCloseTimeout = this.options.socketCloseTimeout;
const socketCloseTimeout = typeof configuredCloseTimeout === 'number' && Number.isFinite(configuredCloseTimeout) && configuredCloseTimeout >= 0
? configuredCloseTimeout
: CLOSE_TIMEOUT;
const closeMethod = this.stage === 'init' || socketCloseTimeout === 0 ? 'destroy' : 'end';
this.logger.debug({ this.logger.debug({
tnx: 'smtp' tnx: 'smtp'
}, 'Closing connection to the server using "%s"', closeMethod); }, 'Closing connection to the server using "%s"', closeMethod);
const socket = (this._socket && this._socket.socket) || this._socket; // after STARTTLS this is the TLS socket, tear that one down and not the plain socket it
// wraps (Node 27 exposes the wrapped socket as `.socket`)
const socket = this._socket;
// Detach any in-flight DATA stream from the socket so the source stream // Detach any in-flight DATA stream from the socket so the source stream
// can be garbage-collected once the socket is gone. // can be garbage-collected once the socket is gone.
if (this._currentDataStream) { if (this._currentDataStream) {
@@ -514,7 +522,7 @@ class SMTPConnection extends node_events_1.EventEmitter {
if (closeMethod === 'end') { if (closeMethod === 'end') {
// end() only closes our side, a server that never closes its own would keep // end() only closes our side, a server that never closes its own would keep
// the socket, and the process with it, around for good // the socket, and the process with it, around for good
const closeTimer = setTimeout(() => socket.destroy(), CLOSE_TIMEOUT); const closeTimer = setTimeout(() => socket.destroy(), socketCloseTimeout);
if (typeof closeTimer.unref === 'function') { if (typeof closeTimer.unref === 'function') {
closeTimer.unref(); closeTimer.unref();
} }
+6
View File
@@ -463,6 +463,12 @@ exports.services = {
"host": "smtp-relay.brevo.com", "host": "smtp-relay.brevo.com",
"port": 587 "port": 587
}, },
"Sendora": {
"description": "Sendora",
"host": "smtp.sendora.se",
"port": 465,
"secure": true
},
"SendPulse": { "SendPulse": {
"description": "SendPulse", "description": "SendPulse",
"host": "smtp-pulse.com", "host": "smtp-pulse.com",
+3 -2
View File
@@ -24,12 +24,13 @@ function unsupportedHashAlgoError(hashAlgo) {
*/ */
function sign(headers, hashAlgo, bodyHash, options) { function sign(headers, hashAlgo, bodyHash, options) {
options = options || {}; options = options || {};
// all listed fields from RFC4871 #5.5 // all listed fields from RFC4871 #5.5, plus List-Unsubscribe-Post: RFC 8058 only allows
// one-click unsubscribe when the signature covers it next to List-Unsubscribe
const defaultFieldNames = 'From:Sender:Reply-To:Subject:Date:Message-ID:To:' + const defaultFieldNames = 'From:Sender:Reply-To:Subject:Date:Message-ID:To:' +
'Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:' + 'Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:' +
'Content-Description:Resent-Date:Resent-From:Resent-Sender:' + 'Content-Description:Resent-Date:Resent-From:Resent-Sender:' +
'Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:' + 'Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:' +
'List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:' + 'List-Id:List-Help:List-Unsubscribe:List-Unsubscribe-Post:List-Subscribe:List-Post:' +
'List-Owner:List-Archive:OTP-Token'; 'List-Owner:List-Archive:OTP-Token';
const fieldNames = options.headerFieldNames || defaultFieldNames; const fieldNames = options.headerFieldNames || defaultFieldNames;
const canonicalizedHeaderData = relaxedHeaders(headers, fieldNames, options.skipFields); const canonicalizedHeaderData = relaxedHeaders(headers, fieldNames, options.skipFields);
+3 -1
View File
@@ -71,7 +71,9 @@ declare class Cookies {
*/ */
add(cookie: Cookie): boolean; add(cookie: Cookie): boolean;
/** /**
* Checks if two cookie objects are the same * Checks if two cookie objects are the same cookie. A cookie is identified by its
* name, domain and path (RFC 6265 section 5.3), the Secure and HttpOnly flags are
* attributes of the stored cookie that an update replaces
* *
* @param a Cookie to check against * @param a Cookie to check against
* @param b Cookie to check against * @param b Cookie to check against
+12 -3
View File
@@ -51,6 +51,10 @@ class Cookies {
if (!cookie.expires) { if (!cookie.expires) {
cookie.expires = new Date(Date.now() + (Number(this.options.sessionTimeout || SESSION_TIMEOUT) || SESSION_TIMEOUT) * 1000); cookie.expires = new Date(Date.now() + (Number(this.options.sessionTimeout || SESSION_TIMEOUT) || SESSION_TIMEOUT) * 1000);
} }
// a non-secure url can not set a Secure cookie, nor overwrite or delete one (RFC 6265bis section 5.7)
if (urlparts.protocol !== 'https:' && (cookie.secure || this.cookies.some(stored => stored.secure && this.compare(stored, cookie)))) {
return false;
}
return this.add(cookie); return this.add(cookie);
} }
/** /**
@@ -93,6 +97,7 @@ class Cookies {
parse(cookieStr) { parse(cookieStr) {
const cookie = {}; const cookie = {};
let hasNameValue = false; let hasNameValue = false;
let hasMaxAge = false;
(cookieStr || '') (cookieStr || '')
.toString() .toString()
.split(';') .split(';')
@@ -120,7 +125,8 @@ class Cookies {
case 'expires': { case 'expires': {
const expires = new Date(value); const expires = new Date(value);
// ignore date if can not parse it // ignore date if can not parse it
if (expires.toString() !== 'Invalid Date') { if (expires.toString() !== 'Invalid Date' && !hasMaxAge) {
// Max-Age has precedence when both attributes are present (RFC 6265 5.3)
cookie.expires = expires; cookie.expires = expires;
} }
break; break;
@@ -137,6 +143,7 @@ class Cookies {
break; break;
case 'max-age': case 'max-age':
cookie.expires = new Date(Date.now() + (Number(value) || 0) * 1000); cookie.expires = new Date(Date.now() + (Number(value) || 0) * 1000);
hasMaxAge = true;
break; break;
case 'secure': case 'secure':
cookie.secure = true; cookie.secure = true;
@@ -206,14 +213,16 @@ class Cookies {
return true; return true;
} }
/** /**
* Checks if two cookie objects are the same * Checks if two cookie objects are the same cookie. A cookie is identified by its
* name, domain and path (RFC 6265 section 5.3), the Secure and HttpOnly flags are
* attributes of the stored cookie that an update replaces
* *
* @param a Cookie to check against * @param a Cookie to check against
* @param b Cookie to check against * @param b Cookie to check against
* @returns True, if the cookies are the same * @returns True, if the cookies are the same
*/ */
compare(a, b) { compare(a, b) {
return a.name === b.name && a.path === b.path && a.domain === b.domain && a.secure === b.secure && a.httponly === b.httponly; return a.name === b.name && a.path === b.path && a.domain === b.domain;
} }
/** /**
* Checks if a cookie is expired * Checks if a cookie is expired
+1 -1
View File
@@ -1,3 +1,3 @@
export declare const name = "nodemailer"; export declare const name = "nodemailer";
export declare const version = "10.5.0"; export declare const version = "10.6.1";
export declare const homepage = "https://nodemailer.com/"; export declare const homepage = "https://nodemailer.com/";
+1 -1
View File
@@ -1,4 +1,4 @@
// Generated by scripts/build.js from package.json. Do not edit by hand. // Generated by scripts/build.js from package.json. Do not edit by hand.
export const name = 'nodemailer'; export const name = 'nodemailer';
export const version = '10.5.0'; export const version = '10.6.1';
export const homepage = 'https://nodemailer.com/'; export const homepage = 'https://nodemailer.com/';
+3
View File
@@ -42,6 +42,8 @@ export interface SMTPConnectionOptions {
greetingTimeout?: number | undefined; greetingTimeout?: number | undefined;
/** Time of inactivity in ms until the connection is closed, defaults to 10 minutes */ /** Time of inactivity in ms until the connection is closed, defaults to 10 minutes */
socketTimeout?: number | undefined; socketTimeout?: number | undefined;
/** Time in ms to wait for the peer to close after ending the socket, defaults to 5 seconds. Set to 0 to destroy it immediately */
socketCloseTimeout?: number | undefined;
/** Largest single server response to accept in bytes, defaults to 1 MB */ /** Largest single server response to accept in bytes, defaults to 1 MB */
maxResponseSize?: number | undefined; maxResponseSize?: number | undefined;
/** Time to wait in ms for the DNS requests to be resolved, defaults to 30 seconds */ /** Time to wait in ms for the DNS requests to be resolved, defaults to 30 seconds */
@@ -307,6 +309,7 @@ export type SMTPConnectionResponseAction = (str: string) => void;
* * **greetingTimeout** - Time to wait in ms until greeting message is received from the server (defaults to 30 seconds) * * **greetingTimeout** - Time to wait in ms until greeting message is received from the server (defaults to 30 seconds)
* * **connectionTimeout** - how many milliseconds to wait for the connection to establish (defaults to 2 minutes) * * **connectionTimeout** - how many milliseconds to wait for the connection to establish (defaults to 2 minutes)
* * **socketTimeout** - Time of inactivity until the connection is closed (defaults to 10 minutes) * * **socketTimeout** - Time of inactivity until the connection is closed (defaults to 10 minutes)
* * **socketCloseTimeout** - Time in ms to wait for the peer to close after ending the socket (defaults to 5 seconds, 0 destroys immediately)
* * **maxResponseSize** - Largest single server response to accept in bytes (defaults to 1 MB) * * **maxResponseSize** - Largest single server response to accept in bytes (defaults to 1 MB)
* * **dnsTimeout** - Time to wait in ms for the DNS requests to be resolved (defaults to 30 seconds) * * **dnsTimeout** - Time to wait in ms for the DNS requests to be resolved (defaults to 30 seconds)
* * **lmtp** - if true, uses LMTP instead of SMTP protocol * * **lmtp** - if true, uses LMTP instead of SMTP protocol
+11 -3
View File
@@ -107,6 +107,7 @@ function maskAuthCommand(cmd) {
* * **greetingTimeout** - Time to wait in ms until greeting message is received from the server (defaults to 30 seconds) * * **greetingTimeout** - Time to wait in ms until greeting message is received from the server (defaults to 30 seconds)
* * **connectionTimeout** - how many milliseconds to wait for the connection to establish (defaults to 2 minutes) * * **connectionTimeout** - how many milliseconds to wait for the connection to establish (defaults to 2 minutes)
* * **socketTimeout** - Time of inactivity until the connection is closed (defaults to 10 minutes) * * **socketTimeout** - Time of inactivity until the connection is closed (defaults to 10 minutes)
* * **socketCloseTimeout** - Time in ms to wait for the peer to close after ending the socket (defaults to 5 seconds, 0 destroys immediately)
* * **maxResponseSize** - Largest single server response to accept in bytes (defaults to 1 MB) * * **maxResponseSize** - Largest single server response to accept in bytes (defaults to 1 MB)
* * **dnsTimeout** - Time to wait in ms for the DNS requests to be resolved (defaults to 30 seconds) * * **dnsTimeout** - Time to wait in ms for the DNS requests to be resolved (defaults to 30 seconds)
* * **lmtp** - if true, uses LMTP instead of SMTP protocol * * **lmtp** - if true, uses LMTP instead of SMTP protocol
@@ -430,11 +431,18 @@ class SMTPConnection extends EventEmitter {
return; return;
} }
this._closing = true; this._closing = true;
const closeMethod = this.stage === 'init' ? 'destroy' : 'end'; // anything but a non-negative finite number keeps the default grace period
const configuredCloseTimeout = this.options.socketCloseTimeout;
const socketCloseTimeout = typeof configuredCloseTimeout === 'number' && Number.isFinite(configuredCloseTimeout) && configuredCloseTimeout >= 0
? configuredCloseTimeout
: CLOSE_TIMEOUT;
const closeMethod = this.stage === 'init' || socketCloseTimeout === 0 ? 'destroy' : 'end';
this.logger.debug({ this.logger.debug({
tnx: 'smtp' tnx: 'smtp'
}, 'Closing connection to the server using "%s"', closeMethod); }, 'Closing connection to the server using "%s"', closeMethod);
const socket = (this._socket && this._socket.socket) || this._socket; // after STARTTLS this is the TLS socket, tear that one down and not the plain socket it
// wraps (Node 27 exposes the wrapped socket as `.socket`)
const socket = this._socket;
// Detach any in-flight DATA stream from the socket so the source stream // Detach any in-flight DATA stream from the socket so the source stream
// can be garbage-collected once the socket is gone. // can be garbage-collected once the socket is gone.
if (this._currentDataStream) { if (this._currentDataStream) {
@@ -476,7 +484,7 @@ class SMTPConnection extends EventEmitter {
if (closeMethod === 'end') { if (closeMethod === 'end') {
// end() only closes our side, a server that never closes its own would keep // end() only closes our side, a server that never closes its own would keep
// the socket, and the process with it, around for good // the socket, and the process with it, around for good
const closeTimer = setTimeout(() => socket.destroy(), CLOSE_TIMEOUT); const closeTimer = setTimeout(() => socket.destroy(), socketCloseTimeout);
if (typeof closeTimer.unref === 'function') { if (typeof closeTimer.unref === 'function') {
closeTimer.unref(); closeTimer.unref();
} }
+6
View File
@@ -460,6 +460,12 @@ export const services = {
"host": "smtp-relay.brevo.com", "host": "smtp-relay.brevo.com",
"port": 587 "port": 587
}, },
"Sendora": {
"description": "Sendora",
"host": "smtp.sendora.se",
"port": 465,
"secure": true
},
"SendPulse": { "SendPulse": {
"description": "SendPulse", "description": "SendPulse",
"host": "smtp-pulse.com", "host": "smtp-pulse.com",
+7
View File
@@ -423,6 +423,13 @@
"port": 587 "port": 587
}, },
"Sendora": {
"description": "Sendora",
"host": "smtp.sendora.se",
"port": 465,
"secure": true
},
"SendPulse": { "SendPulse": {
"description": "SendPulse", "description": "SendPulse",
"host": "smtp-pulse.com", "host": "smtp-pulse.com",
+14 -9
View File
@@ -1,6 +1,6 @@
{ {
"name": "nodemailer", "name": "nodemailer",
"version": "10.5.0", "version": "10.6.1",
"description": "Easy as cake e-mail sending from your Node.js applications", "description": "Easy as cake e-mail sending from your Node.js applications",
"type": "module", "type": "module",
"main": "./dist/cjs/nodemailer.js", "main": "./dist/cjs/nodemailer.js",
@@ -132,6 +132,7 @@
"test:cjs": "NODE_OPTIONS=--no-experimental-require-module node test/package/cjs-smoke.cjs", "test:cjs": "NODE_OPTIONS=--no-experimental-require-module node test/package/cjs-smoke.cjs",
"pretest:bun": "npm run build", "pretest:bun": "npm run build",
"test:bun": "bun test --timeout 60000 $(find ./test \\( -name '*-test.ts' -o -name '*.test.ts' \\))", "test:bun": "bun test --timeout 60000 $(find ./test \\( -name '*-test.ts' -o -name '*.test.ts' \\))",
"fuzz:addressparser": "node --import tsx scripts/fuzz-addressparser.js",
"format": "prettier --write \"**/*.{js,cjs,ts,json,md}\"", "format": "prettier --write \"**/*.{js,cjs,ts,json,md}\"",
"format:check": "prettier --check \"**/*.{js,cjs,ts,json,md}\"", "format:check": "prettier --check \"**/*.{js,cjs,ts,json,md}\"",
"lint": "eslint . && npm run typecheck", "lint": "eslint . && npm run typecheck",
@@ -153,26 +154,30 @@
}, },
"homepage": "https://nodemailer.com/", "homepage": "https://nodemailer.com/",
"devDependencies": { "devDependencies": {
"@aws-sdk/client-sesv2": "3.1165.0", "@aws-sdk/client-sesv2": "3.1173.0",
"@types/node": "20.19.43", "@types/node": "20.19.43",
"bunyan": "1.8.15", "bunyan": "1.8.15",
"c8": "12.0.0", "c8": "12.0.0",
"eslint": "10.14.0", "eslint": "10.15.0",
"eslint-config-prettier": "10.1.8", "eslint-config-prettier": "10.1.8",
"globals": "17.14.0", "globals": "17.14.0",
"libbase64": "1.4.1", "libbase64": "1.4.1",
"libmime": "5.6.4", "libmime": "5.6.5",
"libqp": "3.0.1", "libqp": "3.0.2",
"mailauth": "8.0.4", "mailauth": "8.1.0",
"prettier": "3.9.10", "prettier": "3.10.1",
"proxy": "1.0.2", "proxy": "1.0.2",
"proxy-test-server": "1.0.0", "proxy-test-server": "1.0.0",
"smtp-server": "3.21.3", "smtp-server": "3.21.6",
"tsx": "4.23.15", "tsx": "4.23.15",
"typescript": "6.0.3", "typescript": "6.0.3",
"typescript-eslint": "8.72.2" "typescript-eslint": "8.73.0"
}, },
"engines": { "engines": {
"node": ">=20.0.0" "node": ">=20.0.0"
},
"overrides": {
"glob": "14.0.6",
"minimatch": "11.0.8"
} }
} }