apple-mail-mcp 2.20.1 → 2.20.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +495 -351
- package/build/index.js +553 -382
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -7922,7 +7922,7 @@ var init_auditLog = __esm({
|
|
|
7922
7922
|
}
|
|
7923
7923
|
});
|
|
7924
7924
|
|
|
7925
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
7925
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/punycode/index.js
|
|
7926
7926
|
function error2(type) {
|
|
7927
7927
|
throw new RangeError(errors[type]);
|
|
7928
7928
|
}
|
|
@@ -7968,7 +7968,7 @@ function ucs2decode(string3) {
|
|
|
7968
7968
|
}
|
|
7969
7969
|
var maxInt, base, tMin, tMax, skew, damp, initialBias, initialN, delimiter2, regexPunycode, regexNonASCII, regexSeparators, errors, baseMinusTMin, floor, stringFromCharCode, basicToDigit, digitToBasic, adapt, decode, encode, toUnicode, toASCII;
|
|
7970
7970
|
var init_punycode = __esm({
|
|
7971
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
7971
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/punycode/index.js"() {
|
|
7972
7972
|
maxInt = 2147483647;
|
|
7973
7973
|
base = 36;
|
|
7974
7974
|
tMin = 1;
|
|
@@ -8139,7 +8139,7 @@ var init_punycode = __esm({
|
|
|
8139
8139
|
}
|
|
8140
8140
|
});
|
|
8141
8141
|
|
|
8142
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
8142
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/shared/url.js
|
|
8143
8143
|
import net from "node:net";
|
|
8144
8144
|
import urllib from "node:url";
|
|
8145
8145
|
function invalidUrl(input) {
|
|
@@ -8192,7 +8192,7 @@ function normalizeHostname(raw, href) {
|
|
|
8192
8192
|
}
|
|
8193
8193
|
var SLASHLESS_AUTHORITY, SURROUNDING_WHITESPACE, LEGACY_TRIM, AUTHORITY, FORBIDDEN_HOST_CHARS, CONTROL_CHARS, parse3, resolve3;
|
|
8194
8194
|
var init_url = __esm({
|
|
8195
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
8195
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/shared/url.js"() {
|
|
8196
8196
|
init_punycode();
|
|
8197
8197
|
SLASHLESS_AUTHORITY = /^([a-zA-Z][a-zA-Z0-9+.-]*:)(?!\/\/)([\s\S]+)$/;
|
|
8198
8198
|
SURROUNDING_WHITESPACE = /^[\x00-\x20]+|[\x00-\x20]+$/g;
|
|
@@ -8268,11 +8268,11 @@ var init_url = __esm({
|
|
|
8268
8268
|
}
|
|
8269
8269
|
});
|
|
8270
8270
|
|
|
8271
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
8271
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/fetch/cookies.js
|
|
8272
8272
|
import net2 from "node:net";
|
|
8273
|
-
var SESSION_TIMEOUT, Cookies;
|
|
8273
|
+
var SESSION_TIMEOUT, Cookies, cookies_default;
|
|
8274
8274
|
var init_cookies = __esm({
|
|
8275
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
8275
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/fetch/cookies.js"() {
|
|
8276
8276
|
init_url();
|
|
8277
8277
|
SESSION_TIMEOUT = 1800;
|
|
8278
8278
|
Cookies = class {
|
|
@@ -8478,24 +8478,25 @@ var init_cookies = __esm({
|
|
|
8478
8478
|
return path3;
|
|
8479
8479
|
}
|
|
8480
8480
|
};
|
|
8481
|
+
cookies_default = Cookies;
|
|
8481
8482
|
}
|
|
8482
8483
|
});
|
|
8483
8484
|
|
|
8484
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
8485
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/package-info.js
|
|
8485
8486
|
var name, version2, homepage;
|
|
8486
8487
|
var init_package_info = __esm({
|
|
8487
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
8488
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/package-info.js"() {
|
|
8488
8489
|
name = "nodemailer";
|
|
8489
|
-
version2 = "10.0.
|
|
8490
|
+
version2 = "10.0.13";
|
|
8490
8491
|
homepage = "https://nodemailer.com/";
|
|
8491
8492
|
}
|
|
8492
8493
|
});
|
|
8493
8494
|
|
|
8494
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
8495
|
-
var
|
|
8495
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/errors.js
|
|
8496
|
+
var ECONNECTION, ENOAUTH, EOAUTH2, EMAXLIMIT, EMAXRECIPIENTS, ESENDMAIL, ESES, ECONFIG, EPROXY, EFILEACCESS, EURLACCESS, EFETCH;
|
|
8496
8497
|
var init_errors = __esm({
|
|
8497
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
8498
|
-
|
|
8498
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/errors.js"() {
|
|
8499
|
+
ECONNECTION = "ECONNECTION";
|
|
8499
8500
|
ENOAUTH = "ENOAUTH";
|
|
8500
8501
|
EOAUTH2 = "EOAUTH2";
|
|
8501
8502
|
EMAXLIMIT = "EMAXLIMIT";
|
|
@@ -8510,10 +8511,10 @@ var init_errors = __esm({
|
|
|
8510
8511
|
}
|
|
8511
8512
|
});
|
|
8512
8513
|
|
|
8513
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
8514
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/shared/objects.js
|
|
8514
8515
|
var isProtoKey, copyOwnKeys;
|
|
8515
8516
|
var init_objects = __esm({
|
|
8516
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
8517
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/shared/objects.js"() {
|
|
8517
8518
|
isProtoKey = (key) => key === "__proto__";
|
|
8518
8519
|
copyOwnKeys = (target, source, skip) => {
|
|
8519
8520
|
Object.keys(source || {}).forEach((key) => {
|
|
@@ -8527,7 +8528,7 @@ var init_objects = __esm({
|
|
|
8527
8528
|
}
|
|
8528
8529
|
});
|
|
8529
8530
|
|
|
8530
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
8531
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/fetch/index.js
|
|
8531
8532
|
import http from "node:http";
|
|
8532
8533
|
import https from "node:https";
|
|
8533
8534
|
import zlib from "node:zlib";
|
|
@@ -8548,7 +8549,7 @@ function parseFetchUrl(url) {
|
|
|
8548
8549
|
function nmfetch(url, options) {
|
|
8549
8550
|
options = options || {};
|
|
8550
8551
|
options.fetchRes = options.fetchRes || new PassThrough();
|
|
8551
|
-
options.cookies = options.cookies || new
|
|
8552
|
+
options.cookies = options.cookies || new cookies_default();
|
|
8552
8553
|
options.redirects = options.redirects || 0;
|
|
8553
8554
|
options.maxRedirects = isNaN(options.maxRedirects) ? MAX_REDIRECTS : options.maxRedirects;
|
|
8554
8555
|
const fetchRes = options.fetchRes;
|
|
@@ -8622,14 +8623,11 @@ function nmfetch(url, options) {
|
|
|
8622
8623
|
return encodeURIComponent(key) + "=" + encodeURIComponent(value);
|
|
8623
8624
|
}).join("&"));
|
|
8624
8625
|
} catch (E) {
|
|
8625
|
-
if (finished) {
|
|
8626
|
-
return void 0;
|
|
8627
|
-
}
|
|
8628
8626
|
finished = true;
|
|
8629
8627
|
E.code = EFETCH;
|
|
8630
8628
|
E.sourceUrl = url;
|
|
8631
|
-
fetchRes.emit("error", E);
|
|
8632
|
-
return
|
|
8629
|
+
setImmediate(() => fetchRes.emit("error", E));
|
|
8630
|
+
return fetchRes;
|
|
8633
8631
|
}
|
|
8634
8632
|
} else {
|
|
8635
8633
|
body = Buffer.from(options.body.toString().trim());
|
|
@@ -8673,28 +8671,21 @@ function nmfetch(url, options) {
|
|
|
8673
8671
|
});
|
|
8674
8672
|
return fetchRes;
|
|
8675
8673
|
}
|
|
8676
|
-
|
|
8677
|
-
req.setTimeout(options.timeout, () => {
|
|
8678
|
-
if (finished) {
|
|
8679
|
-
return;
|
|
8680
|
-
}
|
|
8681
|
-
finished = true;
|
|
8682
|
-
req.abort();
|
|
8683
|
-
const err = new Error("Request Timeout");
|
|
8684
|
-
err.code = EFETCH;
|
|
8685
|
-
err.sourceUrl = url;
|
|
8686
|
-
fetchRes.emit("error", err);
|
|
8687
|
-
});
|
|
8688
|
-
}
|
|
8689
|
-
req.on("error", (err) => {
|
|
8674
|
+
const fail = (err, sourceUrl = url) => {
|
|
8690
8675
|
if (finished) {
|
|
8691
8676
|
return;
|
|
8692
8677
|
}
|
|
8693
8678
|
finished = true;
|
|
8694
8679
|
err.code = EFETCH;
|
|
8695
|
-
err.sourceUrl =
|
|
8680
|
+
err.sourceUrl = sourceUrl;
|
|
8696
8681
|
fetchRes.emit("error", err);
|
|
8697
|
-
|
|
8682
|
+
req.abort();
|
|
8683
|
+
};
|
|
8684
|
+
const timeout = typeof options.timeout === "number" && options.timeout >= 0 ? options.timeout : DEFAULT_TIMEOUT;
|
|
8685
|
+
if (timeout) {
|
|
8686
|
+
req.setTimeout(timeout, () => fail(new Error("Request Timeout")));
|
|
8687
|
+
}
|
|
8688
|
+
req.on("error", (err) => fail(err));
|
|
8698
8689
|
req.on("response", (res) => {
|
|
8699
8690
|
let inflate;
|
|
8700
8691
|
if (finished) {
|
|
@@ -8714,13 +8705,7 @@ function nmfetch(url, options) {
|
|
|
8714
8705
|
if ([301, 302, 303, 307, 308].includes(res.statusCode) && res.headers.location) {
|
|
8715
8706
|
options.redirects++;
|
|
8716
8707
|
if (options.redirects > options.maxRedirects) {
|
|
8717
|
-
|
|
8718
|
-
const err = new Error("Maximum redirect count exceeded");
|
|
8719
|
-
err.code = EFETCH;
|
|
8720
|
-
err.sourceUrl = url;
|
|
8721
|
-
fetchRes.emit("error", err);
|
|
8722
|
-
req.abort();
|
|
8723
|
-
return;
|
|
8708
|
+
return fail(new Error("Maximum redirect count exceeded"));
|
|
8724
8709
|
}
|
|
8725
8710
|
options.method = "GET";
|
|
8726
8711
|
options.body = false;
|
|
@@ -8732,13 +8717,7 @@ function nmfetch(url, options) {
|
|
|
8732
8717
|
}
|
|
8733
8718
|
const redirectParsed = parseFetchUrl(redirectUrl);
|
|
8734
8719
|
if (!redirectParsed) {
|
|
8735
|
-
|
|
8736
|
-
const err = new Error("Unsupported protocol for URL " + redirectUrl);
|
|
8737
|
-
err.code = EFETCH;
|
|
8738
|
-
err.sourceUrl = redirectUrl;
|
|
8739
|
-
fetchRes.emit("error", err);
|
|
8740
|
-
req.abort();
|
|
8741
|
-
return;
|
|
8720
|
+
return fail(new Error("Unsupported protocol for URL " + redirectUrl), redirectUrl);
|
|
8742
8721
|
}
|
|
8743
8722
|
const crossHost = redirectParsed.hostname !== parsed.hostname;
|
|
8744
8723
|
const downgrade = parsed.protocol === "https:" && redirectParsed.protocol === "http:";
|
|
@@ -8750,41 +8729,31 @@ function nmfetch(url, options) {
|
|
|
8750
8729
|
}
|
|
8751
8730
|
});
|
|
8752
8731
|
}
|
|
8732
|
+
finished = true;
|
|
8733
|
+
res.resume();
|
|
8734
|
+
req.abort();
|
|
8753
8735
|
return nmfetch(redirectUrl, options);
|
|
8754
8736
|
}
|
|
8755
8737
|
fetchRes.statusCode = res.statusCode;
|
|
8756
8738
|
fetchRes.headers = res.headers;
|
|
8757
8739
|
if (res.statusCode >= 300 && !options.allowErrorResponse) {
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
|
|
8761
|
-
|
|
8762
|
-
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
if (finished) {
|
|
8740
|
+
return fail(new Error("Invalid status code " + res.statusCode));
|
|
8741
|
+
}
|
|
8742
|
+
res.on("error", (err) => fail(err));
|
|
8743
|
+
const maxBytes = typeof options.maxBytes === "number" && options.maxBytes > 0 ? options.maxBytes : DEFAULT_MAX_BYTES;
|
|
8744
|
+
const source = inflate || res;
|
|
8745
|
+
let received = 0;
|
|
8746
|
+
source.on("data", (chunk) => {
|
|
8747
|
+
received += chunk.length;
|
|
8748
|
+
if (received <= maxBytes || finished) {
|
|
8768
8749
|
return;
|
|
8769
8750
|
}
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
err.sourceUrl = url;
|
|
8773
|
-
fetchRes.emit("error", err);
|
|
8774
|
-
req.abort();
|
|
8751
|
+
source.unpipe(fetchRes);
|
|
8752
|
+
fail(new Error("Response size exceeds the allowed " + maxBytes + " bytes"));
|
|
8775
8753
|
});
|
|
8776
8754
|
if (inflate) {
|
|
8777
8755
|
res.pipe(inflate).pipe(fetchRes);
|
|
8778
|
-
inflate.on("error", (err) =>
|
|
8779
|
-
if (finished) {
|
|
8780
|
-
return;
|
|
8781
|
-
}
|
|
8782
|
-
finished = true;
|
|
8783
|
-
err.code = EFETCH;
|
|
8784
|
-
err.sourceUrl = url;
|
|
8785
|
-
fetchRes.emit("error", err);
|
|
8786
|
-
req.abort();
|
|
8787
|
-
});
|
|
8756
|
+
inflate.on("error", (err) => fail(err));
|
|
8788
8757
|
} else {
|
|
8789
8758
|
res.pipe(fetchRes);
|
|
8790
8759
|
}
|
|
@@ -8797,26 +8766,24 @@ function nmfetch(url, options) {
|
|
|
8797
8766
|
}
|
|
8798
8767
|
req.write(body);
|
|
8799
8768
|
} catch (err) {
|
|
8800
|
-
|
|
8801
|
-
err.code = EFETCH;
|
|
8802
|
-
err.sourceUrl = url;
|
|
8803
|
-
fetchRes.emit("error", err);
|
|
8804
|
-
return;
|
|
8769
|
+
return fail(err);
|
|
8805
8770
|
}
|
|
8806
8771
|
}
|
|
8807
8772
|
req.end();
|
|
8808
8773
|
});
|
|
8809
8774
|
return fetchRes;
|
|
8810
8775
|
}
|
|
8811
|
-
var MAX_REDIRECTS, TLS_OPTION_KEYS, fetch_default;
|
|
8776
|
+
var MAX_REDIRECTS, DEFAULT_TIMEOUT, DEFAULT_MAX_BYTES, TLS_OPTION_KEYS, fetch_default;
|
|
8812
8777
|
var init_fetch = __esm({
|
|
8813
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
8778
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/fetch/index.js"() {
|
|
8814
8779
|
init_url();
|
|
8815
8780
|
init_cookies();
|
|
8816
8781
|
init_package_info();
|
|
8817
8782
|
init_errors();
|
|
8818
8783
|
init_objects();
|
|
8819
8784
|
MAX_REDIRECTS = 5;
|
|
8785
|
+
DEFAULT_TIMEOUT = 60 * 1e3;
|
|
8786
|
+
DEFAULT_MAX_BYTES = 64 * 1024 * 1024;
|
|
8820
8787
|
TLS_OPTION_KEYS = [
|
|
8821
8788
|
"ALPNProtocols",
|
|
8822
8789
|
"ca",
|
|
@@ -8840,12 +8807,13 @@ var init_fetch = __esm({
|
|
|
8840
8807
|
"sessionIdContext",
|
|
8841
8808
|
"sigalgs"
|
|
8842
8809
|
];
|
|
8843
|
-
nmfetch.Cookies =
|
|
8810
|
+
nmfetch.Cookies = cookies_default;
|
|
8811
|
+
nmfetch.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT;
|
|
8844
8812
|
fetch_default = nmfetch;
|
|
8845
8813
|
}
|
|
8846
8814
|
});
|
|
8847
8815
|
|
|
8848
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
8816
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/shared/index.js
|
|
8849
8817
|
import util2 from "node:util";
|
|
8850
8818
|
import fs from "node:fs";
|
|
8851
8819
|
import dns from "node:dns";
|
|
@@ -8986,7 +8954,7 @@ function createDefaultLogger(levels) {
|
|
|
8986
8954
|
}
|
|
8987
8955
|
var DNS_TTL, CACHE_CLEANUP_INTERVAL, MAX_CACHE_SIZE, lastCacheCleanup, networkInterfaces, isFamilySupported, resolve4, dnsCache, formatDNSValue, resolveHostname, parseConnectionUrl, _logFunc, getLogger, callbackPromise, parseDataURI, assign, encodeXText;
|
|
8988
8956
|
var init_shared = __esm({
|
|
8989
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
8957
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/shared/index.js"() {
|
|
8990
8958
|
init_url();
|
|
8991
8959
|
init_fetch();
|
|
8992
8960
|
init_errors();
|
|
@@ -9260,8 +9228,9 @@ var init_shared = __esm({
|
|
|
9260
9228
|
}
|
|
9261
9229
|
const logger = options.logger === true ? createDefaultLogger(levels) : options.logger;
|
|
9262
9230
|
levels.forEach((level) => {
|
|
9263
|
-
response[level] = (
|
|
9264
|
-
|
|
9231
|
+
response[level] = (...args) => {
|
|
9232
|
+
const data = typeof args[0] === "string" ? void 0 : args.shift();
|
|
9233
|
+
_logFunc(logger, level, defaults, data, ...args);
|
|
9265
9234
|
};
|
|
9266
9235
|
});
|
|
9267
9236
|
return response;
|
|
@@ -9365,7 +9334,7 @@ var init_shared = __esm({
|
|
|
9365
9334
|
}
|
|
9366
9335
|
});
|
|
9367
9336
|
|
|
9368
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
9337
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-funcs/mime-types.js
|
|
9369
9338
|
import path from "node:path";
|
|
9370
9339
|
function detectMimeType(filename) {
|
|
9371
9340
|
if (!filename) {
|
|
@@ -9402,7 +9371,7 @@ function detectExtension(mimeType) {
|
|
|
9402
9371
|
}
|
|
9403
9372
|
var defaultMimeType, defaultExtension, mimeTypes, extensions;
|
|
9404
9373
|
var init_mime_types = __esm({
|
|
9405
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
9374
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-funcs/mime-types.js"() {
|
|
9406
9375
|
defaultMimeType = "application/octet-stream";
|
|
9407
9376
|
defaultExtension = "bin";
|
|
9408
9377
|
mimeTypes = /* @__PURE__ */ new Map([
|
|
@@ -11467,7 +11436,7 @@ var init_mime_types = __esm({
|
|
|
11467
11436
|
}
|
|
11468
11437
|
});
|
|
11469
11438
|
|
|
11470
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
11439
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/base64/index.js
|
|
11471
11440
|
var base64_exports = {};
|
|
11472
11441
|
__export(base64_exports, {
|
|
11473
11442
|
Encoder: () => Encoder,
|
|
@@ -11483,7 +11452,7 @@ function encode2(buffer) {
|
|
|
11483
11452
|
}
|
|
11484
11453
|
function wrap(str2, lineLength) {
|
|
11485
11454
|
str2 = (str2 || "").toString();
|
|
11486
|
-
lineLength = lineLength || 76;
|
|
11455
|
+
lineLength = Math.max(Number(lineLength) || 76, 1);
|
|
11487
11456
|
if (str2.length <= lineLength) {
|
|
11488
11457
|
return str2;
|
|
11489
11458
|
}
|
|
@@ -11500,7 +11469,7 @@ function wrap(str2, lineLength) {
|
|
|
11500
11469
|
}
|
|
11501
11470
|
var Encoder;
|
|
11502
11471
|
var init_base64 = __esm({
|
|
11503
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
11472
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/base64/index.js"() {
|
|
11504
11473
|
Encoder = class extends Transform {
|
|
11505
11474
|
constructor(options) {
|
|
11506
11475
|
super();
|
|
@@ -11568,7 +11537,7 @@ var init_base64 = __esm({
|
|
|
11568
11537
|
}
|
|
11569
11538
|
});
|
|
11570
11539
|
|
|
11571
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
11540
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/qp/index.js
|
|
11572
11541
|
var qp_exports = {};
|
|
11573
11542
|
__export(qp_exports, {
|
|
11574
11543
|
Encoder: () => Encoder2,
|
|
@@ -11594,7 +11563,7 @@ function encode3(buffer) {
|
|
|
11594
11563
|
}
|
|
11595
11564
|
function wrap2(str2, lineLength) {
|
|
11596
11565
|
str2 = (str2 || "").toString();
|
|
11597
|
-
lineLength = lineLength || 76;
|
|
11566
|
+
lineLength = Math.max(Number(lineLength) || 76, MIN_LINE_LENGTH);
|
|
11598
11567
|
if (str2.length <= lineLength) {
|
|
11599
11568
|
return str2;
|
|
11600
11569
|
}
|
|
@@ -11639,6 +11608,9 @@ function wrap2(str2, lineLength) {
|
|
|
11639
11608
|
}
|
|
11640
11609
|
}
|
|
11641
11610
|
}
|
|
11611
|
+
if (!line.length) {
|
|
11612
|
+
line = str2.substr(pos, lineLength);
|
|
11613
|
+
}
|
|
11642
11614
|
if (pos + line.length < len && line.substr(-1) !== "\n") {
|
|
11643
11615
|
if (line.length === lineLength && line.match(/[=][\da-f]{2}$/i)) {
|
|
11644
11616
|
line = line.substr(0, line.length - 3);
|
|
@@ -11669,9 +11641,10 @@ function checkRanges(nr, ranges) {
|
|
|
11669
11641
|
}
|
|
11670
11642
|
return false;
|
|
11671
11643
|
}
|
|
11672
|
-
var QP_RANGES, Encoder2;
|
|
11644
|
+
var MIN_LINE_LENGTH, QP_RANGES, Encoder2;
|
|
11673
11645
|
var init_qp = __esm({
|
|
11674
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
11646
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/qp/index.js"() {
|
|
11647
|
+
MIN_LINE_LENGTH = 4;
|
|
11675
11648
|
QP_RANGES = [
|
|
11676
11649
|
[9],
|
|
11677
11650
|
// <TAB>
|
|
@@ -11735,7 +11708,7 @@ var init_qp = __esm({
|
|
|
11735
11708
|
}
|
|
11736
11709
|
});
|
|
11737
11710
|
|
|
11738
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
11711
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-funcs/index.js
|
|
11739
11712
|
function isPlainText(value, isParam) {
|
|
11740
11713
|
const re = isParam ? /[\x00-\x1f\x7f"\u0080-\uFFFF]/ : /[\x00-\x08\x0b\x0c\x0e-\x1f\u0080-\uFFFF]/;
|
|
11741
11714
|
return typeof value === "string" && !re.test(value);
|
|
@@ -11943,7 +11916,7 @@ function buildHeaderParam(key, data, maxLength) {
|
|
|
11943
11916
|
}
|
|
11944
11917
|
function parseHeaderValue(str2) {
|
|
11945
11918
|
const response = {
|
|
11946
|
-
value:
|
|
11919
|
+
value: "",
|
|
11947
11920
|
params: {}
|
|
11948
11921
|
};
|
|
11949
11922
|
const setParam = (name2, value2) => {
|
|
@@ -12134,7 +12107,7 @@ function safeEncodeURIComponent(str2) {
|
|
|
12134
12107
|
return str2.replace(/[\x00-\x1F *'()<>@,;:\\"[\]?=\u007F-\uFFFF]/g, (chr) => encodeURICharComponent(chr));
|
|
12135
12108
|
}
|
|
12136
12109
|
var init_mime_funcs = __esm({
|
|
12137
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
12110
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-funcs/index.js"() {
|
|
12138
12111
|
init_base64();
|
|
12139
12112
|
init_qp();
|
|
12140
12113
|
init_mime_types();
|
|
@@ -12142,7 +12115,7 @@ var init_mime_funcs = __esm({
|
|
|
12142
12115
|
}
|
|
12143
12116
|
});
|
|
12144
12117
|
|
|
12145
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
12118
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/addressparser/index.js
|
|
12146
12119
|
function _quoteLocalPart(address) {
|
|
12147
12120
|
const lastAt = address.lastIndexOf("@");
|
|
12148
12121
|
if (lastAt < 0) {
|
|
@@ -12250,6 +12223,58 @@ function _recoverAddrSpec(data) {
|
|
|
12250
12223
|
data.address = address;
|
|
12251
12224
|
data.text = [data.text].concat(rest).filter((part) => part).join(" ");
|
|
12252
12225
|
}
|
|
12226
|
+
function _stripAddressComments(address) {
|
|
12227
|
+
const comments = [];
|
|
12228
|
+
let result = "";
|
|
12229
|
+
let comment = "";
|
|
12230
|
+
let depth = 0;
|
|
12231
|
+
let closer = "";
|
|
12232
|
+
let lastChar = "";
|
|
12233
|
+
for (let i = 0, len = address.length; i < len; i++) {
|
|
12234
|
+
const chr = address.charAt(i);
|
|
12235
|
+
if (depth) {
|
|
12236
|
+
if (chr === "\\" && i < len - 1) {
|
|
12237
|
+
comment += address.charAt(++i);
|
|
12238
|
+
} else if (chr === "(") {
|
|
12239
|
+
depth++;
|
|
12240
|
+
comment += chr;
|
|
12241
|
+
} else if (chr === ")" && !--depth) {
|
|
12242
|
+
comments.push(comment.trim());
|
|
12243
|
+
comment = "";
|
|
12244
|
+
if (lastChar !== "@" && address.charAt(i + 1) !== "@") {
|
|
12245
|
+
result += " ";
|
|
12246
|
+
lastChar = " ";
|
|
12247
|
+
}
|
|
12248
|
+
} else {
|
|
12249
|
+
comment += chr;
|
|
12250
|
+
}
|
|
12251
|
+
continue;
|
|
12252
|
+
}
|
|
12253
|
+
if (closer) {
|
|
12254
|
+
if (chr === "\\" && closer === '"' && i < len - 1) {
|
|
12255
|
+
result += chr + address.charAt(++i);
|
|
12256
|
+
lastChar = address.charAt(i);
|
|
12257
|
+
continue;
|
|
12258
|
+
}
|
|
12259
|
+
if (chr === closer) {
|
|
12260
|
+
closer = "";
|
|
12261
|
+
}
|
|
12262
|
+
} else if (chr === '"') {
|
|
12263
|
+
closer = '"';
|
|
12264
|
+
} else if (chr === "[") {
|
|
12265
|
+
closer = "]";
|
|
12266
|
+
} else if (chr === "(") {
|
|
12267
|
+
depth = 1;
|
|
12268
|
+
continue;
|
|
12269
|
+
}
|
|
12270
|
+
result += chr;
|
|
12271
|
+
lastChar = chr;
|
|
12272
|
+
}
|
|
12273
|
+
if (depth) {
|
|
12274
|
+
comments.push(comment.trim());
|
|
12275
|
+
}
|
|
12276
|
+
return { address: result.trim(), comments: comments.filter((text) => text) };
|
|
12277
|
+
}
|
|
12253
12278
|
function _handleAddress(tokens, depth) {
|
|
12254
12279
|
let isGroup = false;
|
|
12255
12280
|
let state = "text";
|
|
@@ -12337,6 +12362,22 @@ function _handleAddress(tokens, depth) {
|
|
|
12337
12362
|
group: groupMembers
|
|
12338
12363
|
});
|
|
12339
12364
|
} else {
|
|
12365
|
+
const addressComments = [];
|
|
12366
|
+
const addressParts = [];
|
|
12367
|
+
for (const part of data.address) {
|
|
12368
|
+
if (part.indexOf("(") < 0) {
|
|
12369
|
+
addressParts.push(part);
|
|
12370
|
+
continue;
|
|
12371
|
+
}
|
|
12372
|
+
const stripped = _stripAddressComments(part);
|
|
12373
|
+
for (const comment of stripped.comments) {
|
|
12374
|
+
addressComments.push(comment);
|
|
12375
|
+
}
|
|
12376
|
+
if (stripped.address) {
|
|
12377
|
+
addressParts.push(stripped.address);
|
|
12378
|
+
}
|
|
12379
|
+
}
|
|
12380
|
+
data.address = addressParts;
|
|
12340
12381
|
if (!data.address.length && data.text.length) {
|
|
12341
12382
|
for (let i = data.text.length - 1; i >= 0; i--) {
|
|
12342
12383
|
if (!data.textWasQuoted[i] && ADDR_SPEC.test(data.text[i])) {
|
|
@@ -12384,6 +12425,9 @@ function _handleAddress(tokens, depth) {
|
|
|
12384
12425
|
data.text = "";
|
|
12385
12426
|
}
|
|
12386
12427
|
_recoverAddrSpec(data);
|
|
12428
|
+
if (!data.text && addressComments.length) {
|
|
12429
|
+
data.text = addressComments.join(" ");
|
|
12430
|
+
}
|
|
12387
12431
|
const address = {
|
|
12388
12432
|
address: data.address || data.text || "",
|
|
12389
12433
|
name: data.text || data.address || ""
|
|
@@ -12456,9 +12500,9 @@ function addressparser(str2, options) {
|
|
|
12456
12500
|
}
|
|
12457
12501
|
return parsedAddresses;
|
|
12458
12502
|
}
|
|
12459
|
-
var HAS_WHITESPACE, QUOTED_LOCAL_ADDR, ADDR_SPEC, LOOSE_ADDR_SPEC, LOOSE_TEXT_ADDR, Tokenizer, MAX_NESTED_GROUP_DEPTH;
|
|
12503
|
+
var HAS_WHITESPACE, QUOTED_LOCAL_ADDR, ADDR_SPEC, LOOSE_ADDR_SPEC, LOOSE_TEXT_ADDR, Tokenizer, MAX_NESTED_GROUP_DEPTH, addressparser_default;
|
|
12460
12504
|
var init_addressparser = __esm({
|
|
12461
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
12505
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/addressparser/index.js"() {
|
|
12462
12506
|
HAS_WHITESPACE = /\s/;
|
|
12463
12507
|
QUOTED_LOCAL_ADDR = /^("(?:[^"\\]|\\[\s\S])*"@\S+)(?:\s+([\s\S]+))?$/;
|
|
12464
12508
|
ADDR_SPEC = /^[^@\s]+@[^@\s]+$/;
|
|
@@ -12566,14 +12610,15 @@ var init_addressparser = __esm({
|
|
|
12566
12610
|
}
|
|
12567
12611
|
};
|
|
12568
12612
|
MAX_NESTED_GROUP_DEPTH = 50;
|
|
12613
|
+
addressparser_default = addressparser;
|
|
12569
12614
|
}
|
|
12570
12615
|
});
|
|
12571
12616
|
|
|
12572
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
12617
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-node/last-newline.js
|
|
12573
12618
|
import { Transform as Transform3 } from "node:stream";
|
|
12574
12619
|
var LastNewline;
|
|
12575
12620
|
var init_last_newline = __esm({
|
|
12576
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
12621
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-node/last-newline.js"() {
|
|
12577
12622
|
LastNewline = class extends Transform3 {
|
|
12578
12623
|
constructor() {
|
|
12579
12624
|
super();
|
|
@@ -12603,11 +12648,11 @@ var init_last_newline = __esm({
|
|
|
12603
12648
|
}
|
|
12604
12649
|
});
|
|
12605
12650
|
|
|
12606
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
12651
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-node/le-windows.js
|
|
12607
12652
|
import { Transform as Transform4 } from "node:stream";
|
|
12608
12653
|
var LeWindows;
|
|
12609
12654
|
var init_le_windows = __esm({
|
|
12610
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
12655
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-node/le-windows.js"() {
|
|
12611
12656
|
LeWindows = class extends Transform4 {
|
|
12612
12657
|
constructor(options) {
|
|
12613
12658
|
super(options);
|
|
@@ -12645,11 +12690,11 @@ var init_le_windows = __esm({
|
|
|
12645
12690
|
}
|
|
12646
12691
|
});
|
|
12647
12692
|
|
|
12648
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
12693
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-node/le-unix.js
|
|
12649
12694
|
import { Transform as Transform5 } from "node:stream";
|
|
12650
12695
|
var LeUnix;
|
|
12651
12696
|
var init_le_unix = __esm({
|
|
12652
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
12697
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-node/le-unix.js"() {
|
|
12653
12698
|
LeUnix = class extends Transform5 {
|
|
12654
12699
|
constructor(options) {
|
|
12655
12700
|
super(options);
|
|
@@ -12680,7 +12725,7 @@ var init_le_unix = __esm({
|
|
|
12680
12725
|
}
|
|
12681
12726
|
});
|
|
12682
12727
|
|
|
12683
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
12728
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-node/index.js
|
|
12684
12729
|
import crypto from "node:crypto";
|
|
12685
12730
|
import fs2 from "node:fs";
|
|
12686
12731
|
import { PassThrough as PassThrough2 } from "node:stream";
|
|
@@ -12700,7 +12745,7 @@ function _stripBoundaryControls(value) {
|
|
|
12700
12745
|
}
|
|
12701
12746
|
var FORMATTED_HEADERS, ATEXT, DOT_ATOM, QUOTED_STRING, PLAIN_ADDRESS, URL_PARSER_UNSAFE, MimeNode, mime_node_default;
|
|
12702
12747
|
var init_mime_node = __esm({
|
|
12703
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
12748
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-node/index.js"() {
|
|
12704
12749
|
init_punycode();
|
|
12705
12750
|
init_shared();
|
|
12706
12751
|
init_mime_funcs();
|
|
@@ -13517,7 +13562,7 @@ var init_mime_node = __esm({
|
|
|
13517
13562
|
flattened.push(copy);
|
|
13518
13563
|
continue;
|
|
13519
13564
|
}
|
|
13520
|
-
const parsed = this._normalizeParsedAddresses(
|
|
13565
|
+
const parsed = this._normalizeParsedAddresses(addressparser_default(address));
|
|
13521
13566
|
for (let i = 0; i < parsed.length; i++) {
|
|
13522
13567
|
flattened.push(parsed[i]);
|
|
13523
13568
|
}
|
|
@@ -13827,14 +13872,14 @@ var init_mime_node = __esm({
|
|
|
13827
13872
|
}
|
|
13828
13873
|
});
|
|
13829
13874
|
|
|
13830
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
13875
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mail-composer/index.js
|
|
13831
13876
|
function isContentObject(value) {
|
|
13832
13877
|
const content = value;
|
|
13833
13878
|
return typeof value === "object" && !!(content.content || content.path || content.href || content.raw);
|
|
13834
13879
|
}
|
|
13835
13880
|
var MailComposer, mail_composer_default;
|
|
13836
13881
|
var init_mail_composer = __esm({
|
|
13837
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
13882
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mail-composer/index.js"() {
|
|
13838
13883
|
init_mime_node();
|
|
13839
13884
|
init_mime_funcs();
|
|
13840
13885
|
init_shared();
|
|
@@ -14321,11 +14366,11 @@ var init_mail_composer = __esm({
|
|
|
14321
14366
|
}
|
|
14322
14367
|
});
|
|
14323
14368
|
|
|
14324
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
14369
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/dkim/message-parser.js
|
|
14325
14370
|
import { Transform as Transform6 } from "node:stream";
|
|
14326
|
-
var MessageParser;
|
|
14371
|
+
var MessageParser, message_parser_default;
|
|
14327
14372
|
var init_message_parser = __esm({
|
|
14328
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
14373
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/dkim/message-parser.js"() {
|
|
14329
14374
|
MessageParser = class extends Transform6 {
|
|
14330
14375
|
constructor(options) {
|
|
14331
14376
|
super(options);
|
|
@@ -14449,15 +14494,16 @@ var init_message_parser = __esm({
|
|
|
14449
14494
|
}));
|
|
14450
14495
|
}
|
|
14451
14496
|
};
|
|
14497
|
+
message_parser_default = MessageParser;
|
|
14452
14498
|
}
|
|
14453
14499
|
});
|
|
14454
14500
|
|
|
14455
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
14501
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/dkim/relaxed-body.js
|
|
14456
14502
|
import { Transform as Transform7 } from "node:stream";
|
|
14457
14503
|
import crypto2 from "node:crypto";
|
|
14458
|
-
var CHAR_CR, CHAR_LF, CHAR_SPACE, CHAR_TAB, CRLF, EMPTY_LINES, RelaxedBody;
|
|
14504
|
+
var CHAR_CR, CHAR_LF, CHAR_SPACE, CHAR_TAB, CRLF, EMPTY_LINES, RelaxedBody, relaxed_body_default;
|
|
14459
14505
|
var init_relaxed_body = __esm({
|
|
14460
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
14506
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/dkim/relaxed-body.js"() {
|
|
14461
14507
|
CHAR_CR = 13;
|
|
14462
14508
|
CHAR_LF = 10;
|
|
14463
14509
|
CHAR_SPACE = 32;
|
|
@@ -14575,11 +14621,17 @@ var init_relaxed_body = __esm({
|
|
|
14575
14621
|
callback();
|
|
14576
14622
|
}
|
|
14577
14623
|
};
|
|
14624
|
+
relaxed_body_default = RelaxedBody;
|
|
14578
14625
|
}
|
|
14579
14626
|
});
|
|
14580
14627
|
|
|
14581
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
14628
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/dkim/sign.js
|
|
14582
14629
|
import crypto3 from "node:crypto";
|
|
14630
|
+
function unsupportedHashAlgoError(hashAlgo) {
|
|
14631
|
+
const err = new Error('Unsupported DKIM hash algorithm "' + hashAlgo + '"');
|
|
14632
|
+
err.code = ECONFIG;
|
|
14633
|
+
return err;
|
|
14634
|
+
}
|
|
14583
14635
|
function sign(headers, hashAlgo, bodyHash, options) {
|
|
14584
14636
|
options = options || {};
|
|
14585
14637
|
const defaultFieldNames = "From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive";
|
|
@@ -14587,7 +14639,12 @@ function sign(headers, hashAlgo, bodyHash, options) {
|
|
|
14587
14639
|
const canonicalizedHeaderData = relaxedHeaders(headers, fieldNames, options.skipFields);
|
|
14588
14640
|
const dkimHeader = generateDKIMHeader(options.domainName, options.keySelector, canonicalizedHeaderData.fieldNames, hashAlgo, bodyHash);
|
|
14589
14641
|
canonicalizedHeaderData.headers += "dkim-signature:" + relaxedHeaderLine(dkimHeader);
|
|
14590
|
-
|
|
14642
|
+
let signer;
|
|
14643
|
+
try {
|
|
14644
|
+
signer = crypto3.createSign(("rsa-" + hashAlgo).toUpperCase());
|
|
14645
|
+
} catch (_E) {
|
|
14646
|
+
throw unsupportedHashAlgoError(hashAlgo);
|
|
14647
|
+
}
|
|
14591
14648
|
signer.update(canonicalizedHeaderData.headers, "latin1");
|
|
14592
14649
|
let signature;
|
|
14593
14650
|
try {
|
|
@@ -14645,22 +14702,24 @@ function relaxedHeaderLine(line) {
|
|
|
14645
14702
|
}
|
|
14646
14703
|
var sign_default;
|
|
14647
14704
|
var init_sign = __esm({
|
|
14648
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
14705
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/dkim/sign.js"() {
|
|
14649
14706
|
init_punycode();
|
|
14650
14707
|
init_mime_funcs();
|
|
14708
|
+
init_errors();
|
|
14651
14709
|
sign.relaxedHeaders = relaxedHeaders;
|
|
14710
|
+
sign.unsupportedHashAlgoError = unsupportedHashAlgoError;
|
|
14652
14711
|
sign_default = sign;
|
|
14653
14712
|
}
|
|
14654
14713
|
});
|
|
14655
14714
|
|
|
14656
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
14715
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/dkim/index.js
|
|
14657
14716
|
import { PassThrough as PassThrough3 } from "node:stream";
|
|
14658
14717
|
import fs3 from "node:fs";
|
|
14659
14718
|
import path2 from "node:path";
|
|
14660
14719
|
import crypto4 from "node:crypto";
|
|
14661
14720
|
var DKIM_ALGO, MAX_MESSAGE_SIZE, DKIMSigner, DKIM, dkim_default;
|
|
14662
14721
|
var init_dkim = __esm({
|
|
14663
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
14722
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/dkim/index.js"() {
|
|
14664
14723
|
init_message_parser();
|
|
14665
14724
|
init_relaxed_body();
|
|
14666
14725
|
init_sign();
|
|
@@ -14739,13 +14798,21 @@ var init_dkim = __esm({
|
|
|
14739
14798
|
return;
|
|
14740
14799
|
}
|
|
14741
14800
|
const key = this.keys[keyPos++];
|
|
14742
|
-
|
|
14743
|
-
|
|
14744
|
-
|
|
14745
|
-
|
|
14746
|
-
|
|
14747
|
-
|
|
14748
|
-
|
|
14801
|
+
let dkimField;
|
|
14802
|
+
try {
|
|
14803
|
+
dkimField = sign_default(this.headers, this.hashAlgo, this.bodyHash, {
|
|
14804
|
+
domainName: key.domainName,
|
|
14805
|
+
keySelector: key.keySelector,
|
|
14806
|
+
privateKey: key.privateKey,
|
|
14807
|
+
headerFieldNames: this.options.headerFieldNames,
|
|
14808
|
+
skipFields: this.options.skipFields
|
|
14809
|
+
});
|
|
14810
|
+
} catch (err) {
|
|
14811
|
+
this.hasErrored = true;
|
|
14812
|
+
this.cleanup();
|
|
14813
|
+
this.output.emit("error", err);
|
|
14814
|
+
return;
|
|
14815
|
+
}
|
|
14749
14816
|
if (dkimField) {
|
|
14750
14817
|
this.output.write(Buffer.from(dkimField + "\r\n"));
|
|
14751
14818
|
}
|
|
@@ -14777,8 +14844,8 @@ var init_dkim = __esm({
|
|
|
14777
14844
|
this.relaxedBody.pipe(this.cache);
|
|
14778
14845
|
}
|
|
14779
14846
|
signStream() {
|
|
14780
|
-
this.parser = new
|
|
14781
|
-
this.relaxedBody = new
|
|
14847
|
+
this.parser = new message_parser_default();
|
|
14848
|
+
this.relaxedBody = new relaxed_body_default({
|
|
14782
14849
|
hashAlgo: this.hashAlgo
|
|
14783
14850
|
});
|
|
14784
14851
|
this.parser.on("headers", (value) => {
|
|
@@ -14837,7 +14904,12 @@ var init_dkim = __esm({
|
|
|
14837
14904
|
}
|
|
14838
14905
|
const signer = new DKIMSigner(options, this.keys, inputStream, output);
|
|
14839
14906
|
setImmediate(() => {
|
|
14840
|
-
|
|
14907
|
+
try {
|
|
14908
|
+
signer.signStream();
|
|
14909
|
+
} catch (_E) {
|
|
14910
|
+
output.emit("error", sign_default.unsupportedHashAlgoError(signer.hashAlgo));
|
|
14911
|
+
return;
|
|
14912
|
+
}
|
|
14841
14913
|
if (writeValue) {
|
|
14842
14914
|
setImmediate(() => {
|
|
14843
14915
|
inputStream.end(writeValue);
|
|
@@ -14851,7 +14923,7 @@ var init_dkim = __esm({
|
|
|
14851
14923
|
}
|
|
14852
14924
|
});
|
|
14853
14925
|
|
|
14854
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
14926
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-connection/http-proxy-client.js
|
|
14855
14927
|
import net5 from "node:net";
|
|
14856
14928
|
import tls from "node:tls";
|
|
14857
14929
|
function httpProxyClient(proxyUrl, destinationPort, destinationHost, tlsOptions, callback) {
|
|
@@ -14860,11 +14932,12 @@ function httpProxyClient(proxyUrl, destinationPort, destinationHost, tlsOptions,
|
|
|
14860
14932
|
tlsOptions = {};
|
|
14861
14933
|
}
|
|
14862
14934
|
tlsOptions = tlsOptions || {};
|
|
14935
|
+
const done = callback;
|
|
14863
14936
|
destinationPort = Number(destinationPort) || 0;
|
|
14864
14937
|
if (!destinationPort || /[\r\n]/.test(destinationHost)) {
|
|
14865
14938
|
const err = new Error("Invalid proxy destination");
|
|
14866
14939
|
err.code = EPROXY;
|
|
14867
|
-
setImmediate(() =>
|
|
14940
|
+
setImmediate(() => done(err));
|
|
14868
14941
|
return;
|
|
14869
14942
|
}
|
|
14870
14943
|
const proxy = parse3(proxyUrl);
|
|
@@ -14890,7 +14963,7 @@ function httpProxyClient(proxyUrl, destinationPort, destinationHost, tlsOptions,
|
|
|
14890
14963
|
socket.destroy();
|
|
14891
14964
|
} catch (_E) {
|
|
14892
14965
|
}
|
|
14893
|
-
|
|
14966
|
+
done(err);
|
|
14894
14967
|
};
|
|
14895
14968
|
const timeoutErr = () => {
|
|
14896
14969
|
const err = new Error("Proxy socket timed out");
|
|
@@ -14938,12 +15011,12 @@ function httpProxyClient(proxyUrl, destinationPort, destinationHost, tlsOptions,
|
|
|
14938
15011
|
}
|
|
14939
15012
|
const err = new Error("Invalid response from proxy" + (match && ": " + match[1] || ""));
|
|
14940
15013
|
err.code = EPROXY;
|
|
14941
|
-
return
|
|
15014
|
+
return done(err);
|
|
14942
15015
|
}
|
|
14943
15016
|
socket.removeListener("error", tempSocketErr);
|
|
14944
15017
|
socket.removeListener("timeout", timeoutErr);
|
|
14945
15018
|
socket.setTimeout(0);
|
|
14946
|
-
return
|
|
15019
|
+
return done(null, socket);
|
|
14947
15020
|
}
|
|
14948
15021
|
if (headers.length > MAX_RESPONSE_HEADER_BYTES) {
|
|
14949
15022
|
socket.removeListener("data", onSocketData);
|
|
@@ -14960,7 +15033,7 @@ function httpProxyClient(proxyUrl, destinationPort, destinationHost, tlsOptions,
|
|
|
14960
15033
|
}
|
|
14961
15034
|
var MAX_RESPONSE_HEADER_BYTES, http_proxy_client_default;
|
|
14962
15035
|
var init_http_proxy_client = __esm({
|
|
14963
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
15036
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-connection/http-proxy-client.js"() {
|
|
14964
15037
|
init_url();
|
|
14965
15038
|
init_errors();
|
|
14966
15039
|
MAX_RESPONSE_HEADER_BYTES = 64 * 1024;
|
|
@@ -14968,10 +15041,10 @@ var init_http_proxy_client = __esm({
|
|
|
14968
15041
|
}
|
|
14969
15042
|
});
|
|
14970
15043
|
|
|
14971
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
15044
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mailer/mail-message.js
|
|
14972
15045
|
var hasOwn, MailMessage;
|
|
14973
15046
|
var init_mail_message = __esm({
|
|
14974
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
15047
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mailer/mail-message.js"() {
|
|
14975
15048
|
init_shared();
|
|
14976
15049
|
init_mime_node();
|
|
14977
15050
|
init_mime_funcs();
|
|
@@ -15228,7 +15301,7 @@ var init_mail_message = __esm({
|
|
|
15228
15301
|
}
|
|
15229
15302
|
});
|
|
15230
15303
|
|
|
15231
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
15304
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mailer/index.js
|
|
15232
15305
|
import { EventEmitter } from "node:events";
|
|
15233
15306
|
import util3 from "node:util";
|
|
15234
15307
|
import net6 from "node:net";
|
|
@@ -15236,7 +15309,7 @@ import dns2 from "node:dns";
|
|
|
15236
15309
|
import crypto5 from "node:crypto";
|
|
15237
15310
|
var DEFAULT_MAX_RECIPIENTS, Mail, mailer_default;
|
|
15238
15311
|
var init_mailer = __esm({
|
|
15239
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
15312
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mailer/index.js"() {
|
|
15240
15313
|
init_shared();
|
|
15241
15314
|
init_mime_types();
|
|
15242
15315
|
init_mail_composer();
|
|
@@ -15581,11 +15654,15 @@ var init_mailer = __esm({
|
|
|
15581
15654
|
}
|
|
15582
15655
|
});
|
|
15583
15656
|
|
|
15584
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
15657
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-connection/data-stream.js
|
|
15585
15658
|
import { Transform as Transform8 } from "node:stream";
|
|
15586
|
-
var DataStream;
|
|
15659
|
+
var INSERT_LF, INSERT_LF_DOT, INSERT_CR, INSERT_DOT, DataStream;
|
|
15587
15660
|
var init_data_stream = __esm({
|
|
15588
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
15661
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-connection/data-stream.js"() {
|
|
15662
|
+
INSERT_LF = Buffer.from("\n");
|
|
15663
|
+
INSERT_LF_DOT = Buffer.from("\n.");
|
|
15664
|
+
INSERT_CR = Buffer.from("\r");
|
|
15665
|
+
INSERT_DOT = Buffer.from(".");
|
|
15589
15666
|
DataStream = class extends Transform8 {
|
|
15590
15667
|
constructor(options) {
|
|
15591
15668
|
super(options);
|
|
@@ -15611,29 +15688,28 @@ var init_data_stream = __esm({
|
|
|
15611
15688
|
}
|
|
15612
15689
|
this.inByteCount += chunk.length;
|
|
15613
15690
|
for (i = 0, len = chunk.length; i < len; i++) {
|
|
15614
|
-
|
|
15615
|
-
|
|
15616
|
-
|
|
15691
|
+
const byte = chunk[i];
|
|
15692
|
+
const prev = i ? chunk[i - 1] : this.lastByte;
|
|
15693
|
+
let insert = false;
|
|
15694
|
+
if (prev === 13 && byte !== 10) {
|
|
15695
|
+
insert = byte === 46 ? INSERT_LF_DOT : INSERT_LF;
|
|
15696
|
+
} else if (byte === 10 && prev !== 13) {
|
|
15697
|
+
insert = INSERT_CR;
|
|
15698
|
+
} else if (byte === 46 && (prev === 10 || prev === false)) {
|
|
15699
|
+
insert = INSERT_DOT;
|
|
15700
|
+
}
|
|
15701
|
+
if (insert) {
|
|
15702
|
+
if (i > lastPos) {
|
|
15703
|
+
buf = chunk.slice(lastPos, i);
|
|
15617
15704
|
chunks.push(buf);
|
|
15618
|
-
|
|
15619
|
-
chunklen += buf.length + 1;
|
|
15620
|
-
lastPos = i + 1;
|
|
15621
|
-
}
|
|
15622
|
-
} else if (chunk[i] === 10) {
|
|
15623
|
-
if (i && chunk[i - 1] !== 13 || !i && this.lastByte !== 13) {
|
|
15624
|
-
if (i > lastPos) {
|
|
15625
|
-
buf = chunk.slice(lastPos, i);
|
|
15626
|
-
chunks.push(buf);
|
|
15627
|
-
chunklen += buf.length + 2;
|
|
15628
|
-
} else {
|
|
15629
|
-
chunklen += 2;
|
|
15630
|
-
}
|
|
15631
|
-
chunks.push(Buffer.from("\r\n"));
|
|
15632
|
-
lastPos = i + 1;
|
|
15705
|
+
chunklen += buf.length;
|
|
15633
15706
|
}
|
|
15707
|
+
chunks.push(insert);
|
|
15708
|
+
chunklen += insert.length;
|
|
15709
|
+
lastPos = i;
|
|
15634
15710
|
}
|
|
15635
15711
|
}
|
|
15636
|
-
if (
|
|
15712
|
+
if (chunks.length) {
|
|
15637
15713
|
if (lastPos < chunk.length) {
|
|
15638
15714
|
buf = chunk.slice(lastPos);
|
|
15639
15715
|
chunks.push(buf);
|
|
@@ -15669,7 +15745,7 @@ var init_data_stream = __esm({
|
|
|
15669
15745
|
}
|
|
15670
15746
|
});
|
|
15671
15747
|
|
|
15672
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
15748
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-connection/index.js
|
|
15673
15749
|
import { EventEmitter as EventEmitter2 } from "node:events";
|
|
15674
15750
|
import net7 from "node:net";
|
|
15675
15751
|
import tls2 from "node:tls";
|
|
@@ -15691,7 +15767,7 @@ function isPartialLine(line) {
|
|
|
15691
15767
|
}
|
|
15692
15768
|
var CONNECTION_TIMEOUT, SOCKET_TIMEOUT, GREETING_TIMEOUT, DNS_TIMEOUT, TEARDOWN_NOOP, MAX_RESPONSE_SIZE, SMTPConnection, smtp_connection_default;
|
|
15693
15769
|
var init_smtp_connection = __esm({
|
|
15694
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
15770
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-connection/index.js"() {
|
|
15695
15771
|
init_package_info();
|
|
15696
15772
|
init_data_stream();
|
|
15697
15773
|
init_shared();
|
|
@@ -15708,6 +15784,9 @@ var init_smtp_connection = __esm({
|
|
|
15708
15784
|
this.id = crypto6.randomBytes(8).toString("base64").replace(/\W/g, "");
|
|
15709
15785
|
this.stage = "init";
|
|
15710
15786
|
this.options = options || {};
|
|
15787
|
+
if (this.options.requireTLS && (this.options.ignoreTLS || this.options.opportunisticTLS)) {
|
|
15788
|
+
this.options = Object.assign({}, this.options, { ignoreTLS: false, opportunisticTLS: false });
|
|
15789
|
+
}
|
|
15711
15790
|
this.secureConnection = !!this.options.secure;
|
|
15712
15791
|
this.alreadySecured = !!this.options.secured;
|
|
15713
15792
|
this.port = Number(this.options.port) || (this.secureConnection ? 465 : 587);
|
|
@@ -15750,6 +15829,8 @@ var init_smtp_connection = __esm({
|
|
|
15750
15829
|
this._destroyed = false;
|
|
15751
15830
|
this._closing = false;
|
|
15752
15831
|
this._currentDataStream = false;
|
|
15832
|
+
this._pendingSend = false;
|
|
15833
|
+
this._connectCallback = false;
|
|
15753
15834
|
this._onSocketData = (chunk) => this._onData(chunk);
|
|
15754
15835
|
this._onSocketError = (error3) => this._onError(error3, "ESOCKET", false, "CONN");
|
|
15755
15836
|
this._onSocketClose = () => this._onClose();
|
|
@@ -15764,7 +15845,9 @@ var init_smtp_connection = __esm({
|
|
|
15764
15845
|
*/
|
|
15765
15846
|
connect(connectCallback) {
|
|
15766
15847
|
if (typeof connectCallback === "function") {
|
|
15848
|
+
this._connectCallback = connectCallback;
|
|
15767
15849
|
this.once("connect", () => {
|
|
15850
|
+
this._connectCallback = false;
|
|
15768
15851
|
this.logger.debug({
|
|
15769
15852
|
tnx: "smtp"
|
|
15770
15853
|
}, "SMTP handshake finished");
|
|
@@ -15964,6 +16047,14 @@ var init_smtp_connection = __esm({
|
|
|
15964
16047
|
}
|
|
15965
16048
|
this._currentDataStream = false;
|
|
15966
16049
|
}
|
|
16050
|
+
if (this._pendingSend) {
|
|
16051
|
+
const { stream, onStreamError } = this._pendingSend;
|
|
16052
|
+
if (stream) {
|
|
16053
|
+
stream.removeListener("error", onStreamError);
|
|
16054
|
+
stream.on("error", TEARDOWN_NOOP);
|
|
16055
|
+
}
|
|
16056
|
+
this._pendingSend = false;
|
|
16057
|
+
}
|
|
15967
16058
|
if (socket && !socket.destroyed) {
|
|
15968
16059
|
try {
|
|
15969
16060
|
socket.setTimeout(0);
|
|
@@ -15990,12 +16081,14 @@ var init_smtp_connection = __esm({
|
|
|
15990
16081
|
}
|
|
15991
16082
|
this._auth = authData || {};
|
|
15992
16083
|
this._authMethod = (this._auth.method || "").toString().trim().toUpperCase() || false;
|
|
16084
|
+
const canUseXOAuth2 = !!this._auth.oauth2 || this.customAuth.has("XOAUTH2");
|
|
15993
16085
|
if (!this._authMethod && this._auth.oauth2 && !this._auth.credentials) {
|
|
15994
16086
|
this._authMethod = "XOAUTH2";
|
|
15995
16087
|
} else if (!this._authMethod || this._authMethod === "XOAUTH2" && !this._auth.oauth2) {
|
|
15996
|
-
|
|
16088
|
+
const supported = this._supportedAuth.find((method) => method !== "XOAUTH2" || canUseXOAuth2);
|
|
16089
|
+
this._authMethod = (supported || "PLAIN").toUpperCase().trim();
|
|
15997
16090
|
}
|
|
15998
|
-
if (this._authMethod !== "XOAUTH2" && (!this._auth.credentials || !this._auth.credentials.user || !this._auth.credentials.pass)) {
|
|
16091
|
+
if ((this._authMethod !== "XOAUTH2" || this.customAuth.has("XOAUTH2")) && (!this._auth.credentials || !this._auth.credentials.user || !this._auth.credentials.pass)) {
|
|
15999
16092
|
if (this._auth.user && this._auth.pass || this.customAuth.has(this._authMethod)) {
|
|
16000
16093
|
this._auth.credentials = {
|
|
16001
16094
|
user: this._auth.user,
|
|
@@ -16031,41 +16124,42 @@ var init_smtp_connection = __esm({
|
|
|
16031
16124
|
returned = true;
|
|
16032
16125
|
callback(this._formatError(err, "EAUTH", lastResponse, "AUTH " + this._authMethod));
|
|
16033
16126
|
};
|
|
16127
|
+
const sendCommand = (cmd, done) => {
|
|
16128
|
+
let promise;
|
|
16129
|
+
if (!done) {
|
|
16130
|
+
promise = new Promise((resolve6, reject2) => {
|
|
16131
|
+
done = callbackPromise(resolve6, reject2);
|
|
16132
|
+
});
|
|
16133
|
+
}
|
|
16134
|
+
this._responseActions.push((str2) => {
|
|
16135
|
+
lastResponse = str2;
|
|
16136
|
+
let codes = str2.match(/^(\d+)(?:\s(\d+\.\d+\.\d+))?\s/);
|
|
16137
|
+
let data = {
|
|
16138
|
+
command: cmd,
|
|
16139
|
+
response: str2
|
|
16140
|
+
};
|
|
16141
|
+
if (codes) {
|
|
16142
|
+
data.status = Number(codes[1]) || 0;
|
|
16143
|
+
if (codes[2]) {
|
|
16144
|
+
data.code = codes[2];
|
|
16145
|
+
}
|
|
16146
|
+
data.text = str2.substr(codes[0].length);
|
|
16147
|
+
} else {
|
|
16148
|
+
data.text = str2;
|
|
16149
|
+
data.status = 0;
|
|
16150
|
+
}
|
|
16151
|
+
done(null, data);
|
|
16152
|
+
});
|
|
16153
|
+
setImmediate(() => this._sendCommand(cmd));
|
|
16154
|
+
return promise;
|
|
16155
|
+
};
|
|
16034
16156
|
const handlerResponse = handler({
|
|
16035
16157
|
auth: this._auth,
|
|
16036
16158
|
method: this._authMethod,
|
|
16037
16159
|
extensions: [].concat(this._supportedExtensions),
|
|
16038
16160
|
authMethods: [].concat(this._supportedAuth),
|
|
16039
16161
|
maxAllowedSize: this._maxAllowedSize || false,
|
|
16040
|
-
sendCommand
|
|
16041
|
-
let promise;
|
|
16042
|
-
if (!done) {
|
|
16043
|
-
promise = new Promise((resolve6, reject2) => {
|
|
16044
|
-
done = callbackPromise(resolve6, reject2);
|
|
16045
|
-
});
|
|
16046
|
-
}
|
|
16047
|
-
this._responseActions.push((str2) => {
|
|
16048
|
-
lastResponse = str2;
|
|
16049
|
-
let codes = str2.match(/^(\d+)(?:\s(\d+\.\d+\.\d+))?\s/);
|
|
16050
|
-
let data = {
|
|
16051
|
-
command: cmd,
|
|
16052
|
-
response: str2
|
|
16053
|
-
};
|
|
16054
|
-
if (codes) {
|
|
16055
|
-
data.status = Number(codes[1]) || 0;
|
|
16056
|
-
if (codes[2]) {
|
|
16057
|
-
data.code = codes[2];
|
|
16058
|
-
}
|
|
16059
|
-
data.text = str2.substr(codes[0].length);
|
|
16060
|
-
} else {
|
|
16061
|
-
data.text = str2;
|
|
16062
|
-
data.status = 0;
|
|
16063
|
-
}
|
|
16064
|
-
done(null, data);
|
|
16065
|
-
});
|
|
16066
|
-
setImmediate(() => this._sendCommand(cmd));
|
|
16067
|
-
return promise;
|
|
16068
|
-
},
|
|
16162
|
+
sendCommand,
|
|
16069
16163
|
resolve: resolve5,
|
|
16070
16164
|
reject
|
|
16071
16165
|
});
|
|
@@ -16121,30 +16215,40 @@ var init_smtp_connection = __esm({
|
|
|
16121
16215
|
* @param callback Callback to return once sending is completed
|
|
16122
16216
|
*/
|
|
16123
16217
|
send(envelope, message, done) {
|
|
16218
|
+
let returned = false;
|
|
16219
|
+
const callback = (err, info) => {
|
|
16220
|
+
if (returned) {
|
|
16221
|
+
return;
|
|
16222
|
+
}
|
|
16223
|
+
returned = true;
|
|
16224
|
+
if (this._pendingSend && this._pendingSend.callback === callback) {
|
|
16225
|
+
this._pendingSend = false;
|
|
16226
|
+
}
|
|
16227
|
+
done(err, info);
|
|
16228
|
+
};
|
|
16124
16229
|
if (!message) {
|
|
16125
|
-
return
|
|
16230
|
+
return callback(this._formatError("Empty message", "EMESSAGE", false, "API"));
|
|
16126
16231
|
}
|
|
16127
16232
|
const isDestroyedMessage = this._isDestroyedMessage("send message");
|
|
16128
16233
|
if (isDestroyedMessage) {
|
|
16129
|
-
return
|
|
16234
|
+
return callback(this._formatError(isDestroyedMessage, "ECONNECTION", false, "API"));
|
|
16130
16235
|
}
|
|
16131
16236
|
if (this._maxAllowedSize && envelope.size > this._maxAllowedSize) {
|
|
16132
16237
|
setImmediate(() => {
|
|
16133
|
-
|
|
16238
|
+
callback(this._formatError("Message size larger than allowed " + this._maxAllowedSize, "EMESSAGE", false, "MAIL FROM"));
|
|
16134
16239
|
});
|
|
16135
16240
|
return;
|
|
16136
16241
|
}
|
|
16137
|
-
|
|
16138
|
-
|
|
16139
|
-
|
|
16140
|
-
|
|
16141
|
-
}
|
|
16142
|
-
returned = true;
|
|
16143
|
-
done(...args);
|
|
16242
|
+
const pendingSend = {
|
|
16243
|
+
callback,
|
|
16244
|
+
stream: false,
|
|
16245
|
+
onStreamError: (err) => callback(this._formatError(err, "ESTREAM", false, "API"))
|
|
16144
16246
|
};
|
|
16145
16247
|
if (typeof message.on === "function") {
|
|
16146
|
-
|
|
16248
|
+
pendingSend.stream = message;
|
|
16249
|
+
pendingSend.stream.on("error", pendingSend.onStreamError);
|
|
16147
16250
|
}
|
|
16251
|
+
this._pendingSend = pendingSend;
|
|
16148
16252
|
const startTime = Date.now();
|
|
16149
16253
|
this._setEnvelope(envelope, (err, info) => {
|
|
16150
16254
|
if (err) {
|
|
@@ -16162,11 +16266,12 @@ var init_smtp_connection = __esm({
|
|
|
16162
16266
|
if (err2) {
|
|
16163
16267
|
return callback(err2);
|
|
16164
16268
|
}
|
|
16165
|
-
|
|
16166
|
-
|
|
16167
|
-
|
|
16168
|
-
|
|
16169
|
-
|
|
16269
|
+
const result = info;
|
|
16270
|
+
result.envelopeTime = envelopeTime - startTime;
|
|
16271
|
+
result.messageTime = Date.now() - envelopeTime;
|
|
16272
|
+
result.messageSize = stream.outByteCount;
|
|
16273
|
+
result.response = str2;
|
|
16274
|
+
return callback(null, result);
|
|
16170
16275
|
});
|
|
16171
16276
|
if (typeof message.pipe === "function") {
|
|
16172
16277
|
message.pipe(stream);
|
|
@@ -16310,8 +16415,12 @@ var init_smtp_connection = __esm({
|
|
|
16310
16415
|
} else {
|
|
16311
16416
|
this.logger.error(data, err.message);
|
|
16312
16417
|
}
|
|
16418
|
+
const pendingSend = this._pendingSend;
|
|
16313
16419
|
this.emit("error", err);
|
|
16314
16420
|
this.close();
|
|
16421
|
+
if (pendingSend) {
|
|
16422
|
+
pendingSend.callback(err);
|
|
16423
|
+
}
|
|
16315
16424
|
}
|
|
16316
16425
|
/** @internal */
|
|
16317
16426
|
_formatError(message, type, response, command) {
|
|
@@ -16356,12 +16465,21 @@ var init_smtp_connection = __esm({
|
|
|
16356
16465
|
this.logger.info({
|
|
16357
16466
|
tnx: "network"
|
|
16358
16467
|
}, "Connection closed");
|
|
16468
|
+
const failureResponse = typeof serverResponse === "string" && /^[45]\d{2}[ -]/.test(serverResponse) ? serverResponse : false;
|
|
16359
16469
|
if (this.upgrading && !this._destroyed) {
|
|
16360
|
-
return this._onError(new Error("Connection closed unexpectedly"), "ETLS",
|
|
16361
|
-
}
|
|
16362
|
-
|
|
16363
|
-
|
|
16364
|
-
|
|
16470
|
+
return this._onError(new Error("Connection closed unexpectedly"), "ETLS", failureResponse, "CONN");
|
|
16471
|
+
}
|
|
16472
|
+
if (!failureResponse && this._responseActions[0] === this._actionGreeting && this._connectCallback && !this._destroyed) {
|
|
16473
|
+
const connectCallback = this._connectCallback;
|
|
16474
|
+
this._connectCallback = false;
|
|
16475
|
+
const err = this._formatError(new Error("Connection closed unexpectedly"), "ECONNECTION", false, "CONN");
|
|
16476
|
+
this.logger.warn({ tnx: "network" }, err.message);
|
|
16477
|
+
connectCallback(err);
|
|
16478
|
+
this.close();
|
|
16479
|
+
return;
|
|
16480
|
+
}
|
|
16481
|
+
if (failureResponse || this._responseActions[0] !== this.close && !this._destroyed) {
|
|
16482
|
+
return this._onError(new Error("Connection closed unexpectedly"), "ECONNECTION", failureResponse, "CONN");
|
|
16365
16483
|
}
|
|
16366
16484
|
this._destroy();
|
|
16367
16485
|
}
|
|
@@ -16769,17 +16887,19 @@ var init_smtp_connection = __esm({
|
|
|
16769
16887
|
if (/[ -]AUTH\b/i.test(str2)) {
|
|
16770
16888
|
this.allowsAuth = true;
|
|
16771
16889
|
}
|
|
16772
|
-
|
|
16773
|
-
|
|
16774
|
-
|
|
16775
|
-
|
|
16776
|
-
|
|
16777
|
-
|
|
16778
|
-
|
|
16779
|
-
|
|
16890
|
+
const authMechanisms = /* @__PURE__ */ new Set();
|
|
16891
|
+
for (const line of this._ehloLines) {
|
|
16892
|
+
const authMatch = /^AUTH[\s=](.*)/i.exec(line);
|
|
16893
|
+
if (authMatch) {
|
|
16894
|
+
for (const mechanism of authMatch[1].split(/[\s=]+/)) {
|
|
16895
|
+
authMechanisms.add(mechanism.toUpperCase());
|
|
16896
|
+
}
|
|
16897
|
+
}
|
|
16780
16898
|
}
|
|
16781
|
-
|
|
16782
|
-
|
|
16899
|
+
for (const mechanism of ["PLAIN", "LOGIN", "CRAM-MD5", "XOAUTH2"]) {
|
|
16900
|
+
if (authMechanisms.has(mechanism)) {
|
|
16901
|
+
this._supportedAuth.push(mechanism);
|
|
16902
|
+
}
|
|
16783
16903
|
}
|
|
16784
16904
|
if (match = str2.match(/[ -]SIZE(?:[ \t]+(\d+))?/im)) {
|
|
16785
16905
|
this._supportedExtensions.push("SIZE");
|
|
@@ -17025,7 +17145,9 @@ var init_smtp_connection = __esm({
|
|
|
17025
17145
|
});
|
|
17026
17146
|
this._sendCommand("DATA");
|
|
17027
17147
|
} else {
|
|
17028
|
-
|
|
17148
|
+
const deferred = envelope.rejectedErrors.find((rejectedErr) => rejectedErr.responseCode && rejectedErr.responseCode < 500);
|
|
17149
|
+
const reply = deferred?.response ?? str2;
|
|
17150
|
+
err = this._formatError("Can't send mail - all recipients were rejected", "EENVELOPE", reply, "RCPT TO");
|
|
17029
17151
|
err.rejected = envelope.rejected;
|
|
17030
17152
|
err.rejectedErrors = envelope.rejectedErrors;
|
|
17031
17153
|
return callback(err);
|
|
@@ -17164,12 +17286,12 @@ var init_smtp_connection = __esm({
|
|
|
17164
17286
|
}
|
|
17165
17287
|
});
|
|
17166
17288
|
|
|
17167
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
17289
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/xoauth2/index.js
|
|
17168
17290
|
import { Stream } from "node:stream";
|
|
17169
17291
|
import crypto7 from "node:crypto";
|
|
17170
17292
|
var XOAuth2, xoauth2_default;
|
|
17171
17293
|
var init_xoauth2 = __esm({
|
|
17172
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
17294
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/xoauth2/index.js"() {
|
|
17173
17295
|
init_fetch();
|
|
17174
17296
|
init_shared();
|
|
17175
17297
|
init_errors();
|
|
@@ -17177,12 +17299,12 @@ var init_xoauth2 = __esm({
|
|
|
17177
17299
|
constructor(options, logger) {
|
|
17178
17300
|
super();
|
|
17179
17301
|
this.options = options || {};
|
|
17302
|
+
this.configError = false;
|
|
17180
17303
|
if (options && options.serviceClient) {
|
|
17181
17304
|
if (!options.privateKey || !options.user) {
|
|
17182
17305
|
const err = new Error('Options "privateKey" and "user" are required for service account!');
|
|
17183
17306
|
err.code = EOAUTH2;
|
|
17184
|
-
|
|
17185
|
-
return;
|
|
17307
|
+
this.configError = err;
|
|
17186
17308
|
}
|
|
17187
17309
|
const serviceRequestTimeout = Math.min(Math.max(Number(this.options.serviceRequestTimeout) || 0, 0), 3600);
|
|
17188
17310
|
this.options.serviceRequestTimeout = serviceRequestTimeout || 5 * 60;
|
|
@@ -17213,6 +17335,10 @@ var init_xoauth2 = __esm({
|
|
|
17213
17335
|
* @param callback Callback function with error object and token string
|
|
17214
17336
|
*/
|
|
17215
17337
|
getToken(renew, callback) {
|
|
17338
|
+
const done = callback;
|
|
17339
|
+
if (this.configError) {
|
|
17340
|
+
return done(this.configError);
|
|
17341
|
+
}
|
|
17216
17342
|
if (!renew && this.accessToken && (!this.expires || this.expires > Date.now())) {
|
|
17217
17343
|
this.logger.debug({
|
|
17218
17344
|
tnx: "OAUTH2",
|
|
@@ -17237,10 +17363,10 @@ var init_xoauth2 = __esm({
|
|
|
17237
17363
|
}, "Cannot renew access token for %s: No refresh mechanism available", this.options.user);
|
|
17238
17364
|
const err = new Error("Can't create new access token for user");
|
|
17239
17365
|
err.code = EOAUTH2;
|
|
17240
|
-
return
|
|
17366
|
+
return done(err);
|
|
17241
17367
|
}
|
|
17242
17368
|
if (this.renewing) {
|
|
17243
|
-
this.renewalQueue.push({ renew, callback });
|
|
17369
|
+
this.renewalQueue.push({ renew, callback: done });
|
|
17244
17370
|
return;
|
|
17245
17371
|
}
|
|
17246
17372
|
this.renewing = true;
|
|
@@ -17262,7 +17388,7 @@ var init_xoauth2 = __esm({
|
|
|
17262
17388
|
action: "renew"
|
|
17263
17389
|
}, "Generated new Access Token for %s", this.options.user);
|
|
17264
17390
|
}
|
|
17265
|
-
|
|
17391
|
+
done(err, accessToken);
|
|
17266
17392
|
};
|
|
17267
17393
|
if (this.provisionCallback) {
|
|
17268
17394
|
this.provisionCallback(this.options.user, !!renew, (err, accessToken, expires) => {
|
|
@@ -17300,6 +17426,7 @@ var init_xoauth2 = __esm({
|
|
|
17300
17426
|
* @param callback Callback function with error object and token string
|
|
17301
17427
|
*/
|
|
17302
17428
|
generateToken(callback) {
|
|
17429
|
+
const done = callback;
|
|
17303
17430
|
let urlOptions;
|
|
17304
17431
|
let loggedUrlOptions;
|
|
17305
17432
|
if (this.options.serviceClient) {
|
|
@@ -17318,7 +17445,7 @@ var init_xoauth2 = __esm({
|
|
|
17318
17445
|
} catch (_err) {
|
|
17319
17446
|
const err = new Error("Can't generate token. Check your auth options");
|
|
17320
17447
|
err.code = EOAUTH2;
|
|
17321
|
-
return
|
|
17448
|
+
return done(err);
|
|
17322
17449
|
}
|
|
17323
17450
|
urlOptions = {
|
|
17324
17451
|
grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer",
|
|
@@ -17332,7 +17459,7 @@ var init_xoauth2 = __esm({
|
|
|
17332
17459
|
if (!this.options.refreshToken) {
|
|
17333
17460
|
const err = new Error("Can't create new access token for user");
|
|
17334
17461
|
err.code = EOAUTH2;
|
|
17335
|
-
return
|
|
17462
|
+
return done(err);
|
|
17336
17463
|
}
|
|
17337
17464
|
urlOptions = {
|
|
17338
17465
|
client_id: this.options.clientId || "",
|
|
@@ -17357,12 +17484,12 @@ var init_xoauth2 = __esm({
|
|
|
17357
17484
|
this.postRequest(this.options.accessUrl, urlOptions, this.options, (error3, body) => {
|
|
17358
17485
|
let data;
|
|
17359
17486
|
if (error3) {
|
|
17360
|
-
return
|
|
17487
|
+
return done(error3);
|
|
17361
17488
|
}
|
|
17362
17489
|
try {
|
|
17363
17490
|
data = JSON.parse(body.toString());
|
|
17364
17491
|
} catch (E) {
|
|
17365
|
-
return
|
|
17492
|
+
return done(E);
|
|
17366
17493
|
}
|
|
17367
17494
|
if (!data || typeof data !== "object") {
|
|
17368
17495
|
this.logger.debug({
|
|
@@ -17372,7 +17499,7 @@ var init_xoauth2 = __esm({
|
|
|
17372
17499
|
}, "Response: %s", (body || "").toString());
|
|
17373
17500
|
const err2 = new Error("Invalid authentication response");
|
|
17374
17501
|
err2.code = EOAUTH2;
|
|
17375
|
-
return
|
|
17502
|
+
return done(err2);
|
|
17376
17503
|
}
|
|
17377
17504
|
const logData = Object.assign({}, data);
|
|
17378
17505
|
if (logData.access_token) {
|
|
@@ -17393,7 +17520,7 @@ var init_xoauth2 = __esm({
|
|
|
17393
17520
|
}
|
|
17394
17521
|
const err2 = new Error(errorMessage);
|
|
17395
17522
|
err2.code = EOAUTH2;
|
|
17396
|
-
return
|
|
17523
|
+
return done(err2);
|
|
17397
17524
|
}
|
|
17398
17525
|
if (data.access_token) {
|
|
17399
17526
|
this.updateToken(data.access_token, data.expires_in);
|
|
@@ -17401,7 +17528,7 @@ var init_xoauth2 = __esm({
|
|
|
17401
17528
|
}
|
|
17402
17529
|
const err = new Error("No access token");
|
|
17403
17530
|
err.code = EOAUTH2;
|
|
17404
|
-
return
|
|
17531
|
+
return done(err);
|
|
17405
17532
|
});
|
|
17406
17533
|
}
|
|
17407
17534
|
/**
|
|
@@ -17435,7 +17562,10 @@ var init_xoauth2 = __esm({
|
|
|
17435
17562
|
method: "post",
|
|
17436
17563
|
headers: params.customHeaders,
|
|
17437
17564
|
body: payload,
|
|
17438
|
-
allowErrorResponse: true
|
|
17565
|
+
allowErrorResponse: true,
|
|
17566
|
+
// unset falls back to the fetch default, a stalled token endpoint would otherwise keep
|
|
17567
|
+
// `renewing` set and queue every later request
|
|
17568
|
+
timeout: params.requestTimeout
|
|
17439
17569
|
};
|
|
17440
17570
|
if (/^https:/i.test(url)) {
|
|
17441
17571
|
fetchOptions.tls = Object.assign({ rejectUnauthorized: true }, params.tls || {});
|
|
@@ -17491,11 +17621,11 @@ var init_xoauth2 = __esm({
|
|
|
17491
17621
|
}
|
|
17492
17622
|
});
|
|
17493
17623
|
|
|
17494
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
17624
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-pool/pool-resource.js
|
|
17495
17625
|
import { EventEmitter as EventEmitter3 } from "node:events";
|
|
17496
17626
|
var PoolResource;
|
|
17497
17627
|
var init_pool_resource = __esm({
|
|
17498
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
17628
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-pool/pool-resource.js"() {
|
|
17499
17629
|
init_smtp_connection();
|
|
17500
17630
|
init_shared();
|
|
17501
17631
|
init_xoauth2();
|
|
@@ -17518,7 +17648,7 @@ var init_pool_resource = __esm({
|
|
|
17518
17648
|
method: "XOAUTH2"
|
|
17519
17649
|
};
|
|
17520
17650
|
oauth2.on("token", (token) => this.pool.mailer.emit("token", token));
|
|
17521
|
-
oauth2.on("error", (err) => this.
|
|
17651
|
+
oauth2.on("error", (err) => this._fail(err));
|
|
17522
17652
|
break;
|
|
17523
17653
|
}
|
|
17524
17654
|
default:
|
|
@@ -17541,6 +17671,19 @@ var init_pool_resource = __esm({
|
|
|
17541
17671
|
this._connected = false;
|
|
17542
17672
|
this.messages = 0;
|
|
17543
17673
|
this.available = true;
|
|
17674
|
+
this._failed = false;
|
|
17675
|
+
}
|
|
17676
|
+
/**
|
|
17677
|
+
* Emits 'error' for the first failure only. A dead resource can report the same failure more
|
|
17678
|
+
* than once (the connection error, then the send callback), the pool handles it once
|
|
17679
|
+
* @internal
|
|
17680
|
+
*/
|
|
17681
|
+
_fail(err) {
|
|
17682
|
+
if (this._failed) {
|
|
17683
|
+
return;
|
|
17684
|
+
}
|
|
17685
|
+
this._failed = true;
|
|
17686
|
+
this.emit("error", err);
|
|
17544
17687
|
}
|
|
17545
17688
|
/**
|
|
17546
17689
|
* Initiates a connection to the SMTP server
|
|
@@ -17550,7 +17693,7 @@ var init_pool_resource = __esm({
|
|
|
17550
17693
|
connect(callback) {
|
|
17551
17694
|
this.pool.getSocket(this.options, (err, socketOptions) => {
|
|
17552
17695
|
if (err) {
|
|
17553
|
-
this.
|
|
17696
|
+
this._fail(err);
|
|
17554
17697
|
return callback(err);
|
|
17555
17698
|
}
|
|
17556
17699
|
let returned = false;
|
|
@@ -17567,8 +17710,8 @@ var init_pool_resource = __esm({
|
|
|
17567
17710
|
options = Object.assign(assign(false, options), socketOptions);
|
|
17568
17711
|
}
|
|
17569
17712
|
this.connection = new smtp_connection_default(options);
|
|
17570
|
-
this.connection.
|
|
17571
|
-
this.
|
|
17713
|
+
this.connection.on("error", (err2) => {
|
|
17714
|
+
this._fail(err2);
|
|
17572
17715
|
if (returned) {
|
|
17573
17716
|
return;
|
|
17574
17717
|
}
|
|
@@ -17577,39 +17720,26 @@ var init_pool_resource = __esm({
|
|
|
17577
17720
|
});
|
|
17578
17721
|
this.connection.once("end", () => {
|
|
17579
17722
|
this.close();
|
|
17580
|
-
if (returned) {
|
|
17581
|
-
return;
|
|
17582
|
-
}
|
|
17583
17723
|
returned = true;
|
|
17584
|
-
const timer = setTimeout(() => {
|
|
17585
|
-
if (returned) {
|
|
17586
|
-
return;
|
|
17587
|
-
}
|
|
17588
|
-
const err2 = new Error("Unexpected socket close");
|
|
17589
|
-
if (this.connection && this.connection._socket && this.connection._socket.upgrading) {
|
|
17590
|
-
err2.code = ETLS;
|
|
17591
|
-
}
|
|
17592
|
-
callback(err2);
|
|
17593
|
-
}, 1e3);
|
|
17594
|
-
try {
|
|
17595
|
-
timer.unref();
|
|
17596
|
-
} catch (_E) {
|
|
17597
|
-
}
|
|
17598
17724
|
});
|
|
17599
|
-
this.connection.connect(() => {
|
|
17725
|
+
this.connection.connect((err2) => {
|
|
17600
17726
|
if (returned) {
|
|
17601
17727
|
return;
|
|
17602
17728
|
}
|
|
17729
|
+
if (err2) {
|
|
17730
|
+
returned = true;
|
|
17731
|
+
return;
|
|
17732
|
+
}
|
|
17603
17733
|
if (this.auth && (this.connection.allowsAuth || options.forceAuth)) {
|
|
17604
|
-
this.connection.login(this.auth, (
|
|
17734
|
+
this.connection.login(this.auth, (err3) => {
|
|
17605
17735
|
if (returned) {
|
|
17606
17736
|
return;
|
|
17607
17737
|
}
|
|
17608
17738
|
returned = true;
|
|
17609
|
-
if (
|
|
17739
|
+
if (err3) {
|
|
17610
17740
|
this.connection.close();
|
|
17611
|
-
this.
|
|
17612
|
-
return callback(
|
|
17741
|
+
this._fail(err3);
|
|
17742
|
+
return callback(err3);
|
|
17613
17743
|
}
|
|
17614
17744
|
this._connected = true;
|
|
17615
17745
|
callback(null, true);
|
|
@@ -17658,7 +17788,7 @@ var init_pool_resource = __esm({
|
|
|
17658
17788
|
this.messages++;
|
|
17659
17789
|
if (err) {
|
|
17660
17790
|
this.connection.close();
|
|
17661
|
-
this.
|
|
17791
|
+
this._fail(err);
|
|
17662
17792
|
return callback(err);
|
|
17663
17793
|
}
|
|
17664
17794
|
info.envelope = {
|
|
@@ -17671,7 +17801,7 @@ var init_pool_resource = __esm({
|
|
|
17671
17801
|
const err2 = new Error("Resource exhausted");
|
|
17672
17802
|
err2.code = EMAXLIMIT;
|
|
17673
17803
|
this.connection.close();
|
|
17674
|
-
this.
|
|
17804
|
+
this._fail(err2);
|
|
17675
17805
|
} else {
|
|
17676
17806
|
this.pool._checkRateLimit(() => {
|
|
17677
17807
|
this.available = true;
|
|
@@ -17699,10 +17829,10 @@ var init_pool_resource = __esm({
|
|
|
17699
17829
|
}
|
|
17700
17830
|
});
|
|
17701
17831
|
|
|
17702
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
17832
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/well-known/services.js
|
|
17703
17833
|
var services;
|
|
17704
17834
|
var init_services = __esm({
|
|
17705
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
17835
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/well-known/services.js"() {
|
|
17706
17836
|
services = {
|
|
17707
17837
|
"126": {
|
|
17708
17838
|
"description": "126 Mail (NetEase)",
|
|
@@ -18370,7 +18500,7 @@ var init_services = __esm({
|
|
|
18370
18500
|
}
|
|
18371
18501
|
});
|
|
18372
18502
|
|
|
18373
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
18503
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/well-known/index.js
|
|
18374
18504
|
function normalizeKey(key) {
|
|
18375
18505
|
return key.replace(/[^a-zA-Z0-9.-]/g, "").toLowerCase();
|
|
18376
18506
|
}
|
|
@@ -18389,7 +18519,7 @@ function wellKnown(key) {
|
|
|
18389
18519
|
}
|
|
18390
18520
|
var normalized;
|
|
18391
18521
|
var init_well_known = __esm({
|
|
18392
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
18522
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/well-known/index.js"() {
|
|
18393
18523
|
init_services();
|
|
18394
18524
|
normalized = {};
|
|
18395
18525
|
Object.keys(services).forEach((key) => {
|
|
@@ -18406,17 +18536,19 @@ var init_well_known = __esm({
|
|
|
18406
18536
|
}
|
|
18407
18537
|
});
|
|
18408
18538
|
|
|
18409
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
18539
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-pool/index.js
|
|
18410
18540
|
import { EventEmitter as EventEmitter4 } from "node:events";
|
|
18411
|
-
var SMTPPool, smtp_pool_default;
|
|
18541
|
+
var REQUEUE_BASE_DELAY, REQUEUE_MAX_DELAY, SMTPPool, smtp_pool_default;
|
|
18412
18542
|
var init_smtp_pool = __esm({
|
|
18413
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
18543
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-pool/index.js"() {
|
|
18414
18544
|
init_pool_resource();
|
|
18415
18545
|
init_smtp_connection();
|
|
18416
18546
|
init_well_known();
|
|
18417
18547
|
init_shared();
|
|
18418
18548
|
init_errors();
|
|
18419
18549
|
init_package_info();
|
|
18550
|
+
REQUEUE_BASE_DELAY = 50;
|
|
18551
|
+
REQUEUE_MAX_DELAY = 2e3;
|
|
18420
18552
|
SMTPPool = class extends EventEmitter4 {
|
|
18421
18553
|
constructor(options) {
|
|
18422
18554
|
super();
|
|
@@ -18447,6 +18579,7 @@ var init_smtp_pool = __esm({
|
|
|
18447
18579
|
);
|
|
18448
18580
|
this.options.maxConnections = this.options.maxConnections || 5;
|
|
18449
18581
|
this.options.maxMessages = this.options.maxMessages || 100;
|
|
18582
|
+
this.options.maxRequeues = typeof this.options.maxRequeues === "number" ? this.options.maxRequeues : 5;
|
|
18450
18583
|
this.logger = getLogger(this.options, {
|
|
18451
18584
|
component: this.options.component || "smtp-pool"
|
|
18452
18585
|
});
|
|
@@ -18489,6 +18622,9 @@ var init_smtp_pool = __esm({
|
|
|
18489
18622
|
*/
|
|
18490
18623
|
send(mail, callback) {
|
|
18491
18624
|
if (this._closed) {
|
|
18625
|
+
const err = new Error("Connection pool was closed");
|
|
18626
|
+
err.code = ECONNECTION;
|
|
18627
|
+
setImmediate(() => callback(err));
|
|
18492
18628
|
return false;
|
|
18493
18629
|
}
|
|
18494
18630
|
this._queue.push({
|
|
@@ -18675,14 +18811,19 @@ var init_smtp_pool = __esm({
|
|
|
18675
18811
|
this._removeConnection(connection);
|
|
18676
18812
|
if (connection.queueEntry) {
|
|
18677
18813
|
setTimeout(() => {
|
|
18814
|
+
let delay = 0;
|
|
18678
18815
|
if (connection.queueEntry) {
|
|
18679
18816
|
if (this._shouldRequeuOnConnectionClose(connection.queueEntry)) {
|
|
18680
|
-
this._requeueEntryOnConnectionClose(connection);
|
|
18817
|
+
delay = this._requeueEntryOnConnectionClose(connection);
|
|
18681
18818
|
} else {
|
|
18682
18819
|
this._failDeliveryOnConnectionClose(connection);
|
|
18683
18820
|
}
|
|
18684
18821
|
}
|
|
18685
|
-
|
|
18822
|
+
if (delay) {
|
|
18823
|
+
setTimeout(() => this._continueProcessing(), delay);
|
|
18824
|
+
} else {
|
|
18825
|
+
this._continueProcessing();
|
|
18826
|
+
}
|
|
18686
18827
|
}, 50);
|
|
18687
18828
|
} else {
|
|
18688
18829
|
if (!this._closed && this.idling && !this._connections.length) {
|
|
@@ -18696,7 +18837,7 @@ var init_smtp_pool = __esm({
|
|
|
18696
18837
|
}
|
|
18697
18838
|
/** @internal */
|
|
18698
18839
|
_shouldRequeuOnConnectionClose(queueEntry) {
|
|
18699
|
-
if (this.options.maxRequeues
|
|
18840
|
+
if (this.options.maxRequeues < 0) {
|
|
18700
18841
|
return true;
|
|
18701
18842
|
}
|
|
18702
18843
|
return queueEntry.requeueAttempts < this.options.maxRequeues;
|
|
@@ -18705,7 +18846,9 @@ var init_smtp_pool = __esm({
|
|
|
18705
18846
|
_failDeliveryOnConnectionClose(connection) {
|
|
18706
18847
|
if (connection.queueEntry && connection.queueEntry.callback) {
|
|
18707
18848
|
try {
|
|
18708
|
-
|
|
18849
|
+
const err = new Error("Reached maximum number of retries after connection was closed");
|
|
18850
|
+
err.code = ECONNECTION;
|
|
18851
|
+
connection.queueEntry.callback(err);
|
|
18709
18852
|
} catch (E) {
|
|
18710
18853
|
this.logger.error({
|
|
18711
18854
|
err: E,
|
|
@@ -18719,6 +18862,7 @@ var init_smtp_pool = __esm({
|
|
|
18719
18862
|
}
|
|
18720
18863
|
/** @internal */
|
|
18721
18864
|
_requeueEntryOnConnectionClose(connection) {
|
|
18865
|
+
const delay = Math.min(REQUEUE_BASE_DELAY * 2 ** connection.queueEntry.requeueAttempts, REQUEUE_MAX_DELAY);
|
|
18722
18866
|
connection.queueEntry.requeueAttempts += 1;
|
|
18723
18867
|
this.logger.debug({
|
|
18724
18868
|
tnx: "pool",
|
|
@@ -18728,6 +18872,7 @@ var init_smtp_pool = __esm({
|
|
|
18728
18872
|
}, "Re-queued message <%s> for #%s. Attempt: #%s", connection.queueEntry.messageId, connection.id, connection.queueEntry.requeueAttempts);
|
|
18729
18873
|
this._queue.unshift(connection.queueEntry);
|
|
18730
18874
|
connection.queueEntry = false;
|
|
18875
|
+
return delay;
|
|
18731
18876
|
}
|
|
18732
18877
|
/**
|
|
18733
18878
|
* Continue to process message if the pool hasn't closed
|
|
@@ -18802,10 +18947,11 @@ var init_smtp_pool = __esm({
|
|
|
18802
18947
|
callback = callbackPromise(resolve5, reject);
|
|
18803
18948
|
});
|
|
18804
18949
|
}
|
|
18950
|
+
const done = callback;
|
|
18805
18951
|
const auth = new PoolResource(this).auth;
|
|
18806
18952
|
this.getSocket(this.options, (err, socketOptions) => {
|
|
18807
18953
|
if (err) {
|
|
18808
|
-
return
|
|
18954
|
+
return done(err);
|
|
18809
18955
|
}
|
|
18810
18956
|
let options = this.options;
|
|
18811
18957
|
if (socketOptions && socketOptions.connection) {
|
|
@@ -18827,14 +18973,14 @@ var init_smtp_pool = __esm({
|
|
|
18827
18973
|
}
|
|
18828
18974
|
returned = true;
|
|
18829
18975
|
connection.close();
|
|
18830
|
-
return
|
|
18976
|
+
return done(err2);
|
|
18831
18977
|
});
|
|
18832
18978
|
connection.once("end", () => {
|
|
18833
18979
|
if (returned) {
|
|
18834
18980
|
return;
|
|
18835
18981
|
}
|
|
18836
18982
|
returned = true;
|
|
18837
|
-
return
|
|
18983
|
+
return done(new Error("Connection closed"));
|
|
18838
18984
|
});
|
|
18839
18985
|
const finalize = () => {
|
|
18840
18986
|
if (returned) {
|
|
@@ -18842,30 +18988,35 @@ var init_smtp_pool = __esm({
|
|
|
18842
18988
|
}
|
|
18843
18989
|
returned = true;
|
|
18844
18990
|
connection.quit();
|
|
18845
|
-
return
|
|
18991
|
+
return done(null, true);
|
|
18846
18992
|
};
|
|
18847
|
-
connection.connect(() => {
|
|
18993
|
+
connection.connect((err2) => {
|
|
18848
18994
|
if (returned) {
|
|
18849
18995
|
return;
|
|
18850
18996
|
}
|
|
18997
|
+
if (err2) {
|
|
18998
|
+
returned = true;
|
|
18999
|
+
connection.close();
|
|
19000
|
+
return done(err2);
|
|
19001
|
+
}
|
|
18851
19002
|
if (auth && (connection.allowsAuth || options.forceAuth)) {
|
|
18852
|
-
connection.login(auth, (
|
|
19003
|
+
connection.login(auth, (err3) => {
|
|
18853
19004
|
if (returned) {
|
|
18854
19005
|
return;
|
|
18855
19006
|
}
|
|
18856
|
-
if (
|
|
19007
|
+
if (err3) {
|
|
18857
19008
|
returned = true;
|
|
18858
19009
|
connection.close();
|
|
18859
|
-
return
|
|
19010
|
+
return done(err3);
|
|
18860
19011
|
}
|
|
18861
19012
|
finalize();
|
|
18862
19013
|
});
|
|
18863
19014
|
} else if (!auth && connection.allowsAuth && options.forceAuth) {
|
|
18864
|
-
const
|
|
18865
|
-
|
|
19015
|
+
const err3 = new Error("Authentication info was not provided");
|
|
19016
|
+
err3.code = ENOAUTH;
|
|
18866
19017
|
returned = true;
|
|
18867
19018
|
connection.close();
|
|
18868
|
-
return
|
|
19019
|
+
return done(err3);
|
|
18869
19020
|
} else {
|
|
18870
19021
|
finalize();
|
|
18871
19022
|
}
|
|
@@ -18878,11 +19029,11 @@ var init_smtp_pool = __esm({
|
|
|
18878
19029
|
}
|
|
18879
19030
|
});
|
|
18880
19031
|
|
|
18881
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
19032
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-transport/index.js
|
|
18882
19033
|
import { EventEmitter as EventEmitter5 } from "node:events";
|
|
18883
19034
|
var SMTPTransport, smtp_transport_default;
|
|
18884
19035
|
var init_smtp_transport = __esm({
|
|
18885
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
19036
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-transport/index.js"() {
|
|
18886
19037
|
init_smtp_connection();
|
|
18887
19038
|
init_well_known();
|
|
18888
19039
|
init_shared();
|
|
@@ -19017,27 +19168,6 @@ var init_smtp_transport = __esm({
|
|
|
19017
19168
|
connection.close();
|
|
19018
19169
|
return callback(err2);
|
|
19019
19170
|
});
|
|
19020
|
-
connection.once("end", () => {
|
|
19021
|
-
if (returned) {
|
|
19022
|
-
return;
|
|
19023
|
-
}
|
|
19024
|
-
const timer = setTimeout(() => {
|
|
19025
|
-
if (returned) {
|
|
19026
|
-
return;
|
|
19027
|
-
}
|
|
19028
|
-
returned = true;
|
|
19029
|
-
cleanupPerCallAuth();
|
|
19030
|
-
const err2 = new Error("Unexpected socket close");
|
|
19031
|
-
if (connection && connection._socket && connection._socket.upgrading) {
|
|
19032
|
-
err2.code = ETLS;
|
|
19033
|
-
}
|
|
19034
|
-
callback(err2);
|
|
19035
|
-
}, 1e3);
|
|
19036
|
-
try {
|
|
19037
|
-
timer.unref();
|
|
19038
|
-
} catch (_E) {
|
|
19039
|
-
}
|
|
19040
|
-
});
|
|
19041
19171
|
const sendMessage = () => {
|
|
19042
19172
|
const envelope = mail.message.getEnvelope();
|
|
19043
19173
|
const messageId = mail.message.messageId();
|
|
@@ -19056,6 +19186,9 @@ var init_smtp_transport = __esm({
|
|
|
19056
19186
|
messageId
|
|
19057
19187
|
}, "Sending message %s to <%s>", messageId, recipients.join(", "));
|
|
19058
19188
|
connection.send(envelope, mail.message.createReadStream(), (err2, info) => {
|
|
19189
|
+
if (returned) {
|
|
19190
|
+
return;
|
|
19191
|
+
}
|
|
19059
19192
|
returned = true;
|
|
19060
19193
|
cleanupPerCallAuth();
|
|
19061
19194
|
connection.close();
|
|
@@ -19081,21 +19214,26 @@ var init_smtp_transport = __esm({
|
|
|
19081
19214
|
}
|
|
19082
19215
|
});
|
|
19083
19216
|
};
|
|
19084
|
-
connection.connect(() => {
|
|
19217
|
+
connection.connect((err2) => {
|
|
19085
19218
|
if (returned) {
|
|
19086
19219
|
return;
|
|
19087
19220
|
}
|
|
19221
|
+
if (err2) {
|
|
19222
|
+
returned = true;
|
|
19223
|
+
connection.close();
|
|
19224
|
+
return callback(err2);
|
|
19225
|
+
}
|
|
19088
19226
|
perCallAuth = this.getAuth(mail.data.auth);
|
|
19089
19227
|
if (perCallAuth && (connection.allowsAuth || options.forceAuth)) {
|
|
19090
|
-
connection.login(perCallAuth, (
|
|
19228
|
+
connection.login(perCallAuth, (err3) => {
|
|
19091
19229
|
cleanupPerCallAuth();
|
|
19092
19230
|
if (returned) {
|
|
19093
19231
|
return;
|
|
19094
19232
|
}
|
|
19095
|
-
if (
|
|
19233
|
+
if (err3) {
|
|
19096
19234
|
returned = true;
|
|
19097
19235
|
connection.close();
|
|
19098
|
-
return callback(
|
|
19236
|
+
return callback(err3);
|
|
19099
19237
|
}
|
|
19100
19238
|
sendMessage();
|
|
19101
19239
|
});
|
|
@@ -19112,9 +19250,10 @@ var init_smtp_transport = __esm({
|
|
|
19112
19250
|
callback = callbackPromise(resolve5, reject);
|
|
19113
19251
|
});
|
|
19114
19252
|
}
|
|
19253
|
+
const done = callback;
|
|
19115
19254
|
this.getSocket(this.options, (err, socketOptions) => {
|
|
19116
19255
|
if (err) {
|
|
19117
|
-
return
|
|
19256
|
+
return done(err);
|
|
19118
19257
|
}
|
|
19119
19258
|
let options = this.options;
|
|
19120
19259
|
if (socketOptions && socketOptions.connection) {
|
|
@@ -19144,7 +19283,7 @@ var init_smtp_transport = __esm({
|
|
|
19144
19283
|
returned = true;
|
|
19145
19284
|
cleanupPerCallAuth();
|
|
19146
19285
|
connection.close();
|
|
19147
|
-
return
|
|
19286
|
+
return done(err2);
|
|
19148
19287
|
});
|
|
19149
19288
|
connection.once("end", () => {
|
|
19150
19289
|
if (returned) {
|
|
@@ -19152,7 +19291,7 @@ var init_smtp_transport = __esm({
|
|
|
19152
19291
|
}
|
|
19153
19292
|
returned = true;
|
|
19154
19293
|
cleanupPerCallAuth();
|
|
19155
|
-
return
|
|
19294
|
+
return done(new Error("Connection closed"));
|
|
19156
19295
|
});
|
|
19157
19296
|
const finalize = () => {
|
|
19158
19297
|
if (returned) {
|
|
@@ -19161,33 +19300,38 @@ var init_smtp_transport = __esm({
|
|
|
19161
19300
|
returned = true;
|
|
19162
19301
|
cleanupPerCallAuth();
|
|
19163
19302
|
connection.quit();
|
|
19164
|
-
return
|
|
19303
|
+
return done(null, true);
|
|
19165
19304
|
};
|
|
19166
|
-
connection.connect(() => {
|
|
19305
|
+
connection.connect((err2) => {
|
|
19167
19306
|
if (returned) {
|
|
19168
19307
|
return;
|
|
19169
19308
|
}
|
|
19309
|
+
if (err2) {
|
|
19310
|
+
returned = true;
|
|
19311
|
+
connection.close();
|
|
19312
|
+
return done(err2);
|
|
19313
|
+
}
|
|
19170
19314
|
perCallAuth = this.getAuth({});
|
|
19171
19315
|
if (perCallAuth && (connection.allowsAuth || options.forceAuth)) {
|
|
19172
|
-
connection.login(perCallAuth, (
|
|
19316
|
+
connection.login(perCallAuth, (err3) => {
|
|
19173
19317
|
cleanupPerCallAuth();
|
|
19174
19318
|
if (returned) {
|
|
19175
19319
|
return;
|
|
19176
19320
|
}
|
|
19177
|
-
if (
|
|
19321
|
+
if (err3) {
|
|
19178
19322
|
returned = true;
|
|
19179
19323
|
connection.close();
|
|
19180
|
-
return
|
|
19324
|
+
return done(err3);
|
|
19181
19325
|
}
|
|
19182
19326
|
finalize();
|
|
19183
19327
|
});
|
|
19184
19328
|
} else if (!perCallAuth && connection.allowsAuth && options.forceAuth) {
|
|
19185
|
-
const
|
|
19186
|
-
|
|
19329
|
+
const err3 = new Error("Authentication info was not provided");
|
|
19330
|
+
err3.code = ENOAUTH;
|
|
19187
19331
|
returned = true;
|
|
19188
19332
|
cleanupPerCallAuth();
|
|
19189
19333
|
connection.close();
|
|
19190
|
-
return
|
|
19334
|
+
return done(err3);
|
|
19191
19335
|
} else {
|
|
19192
19336
|
finalize();
|
|
19193
19337
|
}
|
|
@@ -19209,11 +19353,11 @@ var init_smtp_transport = __esm({
|
|
|
19209
19353
|
}
|
|
19210
19354
|
});
|
|
19211
19355
|
|
|
19212
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
19356
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/sendmail-transport/index.js
|
|
19213
19357
|
import { spawn } from "node:child_process";
|
|
19214
19358
|
var SendmailTransport, sendmail_transport_default;
|
|
19215
19359
|
var init_sendmail_transport = __esm({
|
|
19216
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
19360
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/sendmail-transport/index.js"() {
|
|
19217
19361
|
init_package_info();
|
|
19218
19362
|
init_shared();
|
|
19219
19363
|
init_errors();
|
|
@@ -19354,10 +19498,10 @@ var init_sendmail_transport = __esm({
|
|
|
19354
19498
|
}
|
|
19355
19499
|
});
|
|
19356
19500
|
|
|
19357
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
19501
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/stream-transport/index.js
|
|
19358
19502
|
var StreamTransport, stream_transport_default;
|
|
19359
19503
|
var init_stream_transport = __esm({
|
|
19360
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
19504
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/stream-transport/index.js"() {
|
|
19361
19505
|
init_package_info();
|
|
19362
19506
|
init_shared();
|
|
19363
19507
|
init_le_windows();
|
|
@@ -19451,10 +19595,10 @@ var init_stream_transport = __esm({
|
|
|
19451
19595
|
}
|
|
19452
19596
|
});
|
|
19453
19597
|
|
|
19454
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
19598
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/json-transport/index.js
|
|
19455
19599
|
var JSONTransport, json_transport_default;
|
|
19456
19600
|
var init_json_transport = __esm({
|
|
19457
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
19601
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/json-transport/index.js"() {
|
|
19458
19602
|
init_package_info();
|
|
19459
19603
|
init_shared();
|
|
19460
19604
|
JSONTransport = class {
|
|
@@ -19510,7 +19654,7 @@ var init_json_transport = __esm({
|
|
|
19510
19654
|
}
|
|
19511
19655
|
});
|
|
19512
19656
|
|
|
19513
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
19657
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/ses-transport/index.js
|
|
19514
19658
|
import EventEmitter6 from "node:events";
|
|
19515
19659
|
function tagSesError(err) {
|
|
19516
19660
|
if (err && typeof err === "object" && !err.code) {
|
|
@@ -19520,7 +19664,7 @@ function tagSesError(err) {
|
|
|
19520
19664
|
}
|
|
19521
19665
|
var SESTransport, ses_transport_default;
|
|
19522
19666
|
var init_ses_transport = __esm({
|
|
19523
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
19667
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/ses-transport/index.js"() {
|
|
19524
19668
|
init_package_info();
|
|
19525
19669
|
init_shared();
|
|
19526
19670
|
init_errors();
|
|
@@ -19702,7 +19846,7 @@ var init_ses_transport = __esm({
|
|
|
19702
19846
|
}
|
|
19703
19847
|
});
|
|
19704
19848
|
|
|
19705
|
-
// node_modules/.pnpm/nodemailer@10.0.
|
|
19849
|
+
// node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/nodemailer.js
|
|
19706
19850
|
function createTransport(transporter, defaults) {
|
|
19707
19851
|
let options;
|
|
19708
19852
|
if (
|
|
@@ -19824,7 +19968,7 @@ function getTestMessageUrl(info) {
|
|
|
19824
19968
|
}
|
|
19825
19969
|
var ETHEREAL_API, ETHEREAL_WEB, ETHEREAL_API_KEY, ETHEREAL_CACHE, testAccount, nodemailer, nodemailer_default;
|
|
19826
19970
|
var init_nodemailer = __esm({
|
|
19827
|
-
"node_modules/.pnpm/nodemailer@10.0.
|
|
19971
|
+
"node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/nodemailer.js"() {
|
|
19828
19972
|
init_mailer();
|
|
19829
19973
|
init_shared();
|
|
19830
19974
|
init_smtp_pool();
|
|
@@ -52750,8 +52894,8 @@ var require_constants2 = __commonJS({
|
|
|
52750
52894
|
"use strict";
|
|
52751
52895
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52752
52896
|
exports.SOCKS5_NO_ACCEPTABLE_AUTH = exports.SOCKS5_CUSTOM_AUTH_END = exports.SOCKS5_CUSTOM_AUTH_START = exports.SOCKS_INCOMING_PACKET_SIZES = exports.SocksClientState = exports.Socks5Response = exports.Socks5HostType = exports.Socks5Auth = exports.Socks4Response = exports.SocksCommand = exports.ERRORS = exports.DEFAULT_TIMEOUT = void 0;
|
|
52753
|
-
var
|
|
52754
|
-
exports.DEFAULT_TIMEOUT =
|
|
52897
|
+
var DEFAULT_TIMEOUT2 = 3e4;
|
|
52898
|
+
exports.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT2;
|
|
52755
52899
|
var ERRORS = {
|
|
52756
52900
|
InvalidSocksCommand: "An invalid SOCKS command was provided. Valid options are connect, bind, and associate.",
|
|
52757
52901
|
InvalidSocksCommandForOperation: "An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.",
|
|
@@ -75342,7 +75486,7 @@ function object(shape, params) {
|
|
|
75342
75486
|
return new ZodMiniObject(def);
|
|
75343
75487
|
}
|
|
75344
75488
|
|
|
75345
|
-
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
75489
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.31.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
75346
75490
|
function isZ4Schema(s) {
|
|
75347
75491
|
const schema = s;
|
|
75348
75492
|
return !!schema._zod;
|
|
@@ -76197,7 +76341,7 @@ function preprocess(fn, schema) {
|
|
|
76197
76341
|
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/external.js
|
|
76198
76342
|
config(en_default2());
|
|
76199
76343
|
|
|
76200
|
-
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
76344
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.31.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
76201
76345
|
var LATEST_PROTOCOL_VERSION = "2025-11-25";
|
|
76202
76346
|
var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
|
|
76203
76347
|
var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
|
|
@@ -77728,7 +77872,7 @@ var UrlElicitationRequiredError = class extends McpError {
|
|
|
77728
77872
|
}
|
|
77729
77873
|
};
|
|
77730
77874
|
|
|
77731
|
-
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
77875
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.31.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
|
|
77732
77876
|
function isTerminal(status) {
|
|
77733
77877
|
return status === "completed" || status === "failed" || status === "cancelled";
|
|
77734
77878
|
}
|
|
@@ -79017,7 +79161,7 @@ var zodToJsonSchema = (schema, options) => {
|
|
|
79017
79161
|
return combined;
|
|
79018
79162
|
};
|
|
79019
79163
|
|
|
79020
|
-
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
79164
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.31.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
79021
79165
|
function mapMiniTarget(t) {
|
|
79022
79166
|
if (!t)
|
|
79023
79167
|
return "draft-7";
|
|
@@ -79059,7 +79203,7 @@ function parseWithCompat(schema, data) {
|
|
|
79059
79203
|
return result.data;
|
|
79060
79204
|
}
|
|
79061
79205
|
|
|
79062
|
-
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
79206
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.31.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
|
|
79063
79207
|
var DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
|
|
79064
79208
|
var Protocol = class {
|
|
79065
79209
|
constructor(_options) {
|
|
@@ -80013,7 +80157,7 @@ function mergeCapabilities(base2, additional) {
|
|
|
80013
80157
|
return result;
|
|
80014
80158
|
}
|
|
80015
80159
|
|
|
80016
|
-
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
80160
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.31.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
|
|
80017
80161
|
var import_ajv = __toESM(require_ajv(), 1);
|
|
80018
80162
|
var import_ajv_formats = __toESM(require_dist(), 1);
|
|
80019
80163
|
function createDefaultAjvInstance() {
|
|
@@ -80081,7 +80225,7 @@ var AjvJsonSchemaValidator = class {
|
|
|
80081
80225
|
}
|
|
80082
80226
|
};
|
|
80083
80227
|
|
|
80084
|
-
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
80228
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.31.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
|
|
80085
80229
|
var ExperimentalServerTasks = class {
|
|
80086
80230
|
constructor(_server) {
|
|
80087
80231
|
this._server = _server;
|
|
@@ -80294,7 +80438,7 @@ var ExperimentalServerTasks = class {
|
|
|
80294
80438
|
}
|
|
80295
80439
|
};
|
|
80296
80440
|
|
|
80297
|
-
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
80441
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.31.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
|
|
80298
80442
|
function assertToolsCallTaskCapability(requests, method, entityName) {
|
|
80299
80443
|
if (!requests) {
|
|
80300
80444
|
throw new Error(`${entityName} does not support task creation (required for ${method})`);
|
|
@@ -80329,7 +80473,7 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
|
|
|
80329
80473
|
}
|
|
80330
80474
|
}
|
|
80331
80475
|
|
|
80332
|
-
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
80476
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.31.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
|
|
80333
80477
|
var Server = class extends Protocol {
|
|
80334
80478
|
/**
|
|
80335
80479
|
* Initializes this server with the given name and version information.
|
|
@@ -80700,7 +80844,7 @@ var Server = class extends Protocol {
|
|
|
80700
80844
|
}
|
|
80701
80845
|
};
|
|
80702
80846
|
|
|
80703
|
-
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
80847
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.31.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js
|
|
80704
80848
|
var COMPLETABLE_SYMBOL = /* @__PURE__ */ Symbol.for("mcp.completable");
|
|
80705
80849
|
function isCompletable(schema) {
|
|
80706
80850
|
return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
|
|
@@ -80714,7 +80858,7 @@ var McpZodTypeKind;
|
|
|
80714
80858
|
McpZodTypeKind2["Completable"] = "McpCompletable";
|
|
80715
80859
|
})(McpZodTypeKind || (McpZodTypeKind = {}));
|
|
80716
80860
|
|
|
80717
|
-
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
80861
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.31.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.js
|
|
80718
80862
|
var MAX_TEMPLATE_LENGTH = 1e6;
|
|
80719
80863
|
var MAX_VARIABLE_LENGTH = 1e6;
|
|
80720
80864
|
var MAX_TEMPLATE_EXPRESSIONS = 1e4;
|
|
@@ -80936,7 +81080,7 @@ var UriTemplate = class _UriTemplate {
|
|
|
80936
81080
|
}
|
|
80937
81081
|
};
|
|
80938
81082
|
|
|
80939
|
-
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
81083
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.31.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js
|
|
80940
81084
|
var TOOL_NAME_REGEX = /^[A-Za-z0-9._-]{1,128}$/;
|
|
80941
81085
|
function validateToolName(name2) {
|
|
80942
81086
|
const warnings = [];
|
|
@@ -80994,7 +81138,7 @@ function validateAndWarnToolName(name2) {
|
|
|
80994
81138
|
return result.isValid;
|
|
80995
81139
|
}
|
|
80996
81140
|
|
|
80997
|
-
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
81141
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.31.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js
|
|
80998
81142
|
var ExperimentalMcpServerTasks = class {
|
|
80999
81143
|
constructor(_mcpServer) {
|
|
81000
81144
|
this._mcpServer = _mcpServer;
|
|
@@ -81009,7 +81153,7 @@ var ExperimentalMcpServerTasks = class {
|
|
|
81009
81153
|
}
|
|
81010
81154
|
};
|
|
81011
81155
|
|
|
81012
|
-
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
81156
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.31.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
|
|
81013
81157
|
var McpServer = class {
|
|
81014
81158
|
constructor(serverInfo, options) {
|
|
81015
81159
|
this._registeredResources = {};
|
|
@@ -81825,10 +81969,10 @@ var EMPTY_COMPLETION_RESULT = {
|
|
|
81825
81969
|
}
|
|
81826
81970
|
};
|
|
81827
81971
|
|
|
81828
|
-
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
81972
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.31.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
81829
81973
|
import process2 from "node:process";
|
|
81830
81974
|
|
|
81831
|
-
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
81975
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.31.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
|
|
81832
81976
|
var STDIO_DEFAULT_MAX_BUFFER_SIZE = 10 * 1024 * 1024;
|
|
81833
81977
|
var ReadBuffer = class {
|
|
81834
81978
|
constructor(options) {
|
|
@@ -81865,7 +82009,7 @@ function serializeMessage(message) {
|
|
|
81865
82009
|
return JSON.stringify(message) + "\n";
|
|
81866
82010
|
}
|
|
81867
82011
|
|
|
81868
|
-
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
82012
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.31.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
81869
82013
|
var StdioServerTransport = class {
|
|
81870
82014
|
constructor(_stdin = process2.stdin, _stdout = process2.stdout, options) {
|
|
81871
82015
|
this._stdin = _stdin;
|
|
@@ -82181,7 +82325,8 @@ function executeAppleScript(script, options = {}) {
|
|
|
82181
82325
|
lastError = {
|
|
82182
82326
|
success: false,
|
|
82183
82327
|
output: "",
|
|
82184
|
-
error: errorMessage
|
|
82328
|
+
error: errorMessage,
|
|
82329
|
+
...isTimeout ? { timedOut: true } : {}
|
|
82185
82330
|
};
|
|
82186
82331
|
const canRetry = isTimeout || isRetryableError(errorMessage);
|
|
82187
82332
|
const hasAttemptsLeft = attempt < maxRetries;
|
|
@@ -82454,6 +82599,10 @@ function getMailboxScanThreshold() {
|
|
|
82454
82599
|
}
|
|
82455
82600
|
var SEARCH_ACCOUNT_BUDGET_SECONDS = 30;
|
|
82456
82601
|
var SEARCH_ACCOUNT_TIMEOUT_MS = 45e3;
|
|
82602
|
+
var READ_ONLY_BYID_TIMEOUT_MS = 15e3;
|
|
82603
|
+
function timedOutResolvingId(id) {
|
|
82604
|
+
return `AppleScript timed out resolving id ${Number(id)} \u2014 Mail.app's scripting bridge may be wedged; try health-check.`;
|
|
82605
|
+
}
|
|
82457
82606
|
var GROUP_SEP = "";
|
|
82458
82607
|
var FIELD_SEP = "";
|
|
82459
82608
|
var RECORD_SEP = "";
|
|
@@ -84064,6 +84213,7 @@ ${indent}end try${this.sanitizeFragment("_uacct", indent)}${this.sanitizeFragmen
|
|
|
84064
84213
|
* all mailboxes in all accounts to find the message.
|
|
84065
84214
|
*/
|
|
84066
84215
|
getMessageById(id, deepAttachmentCheck = false) {
|
|
84216
|
+
this.lastMessageLookupError = void 0;
|
|
84067
84217
|
const deepScan = deepAttachmentCheck ? `if hasAtt is "false" then
|
|
84068
84218
|
try
|
|
84069
84219
|
set rawSrc to source of msg
|
|
@@ -84105,8 +84255,9 @@ ${indent}end try${this.sanitizeFragment("_uacct", indent)}${this.sanitizeFragmen
|
|
|
84105
84255
|
return ""
|
|
84106
84256
|
end try
|
|
84107
84257
|
`);
|
|
84108
|
-
const result = executeAppleScript(script, { timeoutMs:
|
|
84258
|
+
const result = executeAppleScript(script, { timeoutMs: READ_ONLY_BYID_TIMEOUT_MS });
|
|
84109
84259
|
if (!result.success || !result.output.trim()) {
|
|
84260
|
+
if (result.timedOut) this.lastMessageLookupError = timedOutResolvingId(id);
|
|
84110
84261
|
console.error(`Failed to get message ${id}: ${result.error}`);
|
|
84111
84262
|
return null;
|
|
84112
84263
|
}
|
|
@@ -84263,7 +84414,7 @@ ${indent}end try${this.sanitizeFragment("_uacct", indent)}${this.sanitizeFragmen
|
|
|
84263
84414
|
const scopedScript = this.scopedByIdScript(loc.account, loc.mailbox, id, innerFetch);
|
|
84264
84415
|
const scoped = this.parseMessageContent(
|
|
84265
84416
|
id,
|
|
84266
|
-
executeAppleScript(scopedScript, { timeoutMs:
|
|
84417
|
+
executeAppleScript(scopedScript, { timeoutMs: READ_ONLY_BYID_TIMEOUT_MS }),
|
|
84267
84418
|
includeHtml
|
|
84268
84419
|
);
|
|
84269
84420
|
if (scoped) return scoped;
|
|
@@ -84271,7 +84422,7 @@ ${indent}end try${this.sanitizeFragment("_uacct", indent)}${this.sanitizeFragmen
|
|
|
84271
84422
|
const script = this.unscopedByIdScript(id, innerFetch);
|
|
84272
84423
|
return this.parseMessageContent(
|
|
84273
84424
|
id,
|
|
84274
|
-
executeAppleScript(script, { timeoutMs:
|
|
84425
|
+
executeAppleScript(script, { timeoutMs: READ_ONLY_BYID_TIMEOUT_MS }),
|
|
84275
84426
|
includeHtml
|
|
84276
84427
|
);
|
|
84277
84428
|
}
|
|
@@ -84282,7 +84433,10 @@ ${indent}end try${this.sanitizeFragment("_uacct", indent)}${this.sanitizeFragmen
|
|
|
84282
84433
|
*/
|
|
84283
84434
|
parseMessageContent(id, result, includeHtml) {
|
|
84284
84435
|
if (!result.success || !result.output.trim()) {
|
|
84285
|
-
if (!result.success)
|
|
84436
|
+
if (!result.success) {
|
|
84437
|
+
if (result.timedOut) this.lastMessageLookupError = timedOutResolvingId(id);
|
|
84438
|
+
console.error(`Failed to get message content: ${result.error}`);
|
|
84439
|
+
}
|
|
84286
84440
|
return null;
|
|
84287
84441
|
}
|
|
84288
84442
|
if (result.output.startsWith(LOOKUP_ERROR_MARKER)) {
|
|
@@ -84329,7 +84483,10 @@ ${indent}end try${this.sanitizeFragment("_uacct", indent)}${this.sanitizeFragmen
|
|
|
84329
84483
|
return msgDates & "${DATES_MARKER}" & msgHeaders`;
|
|
84330
84484
|
const parse4 = (result) => {
|
|
84331
84485
|
if (!result.success || !result.output.trim()) {
|
|
84332
|
-
if (!result.success)
|
|
84486
|
+
if (!result.success) {
|
|
84487
|
+
if (result.timedOut) this.lastMessageLookupError = timedOutResolvingId(id);
|
|
84488
|
+
console.error(`Failed to get message headers: ${result.error}`);
|
|
84489
|
+
}
|
|
84333
84490
|
return null;
|
|
84334
84491
|
}
|
|
84335
84492
|
if (result.output.startsWith(LOOKUP_ERROR_MARKER)) {
|
|
@@ -84347,21 +84504,29 @@ ${indent}end try${this.sanitizeFragment("_uacct", indent)}${this.sanitizeFragmen
|
|
|
84347
84504
|
if (loc) {
|
|
84348
84505
|
const scoped = parse4(
|
|
84349
84506
|
executeAppleScript(this.scopedByIdScript(loc.account, loc.mailbox, id, innerFetch), {
|
|
84350
|
-
timeoutMs:
|
|
84507
|
+
timeoutMs: READ_ONLY_BYID_TIMEOUT_MS
|
|
84351
84508
|
})
|
|
84352
84509
|
);
|
|
84353
84510
|
if (scoped) return scoped;
|
|
84354
84511
|
}
|
|
84355
|
-
return parse4(
|
|
84512
|
+
return parse4(
|
|
84513
|
+
executeAppleScript(this.unscopedByIdScript(id, innerFetch), {
|
|
84514
|
+
timeoutMs: READ_ONLY_BYID_TIMEOUT_MS
|
|
84515
|
+
})
|
|
84516
|
+
);
|
|
84356
84517
|
}
|
|
84357
84518
|
/**
|
|
84358
84519
|
* Get the raw MIME source of a message.
|
|
84359
84520
|
* Used as fallback for attachment extraction when AppleScript
|
|
84360
84521
|
* mail attachments returns empty.
|
|
84361
84522
|
*
|
|
84362
|
-
*
|
|
84363
|
-
* the entire raw message
|
|
84364
|
-
*
|
|
84523
|
+
* Uses the same short `READ_ONLY_BYID_TIMEOUT_MS` as the other by-id reads
|
|
84524
|
+
* (#270) — `source of msg` returning the entire raw message, base64
|
|
84525
|
+
* attachments included, is documented elsewhere as taking "several
|
|
84526
|
+
* seconds" for a 20MB attachment over Exchange/IMAP, comfortably inside
|
|
84527
|
+
* that budget; a call still running past it is a wedged scripting bridge,
|
|
84528
|
+
* not legitimate transfer time, so there is no case where the old 120s
|
|
84529
|
+
* ceiling was buying a real result a shorter one would have missed.
|
|
84365
84530
|
*/
|
|
84366
84531
|
getRawSource(id, hint) {
|
|
84367
84532
|
this.lastMessageLookupError = void 0;
|
|
@@ -84373,17 +84538,20 @@ ${indent}end try${this.sanitizeFragment("_uacct", indent)}${this.sanitizeFragmen
|
|
|
84373
84538
|
id,
|
|
84374
84539
|
"return source of msg"
|
|
84375
84540
|
);
|
|
84376
|
-
const scoped = executeAppleScript(scopedScript, { timeoutMs:
|
|
84541
|
+
const scoped = executeAppleScript(scopedScript, { timeoutMs: READ_ONLY_BYID_TIMEOUT_MS });
|
|
84377
84542
|
if (scoped.success && scoped.output.trim() && !scoped.output.startsWith(LOOKUP_ERROR_MARKER)) {
|
|
84378
84543
|
return scoped.output;
|
|
84379
84544
|
}
|
|
84380
84545
|
if (scoped.success && scoped.output.startsWith(LOOKUP_ERROR_MARKER)) {
|
|
84381
84546
|
this.lastMessageLookupError = scoped.output.slice(LOOKUP_ERROR_MARKER.length).trim();
|
|
84547
|
+
} else if (!scoped.success && scoped.timedOut) {
|
|
84548
|
+
this.lastMessageLookupError = timedOutResolvingId(id);
|
|
84382
84549
|
}
|
|
84383
84550
|
}
|
|
84384
84551
|
const script = this.unscopedByIdScript(id, "return source of msg");
|
|
84385
|
-
const result = executeAppleScript(script, { timeoutMs:
|
|
84552
|
+
const result = executeAppleScript(script, { timeoutMs: READ_ONLY_BYID_TIMEOUT_MS });
|
|
84386
84553
|
if (!result.success || !result.output.trim()) {
|
|
84554
|
+
if (result.timedOut) this.lastMessageLookupError = timedOutResolvingId(id);
|
|
84387
84555
|
return null;
|
|
84388
84556
|
}
|
|
84389
84557
|
if (result.output.startsWith(LOOKUP_ERROR_MARKER)) {
|
|
@@ -89007,7 +89175,10 @@ registerTool(
|
|
|
89007
89175
|
seedSubject = subjectFromGetMessage(r.info);
|
|
89008
89176
|
} else {
|
|
89009
89177
|
const msg = mailManager.getMessageById(id);
|
|
89010
|
-
if (!msg)
|
|
89178
|
+
if (!msg) {
|
|
89179
|
+
const lookupError = mailManager.consumeLastMessageLookupError();
|
|
89180
|
+
return errorResponse(lookupError ?? `Message with ID "${id}" not found`);
|
|
89181
|
+
}
|
|
89011
89182
|
seedSubject = msg.subject;
|
|
89012
89183
|
}
|
|
89013
89184
|
if (!seedSubject) return errorResponse(`Could not determine the subject of message "${id}"`);
|