@bobfrankston/rmfmail 1.2.227 → 1.2.228
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/client/app.bundle.js +1 -1
- package/client/app.bundle.js.map +2 -2
- package/client/components/message-viewer.js +1 -1
- package/client/components/message-viewer.js.map +1 -1
- package/client/components/message-viewer.ts +1 -1
- package/package.json +1 -1
- package/packages/mailx-service/jsonrpc.d.ts.map +1 -1
- package/packages/mailx-service/jsonrpc.js +22 -12
- package/packages/mailx-service/jsonrpc.js.map +1 -1
- package/packages/mailx-service/jsonrpc.ts +22 -12
- package/packages/mailx-service/package.json +1 -1
- /package/packages/mailx-imap/{node_modules.npmglobalize-stash-70108 → node_modules.npmglobalize-stash-78836}/.package-lock.json +0 -0
|
@@ -59,24 +59,34 @@ function capBodyForIpc(msg: any): any {
|
|
|
59
59
|
if (!msg || typeof msg !== "object") return msg;
|
|
60
60
|
const html = typeof msg.bodyHtml === "string" ? msg.bodyHtml : "";
|
|
61
61
|
const text = typeof msg.bodyText === "string" ? msg.bodyText : "";
|
|
62
|
-
const total = html.length + text.length;
|
|
63
|
-
if (total <= IPC_BODY_MAX_BYTES) return msg;
|
|
64
62
|
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
63
|
+
// A message with an HTML part is NEVER touched, at any size.
|
|
64
|
+
//
|
|
65
|
+
// The first cut of this guard truncated on total size and refused to send
|
|
66
|
+
// partial HTML, so a legitimate 9.8 MB message — one Bob had just written,
|
|
67
|
+
// large because of a pasted inline image — arrived with its HTML dropped
|
|
68
|
+
// and rendered as "Showing the first 0.0 MB" (Bob 2026-08-08: "I pasted in
|
|
69
|
+
// an image and you blew it away?"). Destroying real content to protect the
|
|
70
|
+
// renderer is a worse failure than the one being protected against.
|
|
71
|
+
//
|
|
72
|
+
// What remains guarded is the genuinely pathological shape: NO MIME
|
|
73
|
+
// structure at all, so the entire multi-megabyte payload is one implicit
|
|
74
|
+
// text/plain part (a qmail bounce that inlines the whole original). There,
|
|
75
|
+
// the tail is base64 of a returned attachment — truncating it costs the
|
|
76
|
+
// user nothing, while the head carries every diagnostic that matters.
|
|
77
|
+
if (html) return msg;
|
|
78
|
+
if (text.length <= IPC_BODY_MAX_BYTES) return msg;
|
|
79
|
+
|
|
80
|
+
const keptText = headOf(text, IPC_BODY_MAX_BYTES);
|
|
81
|
+
console.log(` [ipc] MIME-less body of ${text.length} bytes — acct=${msg.accountId} uid=${msg.uid} `
|
|
82
|
+
+ `→ sending first ${keptText.length} bytes with a truncation notice`);
|
|
72
83
|
return {
|
|
73
84
|
...msg,
|
|
74
|
-
bodyHtml: keptHtml,
|
|
75
85
|
bodyText: keptText,
|
|
76
86
|
bodyTruncated: {
|
|
77
|
-
totalBytes:
|
|
87
|
+
totalBytes: text.length,
|
|
78
88
|
sentBytes: keptText.length,
|
|
79
|
-
hadHtml:
|
|
89
|
+
hadHtml: false,
|
|
80
90
|
emlPath: msg.emlPath || "",
|
|
81
91
|
},
|
|
82
92
|
};
|