mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2026-11-22 05:25:29 +07:00
node_modules: update
This commit is contained in:
1 parent
0989b5499d
commit
a20949df3b
21 files changed
+129
-34
No files matched your search
+3
@@ -42,6 +42,8 @@ export interface SMTPConnectionOptions {
|
||||
greetingTimeout?: number | undefined;
|
||||
/** Time of inactivity in ms until the connection is closed, defaults to 10 minutes */
|
||||
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 */
|
||||
maxResponseSize?: number | undefined;
|
||||
/** 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)
|
||||
* * **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)
|
||||
* * **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)
|
||||
* * **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
|
||||
|
||||
+11
-3
@@ -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)
|
||||
* * **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)
|
||||
* * **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)
|
||||
* * **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
|
||||
@@ -430,11 +431,18 @@ class SMTPConnection extends EventEmitter {
|
||||
return;
|
||||
}
|
||||
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({
|
||||
tnx: 'smtp'
|
||||
}, '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
|
||||
// can be garbage-collected once the socket is gone.
|
||||
if (this._currentDataStream) {
|
||||
@@ -476,7 +484,7 @@ class SMTPConnection extends EventEmitter {
|
||||
if (closeMethod === 'end') {
|
||||
// end() only closes our side, a server that never closes its own would keep
|
||||
// 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') {
|
||||
closeTimer.unref();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user