apple-mail-mcp 2.20.10 → 2.20.12

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.
Files changed (3) hide show
  1. package/build/cli.js +291 -191
  2. package/build/index.js +382 -219
  3. package/package.json +1 -1
package/build/cli.js CHANGED
@@ -48,7 +48,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
48
48
  mod
49
49
  ));
50
50
 
51
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/punycode/index.js
51
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/punycode/index.js
52
52
  function error(type) {
53
53
  throw new RangeError(errors[type]);
54
54
  }
@@ -94,7 +94,7 @@ function ucs2decode(string) {
94
94
  }
95
95
  var maxInt, base, tMin, tMax, skew, damp, initialBias, initialN, delimiter, regexPunycode, regexNonASCII, regexSeparators, errors, baseMinusTMin, floor, stringFromCharCode, basicToDigit, digitToBasic, adapt, decode, encode, toUnicode, toASCII;
96
96
  var init_punycode = __esm({
97
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/punycode/index.js"() {
97
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/punycode/index.js"() {
98
98
  maxInt = 2147483647;
99
99
  base = 36;
100
100
  tMin = 1;
@@ -265,7 +265,7 @@ var init_punycode = __esm({
265
265
  }
266
266
  });
267
267
 
268
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/shared/url.js
268
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/shared/url.js
269
269
  import net from "node:net";
270
270
  import urllib from "node:url";
271
271
  function invalidUrl(input) {
@@ -318,7 +318,7 @@ function normalizeHostname(raw, href) {
318
318
  }
319
319
  var SLASHLESS_AUTHORITY, SURROUNDING_WHITESPACE, LEGACY_TRIM, AUTHORITY, FORBIDDEN_HOST_CHARS, CONTROL_CHARS, parse, resolve;
320
320
  var init_url = __esm({
321
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/shared/url.js"() {
321
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/shared/url.js"() {
322
322
  init_punycode();
323
323
  SLASHLESS_AUTHORITY = /^([a-zA-Z][a-zA-Z0-9+.-]*:)(?!\/\/)([\s\S]+)$/;
324
324
  SURROUNDING_WHITESPACE = /^[\x00-\x20]+|[\x00-\x20]+$/g;
@@ -394,11 +394,11 @@ var init_url = __esm({
394
394
  }
395
395
  });
396
396
 
397
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/fetch/cookies.js
397
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/fetch/cookies.js
398
398
  import net2 from "node:net";
399
399
  var SESSION_TIMEOUT, Cookies, cookies_default;
400
400
  var init_cookies = __esm({
401
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/fetch/cookies.js"() {
401
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/fetch/cookies.js"() {
402
402
  init_url();
403
403
  SESSION_TIMEOUT = 1800;
404
404
  Cookies = class {
@@ -476,15 +476,24 @@ var init_cookies = __esm({
476
476
  */
477
477
  parse(cookieStr) {
478
478
  const cookie = {};
479
+ let hasNameValue = false;
479
480
  (cookieStr || "").toString().split(";").forEach((cookiePart) => {
481
+ if (!cookiePart.trim()) {
482
+ return;
483
+ }
480
484
  const valueParts = cookiePart.split("=");
481
- const key = valueParts.shift().trim().toLowerCase();
485
+ const name2 = valueParts.shift().trim();
482
486
  let value = valueParts.join("=").trim();
483
487
  let domain;
484
- if (!key) {
488
+ if (!hasNameValue) {
489
+ hasNameValue = true;
490
+ if (name2) {
491
+ cookie.name = name2;
492
+ cookie.value = value;
493
+ }
485
494
  return;
486
495
  }
487
- switch (key) {
496
+ switch (name2.toLowerCase()) {
488
497
  case "expires": {
489
498
  const expires = new Date(value);
490
499
  if (expires.toString() !== "Invalid Date") {
@@ -511,11 +520,6 @@ var init_cookies = __esm({
511
520
  case "httponly":
512
521
  cookie.httponly = true;
513
522
  break;
514
- default:
515
- if (!cookie.name) {
516
- cookie.name = key;
517
- cookie.value = value;
518
- }
519
523
  }
520
524
  });
521
525
  return cookie;
@@ -608,20 +612,20 @@ var init_cookies = __esm({
608
612
  }
609
613
  });
610
614
 
611
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/package-info.js
615
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/package-info.js
612
616
  var name, version, homepage;
613
617
  var init_package_info = __esm({
614
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/package-info.js"() {
618
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/package-info.js"() {
615
619
  name = "nodemailer";
616
- version = "10.0.13";
620
+ version = "10.0.16";
617
621
  homepage = "https://nodemailer.com/";
618
622
  }
619
623
  });
620
624
 
621
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/errors.js
625
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/errors.js
622
626
  var ECONNECTION, ENOAUTH, EOAUTH2, EMAXLIMIT, EMAXRECIPIENTS, ESENDMAIL, ESES, ECONFIG, EPROXY, EFILEACCESS, EURLACCESS, EFETCH;
623
627
  var init_errors = __esm({
624
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/errors.js"() {
628
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/errors.js"() {
625
629
  ECONNECTION = "ECONNECTION";
626
630
  ENOAUTH = "ENOAUTH";
627
631
  EOAUTH2 = "EOAUTH2";
@@ -637,10 +641,10 @@ var init_errors = __esm({
637
641
  }
638
642
  });
639
643
 
640
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/shared/objects.js
644
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/shared/objects.js
641
645
  var isProtoKey, copyOwnKeys;
642
646
  var init_objects = __esm({
643
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/shared/objects.js"() {
647
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/shared/objects.js"() {
644
648
  isProtoKey = (key) => key === "__proto__";
645
649
  copyOwnKeys = (target, source, skip) => {
646
650
  Object.keys(source || {}).forEach((key) => {
@@ -654,7 +658,7 @@ var init_objects = __esm({
654
658
  }
655
659
  });
656
660
 
657
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/fetch/index.js
661
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/fetch/index.js
658
662
  import http from "node:http";
659
663
  import https from "node:https";
660
664
  import zlib from "node:zlib";
@@ -901,7 +905,7 @@ function nmfetch(url, options) {
901
905
  }
902
906
  var MAX_REDIRECTS, DEFAULT_TIMEOUT, DEFAULT_MAX_BYTES, TLS_OPTION_KEYS, fetch_default;
903
907
  var init_fetch = __esm({
904
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/fetch/index.js"() {
908
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/fetch/index.js"() {
905
909
  init_url();
906
910
  init_cookies();
907
911
  init_package_info();
@@ -939,7 +943,7 @@ var init_fetch = __esm({
939
943
  }
940
944
  });
941
945
 
942
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/shared/index.js
946
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/shared/index.js
943
947
  import util from "node:util";
944
948
  import fs from "node:fs";
945
949
  import dns from "node:dns";
@@ -1080,7 +1084,7 @@ function createDefaultLogger(levels) {
1080
1084
  }
1081
1085
  var DNS_TTL, CACHE_CLEANUP_INTERVAL, MAX_CACHE_SIZE, lastCacheCleanup, networkInterfaces, isFamilySupported, resolve2, dnsCache, formatDNSValue, resolveHostname, parseConnectionUrl, _logFunc, getLogger, callbackPromise, parseDataURI, assign, encodeXText;
1082
1086
  var init_shared = __esm({
1083
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/shared/index.js"() {
1087
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/shared/index.js"() {
1084
1088
  init_url();
1085
1089
  init_fetch();
1086
1090
  init_errors();
@@ -1460,7 +1464,7 @@ var init_shared = __esm({
1460
1464
  }
1461
1465
  });
1462
1466
 
1463
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-funcs/mime-types.js
1467
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/mime-funcs/mime-types.js
1464
1468
  import path from "node:path";
1465
1469
  function detectMimeType(filename) {
1466
1470
  if (!filename) {
@@ -1497,7 +1501,7 @@ function detectExtension(mimeType) {
1497
1501
  }
1498
1502
  var defaultMimeType, defaultExtension, mimeTypes, extensions;
1499
1503
  var init_mime_types = __esm({
1500
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-funcs/mime-types.js"() {
1504
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/mime-funcs/mime-types.js"() {
1501
1505
  defaultMimeType = "application/octet-stream";
1502
1506
  defaultExtension = "bin";
1503
1507
  mimeTypes = /* @__PURE__ */ new Map([
@@ -3562,7 +3566,7 @@ var init_mime_types = __esm({
3562
3566
  }
3563
3567
  });
3564
3568
 
3565
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/base64/index.js
3569
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/base64/index.js
3566
3570
  var base64_exports = {};
3567
3571
  __export(base64_exports, {
3568
3572
  Encoder: () => Encoder,
@@ -3595,7 +3599,7 @@ function wrap(str2, lineLength) {
3595
3599
  }
3596
3600
  var Encoder;
3597
3601
  var init_base64 = __esm({
3598
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/base64/index.js"() {
3602
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/base64/index.js"() {
3599
3603
  Encoder = class extends Transform {
3600
3604
  constructor(options) {
3601
3605
  super();
@@ -3663,7 +3667,7 @@ var init_base64 = __esm({
3663
3667
  }
3664
3668
  });
3665
3669
 
3666
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/qp/index.js
3670
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/qp/index.js
3667
3671
  var qp_exports = {};
3668
3672
  __export(qp_exports, {
3669
3673
  Encoder: () => Encoder2,
@@ -3769,7 +3773,7 @@ function checkRanges(nr, ranges) {
3769
3773
  }
3770
3774
  var MIN_LINE_LENGTH, QP_RANGES, Encoder2;
3771
3775
  var init_qp = __esm({
3772
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/qp/index.js"() {
3776
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/qp/index.js"() {
3773
3777
  MIN_LINE_LENGTH = 4;
3774
3778
  QP_RANGES = [
3775
3779
  [9],
@@ -3834,7 +3838,7 @@ var init_qp = __esm({
3834
3838
  }
3835
3839
  });
3836
3840
 
3837
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-funcs/index.js
3841
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/mime-funcs/index.js
3838
3842
  function isPlainText(value, isParam) {
3839
3843
  const re = isParam ? /[\x00-\x1f\x7f"\u0080-\uFFFF]/ : /[\x00-\x08\x0b\x0c\x0e-\x1f\u0080-\uFFFF]/;
3840
3844
  return typeof value === "string" && !re.test(value);
@@ -3932,7 +3936,7 @@ function buildHeaderValue(structured) {
3932
3936
  paramsArray.push(encodedParam.key + "=" + JSON.stringify(encodedParam.value));
3933
3937
  }
3934
3938
  });
3935
- } else if (/[\s'"\\;:/=(),<>@[\]?]|^-/.test(value2)) {
3939
+ } else if (!value2.length || /[\s'"\\;:/=(),<>@[\]?]|^-/.test(value2)) {
3936
3940
  paramsArray.push(param + "=" + JSON.stringify(value2));
3937
3941
  } else {
3938
3942
  paramsArray.push(param + "=" + value2);
@@ -4040,108 +4044,150 @@ function buildHeaderParam(key, data, maxLength) {
4040
4044
  value: item.line
4041
4045
  }));
4042
4046
  }
4047
+ function _isParamName(name2) {
4048
+ return !!name2 && !isProtoKey(name2);
4049
+ }
4043
4050
  function parseHeaderValue(str2) {
4044
4051
  const response = {
4045
4052
  value: "",
4046
4053
  params: {}
4047
4054
  };
4048
4055
  const setParam = (name2, value2) => {
4049
- if (!isProtoKey(name2)) {
4056
+ name2 = name2.toLowerCase();
4057
+ if (_isParamName(name2) && !Object.prototype.hasOwnProperty.call(response.params, name2)) {
4050
4058
  response.params[name2] = value2;
4051
4059
  }
4052
4060
  };
4053
4061
  let key = false;
4054
4062
  let value = "";
4055
- let type = "value";
4063
+ let stage = "value";
4056
4064
  let quote = false;
4057
4065
  let escaped = false;
4058
4066
  let chr;
4067
+ let pendingSpace = "";
4068
+ let quoteClosed = false;
4069
+ const flushSpace = () => {
4070
+ if (value.length) {
4071
+ value += pendingSpace;
4072
+ }
4073
+ pendingSpace = "";
4074
+ };
4075
+ const addChr = (c) => {
4076
+ flushSpace();
4077
+ value += c;
4078
+ };
4079
+ const takeValue = () => {
4080
+ const taken = value;
4081
+ value = "";
4082
+ pendingSpace = "";
4083
+ quoteClosed = false;
4084
+ return taken;
4085
+ };
4086
+ const storeValue = () => {
4087
+ const taken = takeValue();
4088
+ if (key === false) {
4089
+ response.value = taken;
4090
+ } else {
4091
+ setParam(key, taken);
4092
+ }
4093
+ };
4094
+ const storeEmptyKey = () => {
4095
+ setParam(takeValue().trim(), "");
4096
+ };
4059
4097
  for (let i = 0, len = str2.length; i < len; i++) {
4060
4098
  chr = str2.charAt(i);
4061
- if (type === "key") {
4099
+ if (stage === "key") {
4062
4100
  if (chr === "=") {
4063
- key = value.trim().toLowerCase();
4064
- type = "value";
4065
- value = "";
4101
+ key = takeValue().trim();
4102
+ stage = "value";
4103
+ continue;
4104
+ }
4105
+ if (chr === ";") {
4106
+ storeEmptyKey();
4066
4107
  continue;
4067
4108
  }
4068
4109
  value += chr;
4069
4110
  } else {
4111
+ if (quoteClosed && chr !== ";") {
4112
+ escaped = false;
4113
+ continue;
4114
+ }
4070
4115
  if (escaped) {
4071
- value += chr;
4072
- } else if (chr === "\\") {
4116
+ addChr(chr);
4117
+ } else if (quote && chr === "\\") {
4073
4118
  escaped = true;
4074
4119
  continue;
4075
4120
  } else if (quote && chr === quote) {
4076
4121
  quote = false;
4122
+ quoteClosed = true;
4077
4123
  } else if (!quote && chr === '"') {
4078
4124
  quote = chr;
4125
+ flushSpace();
4079
4126
  } else if (!quote && chr === ";") {
4080
- if (key === false) {
4081
- response.value = value.trim();
4082
- } else {
4083
- setParam(key, value.trim());
4084
- }
4085
- type = "key";
4086
- value = "";
4127
+ storeValue();
4128
+ stage = "key";
4129
+ } else if (!quote && (chr === " " || chr === " ")) {
4130
+ pendingSpace += chr;
4087
4131
  } else {
4088
- value += chr;
4132
+ addChr(chr);
4089
4133
  }
4090
4134
  escaped = false;
4091
4135
  }
4092
4136
  }
4093
- if (type === "value") {
4094
- if (key === false) {
4095
- response.value = value.trim();
4096
- } else {
4097
- setParam(key, value.trim());
4098
- }
4099
- } else if (value.trim()) {
4100
- setParam(value.trim().toLowerCase(), "");
4137
+ if (stage === "value") {
4138
+ storeValue();
4139
+ } else {
4140
+ storeEmptyKey();
4101
4141
  }
4142
+ const continuations = /* @__PURE__ */ new Map();
4102
4143
  Object.keys(response.params).forEach((key2) => {
4103
- let actualKey, nr, match, value2;
4104
- if (match = key2.match(/(\*(\d+)|\*(\d+)\*|\*)$/)) {
4105
- actualKey = key2.substr(0, match.index);
4106
- nr = Number(match[2] || match[3]) || 0;
4107
- if (isProtoKey(actualKey)) {
4108
- delete response.params[key2];
4109
- return;
4110
- }
4111
- if (!response.params[actualKey] || typeof response.params[actualKey] !== "object") {
4112
- response.params[actualKey] = {
4113
- charset: false,
4114
- values: []
4115
- };
4116
- }
4117
- value2 = response.params[key2];
4118
- if (nr === 0 && match[0].substr(-1) === "*" && (match = value2.match(/^([^']*)'[^']*'(.*)$/))) {
4119
- response.params[actualKey].charset = match[1] || "iso-8859-1";
4120
- value2 = match[2];
4121
- }
4122
- response.params[actualKey].values[nr] = value2;
4123
- delete response.params[key2];
4144
+ const match = key2.match(/(\*(\d+)|\*(\d+)\*|\*)$/);
4145
+ if (!match) {
4146
+ return;
4147
+ }
4148
+ const actualKey = key2.substr(0, match.index);
4149
+ const nr = Number(match[2] || match[3]) || 0;
4150
+ const encoded = match[0].substr(-1) === "*";
4151
+ let value2 = response.params[key2];
4152
+ delete response.params[key2];
4153
+ if (!_isParamName(actualKey)) {
4154
+ return;
4124
4155
  }
4156
+ let continuation = continuations.get(actualKey);
4157
+ if (!continuation) {
4158
+ continuation = { charset: false, sections: [] };
4159
+ continuations.set(actualKey, continuation);
4160
+ }
4161
+ const charsetMatch = nr === 0 && encoded ? value2.match(/^([^']*)'[^']*'(.*)$/) : null;
4162
+ if (charsetMatch) {
4163
+ continuation.charset = TOKEN.test(charsetMatch[1]) ? charsetMatch[1] : "iso-8859-1";
4164
+ value2 = charsetMatch[2];
4165
+ }
4166
+ continuation.sections.push({ nr, value: value2, encoded });
4125
4167
  });
4126
- Object.keys(response.params).forEach((key2) => {
4127
- let value2;
4128
- if (response.params[key2] && Array.isArray(response.params[key2].values)) {
4129
- value2 = response.params[key2].values.map((val) => val || "").join("");
4130
- if (response.params[key2].charset) {
4131
- response.params[key2] = "=?" + response.params[key2].charset + "?Q?" + value2.replace(/[=?_\s]/g, (s) => {
4132
- const c = s.charCodeAt(0).toString(16);
4133
- if (s === " ") {
4134
- return "_";
4135
- }
4136
- return "%" + (c.length < 2 ? "0" : "") + c;
4137
- }).replace(/%/g, "=") + "?=";
4138
- } else {
4139
- response.params[key2] = value2;
4140
- }
4168
+ continuations.forEach((continuation, key2) => {
4169
+ if (Object.prototype.hasOwnProperty.call(response.params, key2)) {
4170
+ return;
4171
+ }
4172
+ continuation.sections.sort((a, b) => a.nr - b.nr);
4173
+ if (!continuation.charset) {
4174
+ response.params[key2] = continuation.sections.map((section) => section.value).join("");
4175
+ return;
4141
4176
  }
4177
+ response.params[key2] = "=?" + continuation.charset + "?Q?" + continuation.sections.map(_encodeContinuationSection).join("") + "?=";
4142
4178
  });
4143
4179
  return response;
4144
4180
  }
4181
+ function _encodeContinuationSection(section) {
4182
+ const specials = section.encoded ? /[=?_\s]/g : /[=?_\s%]/g;
4183
+ return section.value.replace(specials, (s) => {
4184
+ const c = s.charCodeAt(0).toString(16);
4185
+ if (s === " ") {
4186
+ return "_";
4187
+ }
4188
+ return "%" + (c.length < 2 ? "0" : "") + c;
4189
+ }).replace(/%/g, "=");
4190
+ }
4145
4191
  function detectExtension2(mimeType) {
4146
4192
  return detectExtension(mimeType);
4147
4193
  }
@@ -4232,16 +4278,18 @@ function safeEncodeURIComponent(str2) {
4232
4278
  }
4233
4279
  return str2.replace(/[\x00-\x1F *'()<>@,;:\\"[\]?=\u007F-\uFFFF]/g, (chr) => encodeURICharComponent(chr));
4234
4280
  }
4281
+ var TOKEN;
4235
4282
  var init_mime_funcs = __esm({
4236
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-funcs/index.js"() {
4283
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/mime-funcs/index.js"() {
4237
4284
  init_base64();
4238
4285
  init_qp();
4239
4286
  init_mime_types();
4240
4287
  init_objects();
4288
+ TOKEN = /^[^\x00-\x20\x7f()<>@,;:\\"/[\]?=]+$/;
4241
4289
  }
4242
4290
  });
4243
4291
 
4244
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/addressparser/index.js
4292
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/addressparser/index.js
4245
4293
  function _quoteLocalPart(address) {
4246
4294
  const lastAt = address.lastIndexOf("@");
4247
4295
  if (lastAt < 0) {
@@ -4474,7 +4522,7 @@ function _handleAddress(tokens, depth) {
4474
4522
  data.text = data.text.join(" ");
4475
4523
  let groupMembers = [];
4476
4524
  if (data.group.length) {
4477
- const parsedGroup = addressparser(data.group.join(","), { _depth: depth + 1 });
4525
+ const parsedGroup = _parseAddressList(data.group.join(","), depth + 1);
4478
4526
  parsedGroup.forEach((member) => {
4479
4527
  if (member.group) {
4480
4528
  groupMembers = groupMembers.concat(member.group);
@@ -4546,7 +4594,7 @@ function _handleAddress(tokens, depth) {
4546
4594
  const addressFromQuotedText = !data.address.length && data.textWasQuoted.some((wasQuoted) => wasQuoted);
4547
4595
  data.text = data.text.join(" ");
4548
4596
  data.address = data.address.join(" ");
4549
- if (addressFromQuotedText && data.text) {
4597
+ if (addressFromQuotedText && data.text.indexOf("@") >= 0) {
4550
4598
  data.address = _quoteLocalPart(data.text);
4551
4599
  data.text = "";
4552
4600
  }
@@ -4569,9 +4617,7 @@ function _handleAddress(tokens, depth) {
4569
4617
  }
4570
4618
  return addresses;
4571
4619
  }
4572
- function addressparser(str2, options) {
4573
- options = options || {};
4574
- const depth = options._depth || 0;
4620
+ function _parseAddressList(str2, depth) {
4575
4621
  if (depth > MAX_NESTED_GROUP_DEPTH) {
4576
4622
  return [];
4577
4623
  }
@@ -4579,7 +4625,7 @@ function addressparser(str2, options) {
4579
4625
  const tokens = tokenizer.tokenize();
4580
4626
  const addresses = [];
4581
4627
  let address = [];
4582
- let parsedAddresses = [];
4628
+ const parsedAddresses = [];
4583
4629
  tokens.forEach((token) => {
4584
4630
  if (token.type === "operator" && (token.value === "," || token.value === ";")) {
4585
4631
  if (address.length) {
@@ -4610,8 +4656,11 @@ function addressparser(str2, options) {
4610
4656
  }
4611
4657
  }
4612
4658
  mergedAddresses.reverse();
4613
- parsedAddresses = mergedAddresses;
4614
- if (options.flatten) {
4659
+ return mergedAddresses;
4660
+ }
4661
+ function addressparser(str2, options) {
4662
+ const parsedAddresses = _parseAddressList(str2, 0);
4663
+ if (options?.flatten) {
4615
4664
  const flatAddresses = [];
4616
4665
  const walkAddressList = (list) => {
4617
4666
  list.forEach((entry) => {
@@ -4628,7 +4677,7 @@ function addressparser(str2, options) {
4628
4677
  }
4629
4678
  var HAS_WHITESPACE, QUOTED_LOCAL_ADDR, ADDR_SPEC, LOOSE_ADDR_SPEC, LOOSE_TEXT_ADDR, Tokenizer, MAX_NESTED_GROUP_DEPTH, addressparser_default;
4630
4679
  var init_addressparser = __esm({
4631
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/addressparser/index.js"() {
4680
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/addressparser/index.js"() {
4632
4681
  HAS_WHITESPACE = /\s/;
4633
4682
  QUOTED_LOCAL_ADDR = /^("(?:[^"\\]|\\[\s\S])*"@\S+)(?:\s+([\s\S]+))?$/;
4634
4683
  ADDR_SPEC = /^[^@\s]+@[^@\s]+$/;
@@ -4642,6 +4691,7 @@ var init_addressparser = __esm({
4642
4691
  this.node = null;
4643
4692
  this.escaped = false;
4644
4693
  this.inDomainLiteral = false;
4694
+ this.afterAt = false;
4645
4695
  this.list = [];
4646
4696
  this.operators = {
4647
4697
  '"': '"',
@@ -4682,10 +4732,11 @@ var init_addressparser = __esm({
4682
4732
  * Checks if a character is an operator or text and acts accordingly
4683
4733
  *
4684
4734
  * @param chr Character from the address field
4735
+ * @param nextChr Character following chr, null at the end of the field
4685
4736
  */
4686
4737
  checkChar(chr, nextChr) {
4687
4738
  if (!this.escaped && !this.operatorExpecting) {
4688
- if (!this.inDomainLiteral && chr === "[") {
4739
+ if (!this.inDomainLiteral && chr === "[" && this.afterAt) {
4689
4740
  this.inDomainLiteral = true;
4690
4741
  } else if (this.inDomainLiteral && (chr === "]" || chr === "," || chr === ";")) {
4691
4742
  this.inDomainLiteral = false;
@@ -4702,20 +4753,26 @@ var init_addressparser = __esm({
4702
4753
  }
4703
4754
  this.list.push(this.node);
4704
4755
  this.node = null;
4756
+ if (chr !== ")") {
4757
+ this.afterAt = false;
4758
+ }
4705
4759
  this.operatorExpecting = "";
4706
4760
  this.escaped = false;
4707
4761
  return;
4708
- } else if (!this.operatorExpecting && !this.inDomainLiteral && chr in this.operators) {
4762
+ } else if (!this.operatorExpecting && !(this.inDomainLiteral && chr === ":") && chr in this.operators) {
4709
4763
  this.node = {
4710
4764
  type: "operator",
4711
4765
  value: chr
4712
4766
  };
4713
4767
  this.list.push(this.node);
4714
4768
  this.node = null;
4769
+ if (chr !== "(") {
4770
+ this.afterAt = false;
4771
+ }
4715
4772
  this.operatorExpecting = this.operators[chr];
4716
4773
  this.escaped = false;
4717
4774
  return;
4718
- } else if (['"', "'"].includes(this.operatorExpecting) && chr === "\\") {
4775
+ } else if (['"', "'", ")"].includes(this.operatorExpecting) && chr === "\\") {
4719
4776
  this.escaped = true;
4720
4777
  return;
4721
4778
  }
@@ -4731,6 +4788,9 @@ var init_addressparser = __esm({
4731
4788
  }
4732
4789
  if (chr.charCodeAt(0) >= 33 || [" ", " "].includes(chr)) {
4733
4790
  this.node.value += chr;
4791
+ if (!this.operatorExpecting && chr !== " " && chr !== " ") {
4792
+ this.afterAt = chr === "@";
4793
+ }
4734
4794
  }
4735
4795
  this.escaped = false;
4736
4796
  }
@@ -4740,11 +4800,11 @@ var init_addressparser = __esm({
4740
4800
  }
4741
4801
  });
4742
4802
 
4743
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-node/last-newline.js
4803
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/mime-node/last-newline.js
4744
4804
  import { Transform as Transform3 } from "node:stream";
4745
4805
  var LastNewline;
4746
4806
  var init_last_newline = __esm({
4747
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-node/last-newline.js"() {
4807
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/mime-node/last-newline.js"() {
4748
4808
  LastNewline = class extends Transform3 {
4749
4809
  constructor() {
4750
4810
  super();
@@ -4774,11 +4834,11 @@ var init_last_newline = __esm({
4774
4834
  }
4775
4835
  });
4776
4836
 
4777
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-node/le-windows.js
4837
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/mime-node/le-windows.js
4778
4838
  import { Transform as Transform4 } from "node:stream";
4779
4839
  var LeWindows;
4780
4840
  var init_le_windows = __esm({
4781
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-node/le-windows.js"() {
4841
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/mime-node/le-windows.js"() {
4782
4842
  LeWindows = class extends Transform4 {
4783
4843
  constructor(options) {
4784
4844
  super(options);
@@ -4816,11 +4876,11 @@ var init_le_windows = __esm({
4816
4876
  }
4817
4877
  });
4818
4878
 
4819
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-node/le-unix.js
4879
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/mime-node/le-unix.js
4820
4880
  import { Transform as Transform5 } from "node:stream";
4821
4881
  var LeUnix;
4822
4882
  var init_le_unix = __esm({
4823
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-node/le-unix.js"() {
4883
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/mime-node/le-unix.js"() {
4824
4884
  LeUnix = class extends Transform5 {
4825
4885
  constructor(options) {
4826
4886
  super(options);
@@ -4851,7 +4911,7 @@ var init_le_unix = __esm({
4851
4911
  }
4852
4912
  });
4853
4913
 
4854
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-node/index.js
4914
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/mime-node/index.js
4855
4915
  import crypto from "node:crypto";
4856
4916
  import fs2 from "node:fs";
4857
4917
  import { PassThrough as PassThrough2 } from "node:stream";
@@ -4871,7 +4931,7 @@ function _stripBoundaryControls(value) {
4871
4931
  }
4872
4932
  var FORMATTED_HEADERS, ATEXT, DOT_ATOM, QUOTED_STRING, PLAIN_ADDRESS, URL_PARSER_UNSAFE, MimeNode, mime_node_default;
4873
4933
  var init_mime_node = __esm({
4874
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mime-node/index.js"() {
4934
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/mime-node/index.js"() {
4875
4935
  init_punycode();
4876
4936
  init_shared();
4877
4937
  init_mime_funcs();
@@ -5837,6 +5897,7 @@ var init_mime_node = __esm({
5837
5897
  *
5838
5898
  * @param addresses An array of address objects
5839
5899
  * @param [uniqueList] An array to be populated with addresses
5900
+ * @param [seenAddresses] Addresses already added to uniqueList, shared with recursive calls to keep deduplication linear
5840
5901
  * @return address string
5841
5902
  * @internal
5842
5903
  */
@@ -5948,7 +6009,7 @@ var init_mime_node = __esm({
5948
6009
  /**
5949
6010
  * If needed, mime encodes the name part
5950
6011
  *
5951
- * @param name Name part of an address
6012
+ * @param value Name part of an address
5952
6013
  * @returns Mime word encoded string if needed
5953
6014
  * @internal
5954
6015
  */
@@ -5998,14 +6059,14 @@ var init_mime_node = __esm({
5998
6059
  }
5999
6060
  });
6000
6061
 
6001
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mail-composer/index.js
6062
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/mail-composer/index.js
6002
6063
  function isContentObject(value) {
6003
6064
  const content = value;
6004
6065
  return typeof value === "object" && !!(content.content || content.path || content.href || content.raw);
6005
6066
  }
6006
6067
  var MailComposer, mail_composer_default;
6007
6068
  var init_mail_composer = __esm({
6008
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mail-composer/index.js"() {
6069
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/mail-composer/index.js"() {
6009
6070
  init_mime_node();
6010
6071
  init_mime_funcs();
6011
6072
  init_shared();
@@ -6492,11 +6553,22 @@ var init_mail_composer = __esm({
6492
6553
  }
6493
6554
  });
6494
6555
 
6495
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/dkim/message-parser.js
6556
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/dkim/message-parser.js
6496
6557
  import { Transform as Transform6 } from "node:stream";
6558
+ function _trimFieldName(str2) {
6559
+ let start = 0;
6560
+ let end = str2.length;
6561
+ while (start < end && (str2.charCodeAt(start) === 32 || str2.charCodeAt(start) === 9)) {
6562
+ start++;
6563
+ }
6564
+ while (end > start && (str2.charCodeAt(end - 1) === 32 || str2.charCodeAt(end - 1) === 9)) {
6565
+ end--;
6566
+ }
6567
+ return str2.slice(start, end);
6568
+ }
6497
6569
  var MessageParser, message_parser_default;
6498
6570
  var init_message_parser = __esm({
6499
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/dkim/message-parser.js"() {
6571
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/dkim/message-parser.js"() {
6500
6572
  MessageParser = class extends Transform6 {
6501
6573
  constructor(options) {
6502
6574
  super(options);
@@ -6615,7 +6687,7 @@ var init_message_parser = __esm({
6615
6687
  }
6616
6688
  }
6617
6689
  return lines.filter((line) => /[^ \t\r]/.test(line)).map((line) => ({
6618
- key: line.substr(0, line.indexOf(":")).replace(/^[ \t]+|[ \t]+$/g, "").toLowerCase(),
6690
+ key: _trimFieldName(line.substr(0, line.indexOf(":"))).toLowerCase(),
6619
6691
  line
6620
6692
  }));
6621
6693
  }
@@ -6624,12 +6696,12 @@ var init_message_parser = __esm({
6624
6696
  }
6625
6697
  });
6626
6698
 
6627
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/dkim/relaxed-body.js
6699
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/dkim/relaxed-body.js
6628
6700
  import { Transform as Transform7 } from "node:stream";
6629
6701
  import crypto2 from "node:crypto";
6630
6702
  var CHAR_CR, CHAR_LF, CHAR_SPACE, CHAR_TAB, CRLF, EMPTY_LINES, RelaxedBody, relaxed_body_default;
6631
6703
  var init_relaxed_body = __esm({
6632
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/dkim/relaxed-body.js"() {
6704
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/dkim/relaxed-body.js"() {
6633
6705
  CHAR_CR = 13;
6634
6706
  CHAR_LF = 10;
6635
6707
  CHAR_SPACE = 32;
@@ -6751,7 +6823,7 @@ var init_relaxed_body = __esm({
6751
6823
  }
6752
6824
  });
6753
6825
 
6754
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/dkim/sign.js
6826
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/dkim/sign.js
6755
6827
  import crypto3 from "node:crypto";
6756
6828
  function unsupportedHashAlgoError(hashAlgo) {
6757
6829
  const err = new Error('Unsupported DKIM hash algorithm "' + hashAlgo + '"');
@@ -6828,7 +6900,7 @@ function relaxedHeaderLine(line) {
6828
6900
  }
6829
6901
  var sign_default;
6830
6902
  var init_sign = __esm({
6831
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/dkim/sign.js"() {
6903
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/dkim/sign.js"() {
6832
6904
  init_punycode();
6833
6905
  init_mime_funcs();
6834
6906
  init_errors();
@@ -6838,14 +6910,14 @@ var init_sign = __esm({
6838
6910
  }
6839
6911
  });
6840
6912
 
6841
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/dkim/index.js
6913
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/dkim/index.js
6842
6914
  import { PassThrough as PassThrough3 } from "node:stream";
6843
6915
  import fs3 from "node:fs";
6844
6916
  import path2 from "node:path";
6845
6917
  import crypto4 from "node:crypto";
6846
6918
  var DKIM_ALGO, MAX_MESSAGE_SIZE, DKIMSigner, DKIM, dkim_default;
6847
6919
  var init_dkim = __esm({
6848
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/dkim/index.js"() {
6920
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/dkim/index.js"() {
6849
6921
  init_message_parser();
6850
6922
  init_relaxed_body();
6851
6923
  init_sign();
@@ -7049,7 +7121,7 @@ var init_dkim = __esm({
7049
7121
  }
7050
7122
  });
7051
7123
 
7052
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-connection/http-proxy-client.js
7124
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/smtp-connection/http-proxy-client.js
7053
7125
  import net5 from "node:net";
7054
7126
  import tls from "node:tls";
7055
7127
  function httpProxyClient(proxyUrl, destinationPort, destinationHost, tlsOptions, callback) {
@@ -7113,18 +7185,25 @@ function httpProxyClient(proxyUrl, destinationPort, destinationHost, tlsOptions,
7113
7185
  Object.keys(reqHeaders).map((key) => key + ": " + reqHeaders[key]).join("\r\n") + // End request
7114
7186
  "\r\n\r\n"
7115
7187
  );
7116
- let headers = "";
7188
+ const chunks = [];
7189
+ let received = 0;
7190
+ let tail = "";
7117
7191
  const onSocketData = (chunk) => {
7118
7192
  let match;
7119
- let remainder;
7120
7193
  if (finished) {
7121
7194
  return;
7122
7195
  }
7123
- headers += chunk.toString("binary");
7124
- if (match = headers.match(/\r\n\r\n/)) {
7196
+ const window = tail + chunk.toString("binary");
7197
+ const windowEnd = window.indexOf("\r\n\r\n");
7198
+ chunks.push(chunk);
7199
+ received += chunk.length;
7200
+ tail = window.slice(-3);
7201
+ if (windowEnd >= 0) {
7125
7202
  socket.removeListener("data", onSocketData);
7126
- remainder = headers.substr(match.index + match[0].length);
7127
- headers = headers.substr(0, match.index);
7203
+ const headerEnd = received - window.length + windowEnd;
7204
+ const response = Buffer.concat(chunks, received).toString("binary");
7205
+ const headers = response.substr(0, headerEnd);
7206
+ const remainder = response.substr(headerEnd + 4);
7128
7207
  if (remainder) {
7129
7208
  socket.unshift(Buffer.from(remainder, "binary"));
7130
7209
  }
@@ -7144,7 +7223,7 @@ function httpProxyClient(proxyUrl, destinationPort, destinationHost, tlsOptions,
7144
7223
  socket.setTimeout(0);
7145
7224
  return done(null, socket);
7146
7225
  }
7147
- if (headers.length > MAX_RESPONSE_HEADER_BYTES) {
7226
+ if (received > MAX_RESPONSE_HEADER_BYTES) {
7148
7227
  socket.removeListener("data", onSocketData);
7149
7228
  const err = new Error("Proxy response headers too large");
7150
7229
  err.code = EPROXY;
@@ -7159,7 +7238,7 @@ function httpProxyClient(proxyUrl, destinationPort, destinationHost, tlsOptions,
7159
7238
  }
7160
7239
  var MAX_RESPONSE_HEADER_BYTES, http_proxy_client_default;
7161
7240
  var init_http_proxy_client = __esm({
7162
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-connection/http-proxy-client.js"() {
7241
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/smtp-connection/http-proxy-client.js"() {
7163
7242
  init_url();
7164
7243
  init_errors();
7165
7244
  MAX_RESPONSE_HEADER_BYTES = 64 * 1024;
@@ -7167,10 +7246,10 @@ var init_http_proxy_client = __esm({
7167
7246
  }
7168
7247
  });
7169
7248
 
7170
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mailer/mail-message.js
7249
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/mailer/mail-message.js
7171
7250
  var hasOwn, MailMessage;
7172
7251
  var init_mail_message = __esm({
7173
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mailer/mail-message.js"() {
7252
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/mailer/mail-message.js"() {
7174
7253
  init_shared();
7175
7254
  init_mime_node();
7176
7255
  init_mime_funcs();
@@ -7427,7 +7506,7 @@ var init_mail_message = __esm({
7427
7506
  }
7428
7507
  });
7429
7508
 
7430
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mailer/index.js
7509
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/mailer/index.js
7431
7510
  import { EventEmitter } from "node:events";
7432
7511
  import util2 from "node:util";
7433
7512
  import net6 from "node:net";
@@ -7435,7 +7514,7 @@ import dns2 from "node:dns";
7435
7514
  import crypto5 from "node:crypto";
7436
7515
  var DEFAULT_MAX_RECIPIENTS, Mail, mailer_default;
7437
7516
  var init_mailer = __esm({
7438
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/mailer/index.js"() {
7517
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/mailer/index.js"() {
7439
7518
  init_shared();
7440
7519
  init_mime_types();
7441
7520
  init_mail_composer();
@@ -7780,11 +7859,11 @@ var init_mailer = __esm({
7780
7859
  }
7781
7860
  });
7782
7861
 
7783
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-connection/data-stream.js
7862
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/smtp-connection/data-stream.js
7784
7863
  import { Transform as Transform8 } from "node:stream";
7785
7864
  var INSERT_LF, INSERT_LF_DOT, INSERT_CR, INSERT_DOT, DataStream;
7786
7865
  var init_data_stream = __esm({
7787
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-connection/data-stream.js"() {
7866
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/smtp-connection/data-stream.js"() {
7788
7867
  INSERT_LF = Buffer.from("\n");
7789
7868
  INSERT_LF_DOT = Buffer.from("\n.");
7790
7869
  INSERT_CR = Buffer.from("\r");
@@ -7871,7 +7950,7 @@ var init_data_stream = __esm({
7871
7950
  }
7872
7951
  });
7873
7952
 
7874
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-connection/index.js
7953
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/smtp-connection/index.js
7875
7954
  import { EventEmitter as EventEmitter2 } from "node:events";
7876
7955
  import net7 from "node:net";
7877
7956
  import tls2 from "node:tls";
@@ -7893,7 +7972,7 @@ function isPartialLine(line) {
7893
7972
  }
7894
7973
  var CONNECTION_TIMEOUT, SOCKET_TIMEOUT, GREETING_TIMEOUT, DNS_TIMEOUT, TEARDOWN_NOOP, MAX_RESPONSE_SIZE, SMTPConnection, smtp_connection_default;
7895
7974
  var init_smtp_connection = __esm({
7896
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-connection/index.js"() {
7975
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/smtp-connection/index.js"() {
7897
7976
  init_package_info();
7898
7977
  init_data_stream();
7899
7978
  init_shared();
@@ -8338,7 +8417,7 @@ var init_smtp_connection = __esm({
8338
8417
  *
8339
8418
  * @param envelope Envelope object, {from: addr, to: [addr]}
8340
8419
  * @param message String, Buffer or a Stream
8341
- * @param callback Callback to return once sending is completed
8420
+ * @param done Callback to return once sending is completed
8342
8421
  */
8343
8422
  send(envelope, message, done) {
8344
8423
  let returned = false;
@@ -8526,6 +8605,8 @@ var init_smtp_connection = __esm({
8526
8605
  * @event
8527
8606
  * @param err Error object
8528
8607
  * @param type Error name
8608
+ * @param data Server response that triggered the error, false if there is none
8609
+ * @param command SMTP command that was in flight
8529
8610
  * @internal
8530
8611
  */
8531
8612
  _onError(err, type, data, command) {
@@ -8753,6 +8834,7 @@ var init_smtp_connection = __esm({
8753
8834
  * {from:'...', to:['...']}
8754
8835
  * or
8755
8836
  * {from:{address:'...',name:'...'}, to:[address:'...',name:'...']}
8837
+ * @param callback Callback to run once the envelope is processed
8756
8838
  * @internal
8757
8839
  */
8758
8840
  _setEnvelope(envelope, callback) {
@@ -9097,6 +9179,7 @@ var init_smtp_connection = __esm({
9097
9179
  * hosts invalidly use a longer message than VXNlcm5hbWU6
9098
9180
  *
9099
9181
  * @param str Message from the server
9182
+ * @param callback Callback to run once the authentication sequence completes
9100
9183
  * @internal
9101
9184
  */
9102
9185
  _actionAUTH_LOGIN_USER(str2, callback) {
@@ -9117,6 +9200,7 @@ var init_smtp_connection = __esm({
9117
9200
  * base64 encoded again.
9118
9201
  *
9119
9202
  * @param str Message from the server
9203
+ * @param callback Callback to run once the authentication sequence completes
9120
9204
  * @internal
9121
9205
  */
9122
9206
  _actionAUTH_CRAM_MD5(str2, callback) {
@@ -9142,6 +9226,7 @@ var init_smtp_connection = __esm({
9142
9226
  * the user can be considered logged in. Start waiting for a message to send
9143
9227
  *
9144
9228
  * @param str Message from the server
9229
+ * @param callback Callback to run once the authentication sequence completes
9145
9230
  * @internal
9146
9231
  */
9147
9232
  _actionAUTH_CRAM_MD5_PASS(str2, callback) {
@@ -9163,6 +9248,7 @@ var init_smtp_connection = __esm({
9163
9248
  * response needs to be base64 encoded password.
9164
9249
  *
9165
9250
  * @param str Message from the server
9251
+ * @param callback Callback to run once the authentication sequence completes
9166
9252
  * @internal
9167
9253
  */
9168
9254
  _actionAUTH_LOGIN_PASS(str2, callback) {
@@ -9183,6 +9269,8 @@ var init_smtp_connection = __esm({
9183
9269
  * the user can be considered logged in. Start waiting for a message to send
9184
9270
  *
9185
9271
  * @param str Message from the server
9272
+ * @param isRetry True if this is a retry after a failed login, or the callback itself
9273
+ * @param [callback] Callback to run once the authentication sequence completes
9186
9274
  * @internal
9187
9275
  */
9188
9276
  _actionAUTHComplete(str2, isRetry, callback) {
@@ -9223,6 +9311,7 @@ var init_smtp_connection = __esm({
9223
9311
  * Handle response for a MAIL FROM: command
9224
9312
  *
9225
9313
  * @param str Message from the server
9314
+ * @param callback Callback to run once the envelope is processed
9226
9315
  * @internal
9227
9316
  */
9228
9317
  _actionMAIL(str2, callback) {
@@ -9249,6 +9338,7 @@ var init_smtp_connection = __esm({
9249
9338
  * Handle response for a RCPT TO: command
9250
9339
  *
9251
9340
  * @param str Message from the server
9341
+ * @param callback Callback to run once the envelope is processed
9252
9342
  * @internal
9253
9343
  */
9254
9344
  _actionRCPT(str2, callback) {
@@ -9291,6 +9381,7 @@ var init_smtp_connection = __esm({
9291
9381
  * Handle response for a DATA command
9292
9382
  *
9293
9383
  * @param str Message from the server
9384
+ * @param callback Callback to run once the envelope is processed
9294
9385
  * @internal
9295
9386
  */
9296
9387
  _actionDATA(str2, callback) {
@@ -9315,6 +9406,7 @@ var init_smtp_connection = __esm({
9315
9406
  * We expect a single response that defines if the sending succeeded or failed
9316
9407
  *
9317
9408
  * @param str Message from the server
9409
+ * @param callback Callback to run with the final send result
9318
9410
  * @internal
9319
9411
  */
9320
9412
  _actionSMTPStream(str2, callback) {
@@ -9331,6 +9423,7 @@ var init_smtp_connection = __esm({
9331
9423
  * @param recipient The recipient this response applies to
9332
9424
  * @param final Is this the final recipient?
9333
9425
  * @param str Message from the server
9426
+ * @param callback Callback to run with the final send result
9334
9427
  * @internal
9335
9428
  */
9336
9429
  _actionLMTPStream(recipient, final, str2, callback) {
@@ -9412,12 +9505,12 @@ var init_smtp_connection = __esm({
9412
9505
  }
9413
9506
  });
9414
9507
 
9415
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/xoauth2/index.js
9508
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/xoauth2/index.js
9416
9509
  import { Stream } from "node:stream";
9417
9510
  import crypto7 from "node:crypto";
9418
9511
  var XOAuth2, xoauth2_default;
9419
9512
  var init_xoauth2 = __esm({
9420
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/xoauth2/index.js"() {
9513
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/xoauth2/index.js"() {
9421
9514
  init_fetch();
9422
9515
  init_shared();
9423
9516
  init_errors();
@@ -9747,11 +9840,11 @@ var init_xoauth2 = __esm({
9747
9840
  }
9748
9841
  });
9749
9842
 
9750
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-pool/pool-resource.js
9843
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/smtp-pool/pool-resource.js
9751
9844
  import { EventEmitter as EventEmitter3 } from "node:events";
9752
9845
  var PoolResource;
9753
9846
  var init_pool_resource = __esm({
9754
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-pool/pool-resource.js"() {
9847
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/smtp-pool/pool-resource.js"() {
9755
9848
  init_smtp_connection();
9756
9849
  init_shared();
9757
9850
  init_xoauth2();
@@ -9955,10 +10048,10 @@ var init_pool_resource = __esm({
9955
10048
  }
9956
10049
  });
9957
10050
 
9958
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/well-known/services.js
10051
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/well-known/services.js
9959
10052
  var services;
9960
10053
  var init_services = __esm({
9961
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/well-known/services.js"() {
10054
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/well-known/services.js"() {
9962
10055
  services = {
9963
10056
  "126": {
9964
10057
  "description": "126 Mail (NetEase)",
@@ -10271,6 +10364,12 @@ var init_services = __esm({
10271
10364
  "host": "mailosaur.io",
10272
10365
  "port": 25
10273
10366
  },
10367
+ "MailSenpai": {
10368
+ "description": "MailSenpai (SMTP Senpai, EU)",
10369
+ "host": "relay.mailsenpai.com",
10370
+ "port": 2525,
10371
+ "secure": false
10372
+ },
10274
10373
  "Mailtrap": {
10275
10374
  "description": "Mailtrap",
10276
10375
  "host": "live.smtp.mailtrap.io",
@@ -10626,7 +10725,7 @@ var init_services = __esm({
10626
10725
  }
10627
10726
  });
10628
10727
 
10629
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/well-known/index.js
10728
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/well-known/index.js
10630
10729
  function normalizeKey(key) {
10631
10730
  return key.replace(/[^a-zA-Z0-9.-]/g, "").toLowerCase();
10632
10731
  }
@@ -10645,7 +10744,7 @@ function wellKnown(key) {
10645
10744
  }
10646
10745
  var normalized;
10647
10746
  var init_well_known = __esm({
10648
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/well-known/index.js"() {
10747
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/well-known/index.js"() {
10649
10748
  init_services();
10650
10749
  normalized = {};
10651
10750
  Object.keys(services).forEach((key) => {
@@ -10662,11 +10761,11 @@ var init_well_known = __esm({
10662
10761
  }
10663
10762
  });
10664
10763
 
10665
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-pool/index.js
10764
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/smtp-pool/index.js
10666
10765
  import { EventEmitter as EventEmitter4 } from "node:events";
10667
10766
  var REQUEUE_BASE_DELAY, REQUEUE_MAX_DELAY, SMTPPool, smtp_pool_default;
10668
10767
  var init_smtp_pool = __esm({
10669
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-pool/index.js"() {
10768
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/smtp-pool/index.js"() {
10670
10769
  init_pool_resource();
10671
10770
  init_smtp_connection();
10672
10771
  init_well_known();
@@ -11155,11 +11254,11 @@ var init_smtp_pool = __esm({
11155
11254
  }
11156
11255
  });
11157
11256
 
11158
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-transport/index.js
11257
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/smtp-transport/index.js
11159
11258
  import { EventEmitter as EventEmitter5 } from "node:events";
11160
11259
  var SMTPTransport, smtp_transport_default;
11161
11260
  var init_smtp_transport = __esm({
11162
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/smtp-transport/index.js"() {
11261
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/smtp-transport/index.js"() {
11163
11262
  init_smtp_connection();
11164
11263
  init_well_known();
11165
11264
  init_shared();
@@ -11479,11 +11578,11 @@ var init_smtp_transport = __esm({
11479
11578
  }
11480
11579
  });
11481
11580
 
11482
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/sendmail-transport/index.js
11581
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/sendmail-transport/index.js
11483
11582
  import { spawn } from "node:child_process";
11484
11583
  var SendmailTransport, sendmail_transport_default;
11485
11584
  var init_sendmail_transport = __esm({
11486
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/sendmail-transport/index.js"() {
11585
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/sendmail-transport/index.js"() {
11487
11586
  init_package_info();
11488
11587
  init_shared();
11489
11588
  init_errors();
@@ -11624,10 +11723,10 @@ var init_sendmail_transport = __esm({
11624
11723
  }
11625
11724
  });
11626
11725
 
11627
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/stream-transport/index.js
11726
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/stream-transport/index.js
11628
11727
  var StreamTransport, stream_transport_default;
11629
11728
  var init_stream_transport = __esm({
11630
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/stream-transport/index.js"() {
11729
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/stream-transport/index.js"() {
11631
11730
  init_package_info();
11632
11731
  init_shared();
11633
11732
  init_le_windows();
@@ -11721,10 +11820,10 @@ var init_stream_transport = __esm({
11721
11820
  }
11722
11821
  });
11723
11822
 
11724
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/json-transport/index.js
11823
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/json-transport/index.js
11725
11824
  var JSONTransport, json_transport_default;
11726
11825
  var init_json_transport = __esm({
11727
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/json-transport/index.js"() {
11826
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/json-transport/index.js"() {
11728
11827
  init_package_info();
11729
11828
  init_shared();
11730
11829
  JSONTransport = class {
@@ -11780,7 +11879,7 @@ var init_json_transport = __esm({
11780
11879
  }
11781
11880
  });
11782
11881
 
11783
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/ses-transport/index.js
11882
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/ses-transport/index.js
11784
11883
  import EventEmitter6 from "node:events";
11785
11884
  function tagSesError(err) {
11786
11885
  if (err && typeof err === "object" && !err.code) {
@@ -11790,7 +11889,7 @@ function tagSesError(err) {
11790
11889
  }
11791
11890
  var SESTransport, ses_transport_default;
11792
11891
  var init_ses_transport = __esm({
11793
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/ses-transport/index.js"() {
11892
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/ses-transport/index.js"() {
11794
11893
  init_package_info();
11795
11894
  init_shared();
11796
11895
  init_errors();
@@ -11972,7 +12071,7 @@ var init_ses_transport = __esm({
11972
12071
  }
11973
12072
  });
11974
12073
 
11975
- // node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/nodemailer.js
12074
+ // node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/nodemailer.js
11976
12075
  function createTransport(transporter, defaults) {
11977
12076
  let options;
11978
12077
  if (
@@ -12094,7 +12193,7 @@ function getTestMessageUrl(info) {
12094
12193
  }
12095
12194
  var ETHEREAL_API, ETHEREAL_WEB, ETHEREAL_API_KEY, ETHEREAL_CACHE, testAccount, nodemailer, nodemailer_default;
12096
12195
  var init_nodemailer = __esm({
12097
- "node_modules/.pnpm/nodemailer@10.0.13/node_modules/nodemailer/dist/esm/nodemailer.js"() {
12196
+ "node_modules/.pnpm/nodemailer@10.0.16/node_modules/nodemailer/dist/esm/nodemailer.js"() {
12098
12197
  init_mailer();
12099
12198
  init_shared();
12100
12199
  init_smtp_pool();
@@ -58328,23 +58427,9 @@ function buildCriteria(a, listMode) {
58328
58427
  if (a.dateTo) c.before = new Date(a.dateTo);
58329
58428
  if (a.flagColorIndex !== void 0) {
58330
58429
  c.flagged = true;
58331
- Object.assign(c, flagColorSearchTerm(a.flagColorIndex));
58332
58430
  }
58333
58431
  return c;
58334
58432
  }
58335
- function flagColorSearchTerm(colorIndex) {
58336
- const { set, clear } = mailFlagBitsFor(colorIndex);
58337
- const terms = [
58338
- ...set.map((kw) => ({ keyword: kw })),
58339
- ...clear.map((kw) => ({ unKeyword: kw }))
58340
- ];
58341
- if (terms.length === 0) return {};
58342
- if (terms.length === 1) return terms[0];
58343
- const negated = terms.map(
58344
- (t) => "keyword" in t ? { unKeyword: t.keyword } : { keyword: t.unKeyword }
58345
- );
58346
- return { not: { or: negated } };
58347
- }
58348
58433
  function validDate(d) {
58349
58434
  if (!d) return void 0;
58350
58435
  const parsed = d instanceof Date ? d : new Date(d);
@@ -58493,6 +58578,16 @@ async function searchUids(client, path3, criteria, size) {
58493
58578
  `IMAP SEARCH on "${path3}"${sized} failed: ` + (cause ? errText(cause) : "the server rejected it or the connection dropped before it answered (on a mailbox this size, usually a server-side timeout)")
58494
58579
  );
58495
58580
  }
58581
+ async function filterUidsByColor(client, uids, colorIndex) {
58582
+ if (uids.length === 0) return uids;
58583
+ const keep = /* @__PURE__ */ new Set();
58584
+ for await (const msg of client.fetch(uids.join(","), { uid: true, flags: true }, { uid: true })) {
58585
+ if (typeof msg?.uid !== "number") continue;
58586
+ const idx = mailFlagColorIndex(msg.flags);
58587
+ if (colorIndex === 0 ? idx === void 0 : idx === colorIndex) keep.add(msg.uid);
58588
+ }
58589
+ return uids.filter((uid) => keep.has(uid));
58590
+ }
58496
58591
  function mergeFetched(into, msg) {
58497
58592
  const prev = into.get(msg.uid);
58498
58593
  if (!prev) {
@@ -58648,14 +58743,15 @@ async function listLargeMailbox(client, exists, page) {
58648
58743
  totalExact: true
58649
58744
  };
58650
58745
  }
58651
- async function searchLargeMailbox(client, path3, criteria, exists, page) {
58746
+ async function searchLargeMailbox(client, path3, criteria, exists, page, colorIndex) {
58652
58747
  const walk = await walkWindows(exists, page, FIRST_SEARCH_WINDOW, async (lo, hi, width) => {
58653
- const found = await searchUids(client, path3, { ...criteria, seq: `${lo}:${hi}` }, exists);
58748
+ let found = await searchUids(client, path3, { ...criteria, seq: `${lo}:${hi}` }, exists);
58654
58749
  if (found.length > width) {
58655
58750
  throw new Error(
58656
58751
  `IMAP SEARCH on "${path3}" reported ${found.length} matches in a ${width}-message window \u2014 discarding as corrupted rather than trusting it (see #246).`
58657
58752
  );
58658
58753
  }
58754
+ if (colorIndex !== void 0) found = await filterUidsByColor(client, found, colorIndex);
58659
58755
  return found;
58660
58756
  });
58661
58757
  return {
@@ -58664,14 +58760,14 @@ async function searchLargeMailbox(client, path3, criteria, exists, page) {
58664
58760
  totalExact: walk.exhausted
58665
58761
  };
58666
58762
  }
58667
- async function fetchMailboxMatches(client, path3, criteria, page) {
58763
+ async function fetchMailboxMatches(client, path3, criteria, page, colorIndex) {
58668
58764
  const lock = await client.getMailboxLock(path3);
58669
58765
  try {
58670
58766
  const exists = await statusMessageCount(client, path3);
58671
58767
  if (exists === 0) return { messages: [], omitted: [], total: 0, totalExact: true };
58672
58768
  if (exists !== void 0 && exists > LARGE_MAILBOX_MESSAGES) {
58673
58769
  try {
58674
- return isUnfiltered(criteria) ? await listLargeMailbox(client, exists, page) : await searchLargeMailbox(client, path3, criteria, exists, page);
58770
+ return isUnfiltered(criteria) ? await listLargeMailbox(client, exists, page) : await searchLargeMailbox(client, path3, criteria, exists, page, colorIndex);
58675
58771
  } catch (error2) {
58676
58772
  const detail = errText(error2);
58677
58773
  throw new Error(
@@ -58679,16 +58775,20 @@ async function fetchMailboxMatches(client, path3, criteria, page) {
58679
58775
  );
58680
58776
  }
58681
58777
  }
58682
- const uids = await searchUids(client, path3, criteria, exists);
58683
- if (uids.length === 0 || page.take === 0) {
58684
- return { messages: [], omitted: [], total: uids.length, totalExact: true };
58778
+ const rawUids = await searchUids(client, path3, criteria, exists);
58779
+ if (rawUids.length === 0) {
58780
+ return { messages: [], omitted: [], total: 0, totalExact: true };
58685
58781
  }
58686
58782
  const messages = exists ?? (await client.status(path3, { messages: true })).messages ?? void 0;
58687
- if (typeof messages === "number" && uids.length > messages) {
58783
+ if (typeof messages === "number" && rawUids.length > messages) {
58688
58784
  throw new Error(
58689
- `IMAP SEARCH on "${path3}" reported ${uids.length} matches, more than the mailbox's own ${messages} messages \u2014 discarding as corrupted rather than trusting it (see #246).`
58785
+ `IMAP SEARCH on "${path3}" reported ${rawUids.length} matches, more than the mailbox's own ${messages} messages \u2014 discarding as corrupted rather than trusting it (see #246).`
58690
58786
  );
58691
58787
  }
58788
+ const uids = colorIndex !== void 0 ? await filterUidsByColor(client, rawUids, colorIndex) : rawUids;
58789
+ if (uids.length === 0 || page.take === 0) {
58790
+ return { messages: [], omitted: [], total: uids.length, totalExact: true };
58791
+ }
58692
58792
  const newest = uids.slice().reverse().slice(page.skip, page.skip + page.take);
58693
58793
  return { ...pageRows(await fetchRows(client, newest)), total: uids.length, totalExact: true };
58694
58794
  } finally {
@@ -58738,7 +58838,7 @@ async function run(args, listMode, deps) {
58738
58838
  }
58739
58839
  try {
58740
58840
  const outcome = await raceStop(
58741
- fetchMailboxMatches(client, path3, criteria, page),
58841
+ fetchMailboxMatches(client, path3, criteria, page, args.flagColorIndex),
58742
58842
  deps.signal
58743
58843
  );
58744
58844
  if (outcome === STOPPED) {