@bobfrankston/mailx-imap 0.1.121 → 0.1.124
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/index.js +32 -7
- package/package.json +7 -7
package/index.js
CHANGED
|
@@ -5226,12 +5226,27 @@ export class ImapManager extends EventEmitter {
|
|
|
5226
5226
|
auth = { method: "XOAUTH2", user: smtpUser, token };
|
|
5227
5227
|
}
|
|
5228
5228
|
const parseAddrs = (s) => s.match(/[\w.+-]+@[\w.-]+/g) || [];
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5229
|
+
// Parse recipients from the HEADER SECTION only — never the body.
|
|
5230
|
+
// `/^Cc:/m` over the whole raw file matched header-looking lines in
|
|
5231
|
+
// the QUOTED REPLY CHAIN: a reply whose real headers had no Cc
|
|
5232
|
+
// picked up the quoted message's Cc, silently adding its addresses
|
|
5233
|
+
// to RCPT TO — one stranger got a copy, and a quoted-printable
|
|
5234
|
+
// soft-wrap truncated another mid-domain ("bworobey@gmail=" →
|
|
5235
|
+
// envelope bworobey@gmail → receiving qmail padded its default
|
|
5236
|
+
// domain → bounce; Bob 2026-07-21 "I didn't see him in the To
|
|
5237
|
+
// list"). Headers end at the first blank line. Folded continuation
|
|
5238
|
+
// lines are unfolded first, which ALSO fixes the old single-line
|
|
5239
|
+
// regex silently dropping every recipient after the first fold of
|
|
5240
|
+
// a long To: list.
|
|
5241
|
+
const headerEnd = raw.search(/\r?\n\r?\n/);
|
|
5242
|
+
const headerSec = (headerEnd === -1 ? raw : raw.slice(0, headerEnd))
|
|
5243
|
+
.replace(/\r?\n[ \t]+/g, " ");
|
|
5244
|
+
const toMatch = headerSec.match(/^To:\s*(.+)$/mi);
|
|
5245
|
+
const ccMatch = headerSec.match(/^Cc:\s*(.+)$/mi);
|
|
5246
|
+
const bccMatch = headerSec.match(/^Bcc:\s*(.+)$/mi);
|
|
5247
|
+
const fromMatch = headerSec.match(/^From:\s*(.+)$/mi);
|
|
5248
|
+
const subjectMatch = headerSec.match(/^Subject:\s*(.+)$/mi);
|
|
5249
|
+
const messageIdMatch = headerSec.match(/^Message-ID:\s*(<[^>]+>)/mi);
|
|
5235
5250
|
const recipients = [
|
|
5236
5251
|
...(toMatch ? parseAddrs(toMatch[1]) : []),
|
|
5237
5252
|
...(ccMatch ? parseAddrs(ccMatch[1]) : []),
|
|
@@ -5256,7 +5271,17 @@ export class ImapManager extends EventEmitter {
|
|
|
5256
5271
|
console.log(` [smtp] ${accountId}: SKIP ${messageId} — already in sent_log`);
|
|
5257
5272
|
return;
|
|
5258
5273
|
}
|
|
5259
|
-
|
|
5274
|
+
// Strip Bcc from the transmitted copy — HEADER SECTION only (the
|
|
5275
|
+
// old whole-file replace could eat a "Bcc:"-looking line from the
|
|
5276
|
+
// quoted body instead, leaving the real Bcc visible to every
|
|
5277
|
+
// recipient). Folded continuation lines go with it. Recompute the
|
|
5278
|
+
// header boundary: the Message-ID synthesis above may have grown
|
|
5279
|
+
// the header section since headerSec was derived.
|
|
5280
|
+
const bccHdrEnd = raw.search(/\r?\n\r?\n/);
|
|
5281
|
+
const stripBcc = (h) => h.replace(/^Bcc:[^\n]*(\r?\n[ \t][^\n]*)*(\r?\n|$)/mi, "").replace(/\r?\n$/, "");
|
|
5282
|
+
const rawToSend = bccHdrEnd === -1
|
|
5283
|
+
? stripBcc(raw)
|
|
5284
|
+
: stripBcc(raw.slice(0, bccHdrEnd)) + raw.slice(bccHdrEnd);
|
|
5260
5285
|
this.saveSendingCopy(accountId, rawToSend, "sent");
|
|
5261
5286
|
const smtp = new SmtpClient({
|
|
5262
5287
|
host: smtpHost,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobfrankston/mailx-imap",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.124",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
},
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@bobfrankston/mailx-types": "^0.1.
|
|
13
|
-
"@bobfrankston/mailx-settings": "^0.1.
|
|
14
|
-
"@bobfrankston/mailx-store": "^0.1.
|
|
12
|
+
"@bobfrankston/mailx-types": "^0.1.28",
|
|
13
|
+
"@bobfrankston/mailx-settings": "^0.1.38",
|
|
14
|
+
"@bobfrankston/mailx-store": "^0.1.65",
|
|
15
15
|
"@bobfrankston/iflow-direct": "^0.1.59",
|
|
16
16
|
"@bobfrankston/tcp-transport": "^0.1.8",
|
|
17
17
|
"@bobfrankston/smtp-direct": "^0.1.9",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
},
|
|
38
38
|
".transformedSnapshot": {
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@bobfrankston/mailx-types": "^0.1.
|
|
41
|
-
"@bobfrankston/mailx-settings": "^0.1.
|
|
42
|
-
"@bobfrankston/mailx-store": "^0.1.
|
|
40
|
+
"@bobfrankston/mailx-types": "^0.1.28",
|
|
41
|
+
"@bobfrankston/mailx-settings": "^0.1.38",
|
|
42
|
+
"@bobfrankston/mailx-store": "^0.1.65",
|
|
43
43
|
"@bobfrankston/iflow-direct": "^0.1.59",
|
|
44
44
|
"@bobfrankston/tcp-transport": "^0.1.8",
|
|
45
45
|
"@bobfrankston/smtp-direct": "^0.1.9",
|