@bobfrankston/rmfmail 1.2.331 → 1.2.335
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/android-bootstrap.bundle.js +60 -2
- package/client/android-bootstrap.bundle.js.map +2 -2
- package/client/app.bundle.js +2 -1
- package/client/app.bundle.js.map +2 -2
- package/client/components/message-viewer.js +6 -1
- package/client/components/message-viewer.js.map +1 -1
- package/client/components/message-viewer.ts +6 -1
- package/client/compose/compose.bundle.js +90 -10
- package/client/compose/compose.bundle.js.map +4 -4
- package/client/compose/compose.js +49 -5
- package/client/compose/compose.js.map +1 -1
- package/client/compose/compose.ts +47 -5
- package/client/lib/rmf-tiny.js +34 -4
- package/client/package.json +1 -1
- package/package.json +5 -5
- package/packages/mailx-imap/package-lock.json +2 -2
- package/packages/mailx-imap/package.json +1 -1
- package/packages/mailx-service/index.d.ts.map +1 -1
- package/packages/mailx-service/index.js +7 -1
- package/packages/mailx-service/index.js.map +1 -1
- package/packages/mailx-service/index.ts +7 -1
- package/packages/mailx-service/package.json +1 -1
- package/packages/mailx-service/sync-queue.d.ts +7 -0
- package/packages/mailx-service/sync-queue.d.ts.map +1 -1
- package/packages/mailx-service/sync-queue.js +9 -0
- package/packages/mailx-service/sync-queue.js.map +1 -1
- package/packages/mailx-service/sync-queue.ts +10 -0
- package/packages/mailx-settings/package.json +1 -1
- package/packages/mailx-store/package.json +1 -1
- package/packages/mailx-store-web/package.json +1 -1
- package/packages/mailx-types/index.d.ts.map +1 -1
- package/packages/mailx-types/index.js +14 -0
- package/packages/mailx-types/index.js.map +1 -1
- package/packages/mailx-types/index.ts +13 -0
- package/packages/mailx-types/package.json +1 -1
|
@@ -3383,6 +3383,14 @@ function htmlToPlainText(html) {
|
|
|
3383
3383
|
const t = text.replace(/<[^>]+>/g, "").trim();
|
|
3384
3384
|
return t && t !== href ? `${t} (${href})` : href;
|
|
3385
3385
|
});
|
|
3386
|
+
s = s.replace(/<img\b[^>]*>/gi, (tag) => {
|
|
3387
|
+
const src = (tag.match(/\bsrc\s*=\s*(['"])([^'"]*)\1/i) || [])[2]?.trim() || "";
|
|
3388
|
+
const alt = (tag.match(/\balt\s*=\s*(['"])([^'"]*)\1/i) || [])[2]?.trim() || "";
|
|
3389
|
+
const remote = /^https?:\/\//i.test(src);
|
|
3390
|
+
if (remote)
|
|
3391
|
+
return alt ? `[image: ${alt}] (${src})` : `(${src})`;
|
|
3392
|
+
return alt ? `[image: ${alt}]` : "[image]";
|
|
3393
|
+
});
|
|
3386
3394
|
s = s.replace(/<[^>]+>/g, "");
|
|
3387
3395
|
s = s.replace(/ /gi, " ").replace(/&/gi, "&").replace(/</gi, "<").replace(/>/gi, ">").replace(/"/gi, '"').replace(/'/gi, "'").replace(/'/gi, "'").replace(/—/gi, "\u2014").replace(/–/gi, "\u2013").replace(/…/gi, "\u2026").replace(/&#(\d+);/g, (_m, n) => String.fromCodePoint(parseInt(n, 10))).replace(/&#x([0-9a-f]+);/gi, (_m, h) => String.fromCodePoint(parseInt(h, 16)));
|
|
3388
3396
|
s = s.replace(/[ \t]+/g, " ").split("\n").map((l) => l.replace(/^[ \t]+|[ \t]+$/g, "")).join("\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
@@ -8835,6 +8843,8 @@ function parseStatusResponse(text) {
|
|
|
8835
8843
|
data.uidValidity = val;
|
|
8836
8844
|
else if (key === "UNSEEN")
|
|
8837
8845
|
data.unseen = val;
|
|
8846
|
+
else if (key === "SIZE")
|
|
8847
|
+
data.size = val;
|
|
8838
8848
|
}
|
|
8839
8849
|
return data;
|
|
8840
8850
|
}
|
|
@@ -8858,6 +8868,8 @@ function parseStatusResponseFull(text) {
|
|
|
8858
8868
|
data.uidValidity = val;
|
|
8859
8869
|
else if (key === "UNSEEN")
|
|
8860
8870
|
data.unseen = val;
|
|
8871
|
+
else if (key === "SIZE")
|
|
8872
|
+
data.size = val;
|
|
8861
8873
|
}
|
|
8862
8874
|
return { mailbox, data };
|
|
8863
8875
|
}
|
|
@@ -9477,9 +9489,11 @@ var NativeImapClient = class {
|
|
|
9477
9489
|
console.error(` [imap] ${unparsed} LIST responses could not be parsed (${responses.length} total responses)`);
|
|
9478
9490
|
return folders;
|
|
9479
9491
|
}
|
|
9480
|
-
|
|
9492
|
+
// 2026-09-16 — Claude Code (Fable 5.1), at Bob's direction: `items` parameter added so a
|
|
9493
|
+
// caller can ask for RFC 8438 SIZE. Default unchanged, so existing callers see no difference.
|
|
9494
|
+
async getStatus(mailbox, items = ["MESSAGES", "UIDNEXT", "UNSEEN"]) {
|
|
9481
9495
|
const tag = nextTag();
|
|
9482
|
-
const responses = await this.sendCommand(tag, statusCommand(tag, mailbox,
|
|
9496
|
+
const responses = await this.sendCommand(tag, statusCommand(tag, mailbox, items));
|
|
9483
9497
|
for (const r of responses) {
|
|
9484
9498
|
if (r.tag === "*" && r.type === "STATUS") {
|
|
9485
9499
|
const data = parseStatusResponse(r.text);
|
|
@@ -9489,6 +9503,44 @@ var NativeImapClient = class {
|
|
|
9489
9503
|
}
|
|
9490
9504
|
return {};
|
|
9491
9505
|
}
|
|
9506
|
+
/**
|
|
9507
|
+
* Total size of a mailbox in octets plus its message count (for imail -sizes; added
|
|
9508
|
+
* 2026-09-16 by Claude Code, Fable 5.1, at Bob's direction).
|
|
9509
|
+
*
|
|
9510
|
+
* Fast path: RFC 8438 `STATUS (MESSAGES SIZE)` — one round trip, no message traffic —
|
|
9511
|
+
* when the server advertises STATUS=SIZE (Dovecot, Gmail do).
|
|
9512
|
+
* Fallback: EXAMINE (read-only) + `UID FETCH 1:* (UID RFC822.SIZE)` summed here. That
|
|
9513
|
+
* is one FETCH line per message but no envelopes or headers, so it stays cheap even
|
|
9514
|
+
* on a folder of tens of thousands of messages.
|
|
9515
|
+
*
|
|
9516
|
+
* `method` says which path produced the number so a log can show it.
|
|
9517
|
+
*/
|
|
9518
|
+
async getFolderSize(mailbox) {
|
|
9519
|
+
if (this.capabilities.has("STATUS=SIZE")) {
|
|
9520
|
+
const st = await this.getStatus(mailbox, ["MESSAGES", "SIZE"]);
|
|
9521
|
+
if (typeof st.size === "number")
|
|
9522
|
+
return { messages: st.messages || 0, bytes: st.size, method: "status" };
|
|
9523
|
+
}
|
|
9524
|
+
const info = await this.examine(mailbox);
|
|
9525
|
+
try {
|
|
9526
|
+
if (!info.exists)
|
|
9527
|
+
return { messages: 0, bytes: 0, method: "fetch" };
|
|
9528
|
+
let messages = 0, bytes = 0;
|
|
9529
|
+
const tag = nextTag();
|
|
9530
|
+
await this.sendCommand(tag, fetchCommand(tag, "1:*", ["UID", "RFC822.SIZE"]), (r) => {
|
|
9531
|
+
if (r.tag !== "*" || r.type !== "FETCH")
|
|
9532
|
+
return;
|
|
9533
|
+
const m = r.text.match(/RFC822\.SIZE\s+(\d+)/);
|
|
9534
|
+
if (!m)
|
|
9535
|
+
return;
|
|
9536
|
+
messages++;
|
|
9537
|
+
bytes += parseInt(m[1]);
|
|
9538
|
+
});
|
|
9539
|
+
return { messages, bytes, method: "fetch" };
|
|
9540
|
+
} finally {
|
|
9541
|
+
await this.closeMailbox();
|
|
9542
|
+
}
|
|
9543
|
+
}
|
|
9492
9544
|
async createMailbox(mailbox) {
|
|
9493
9545
|
const tag = nextTag();
|
|
9494
9546
|
const responses = await this.sendCommand(tag, createCommand(tag, mailbox));
|
|
@@ -10632,6 +10684,12 @@ var CompatImapClient = class {
|
|
|
10632
10684
|
await this.ensureConnected();
|
|
10633
10685
|
return this.native.getMessageCount(mailbox);
|
|
10634
10686
|
}
|
|
10687
|
+
/** Mailbox size in octets + message count. STATUS=SIZE when the server has it, else a
|
|
10688
|
+
* size-only UID FETCH. See NativeImapClient.getFolderSize. (2026-09-16, Claude Code) */
|
|
10689
|
+
async getFolderSize(mailbox) {
|
|
10690
|
+
await this.ensureConnected();
|
|
10691
|
+
return this.native.getFolderSize(mailbox);
|
|
10692
|
+
}
|
|
10635
10693
|
/** Get all UIDs in a mailbox */
|
|
10636
10694
|
async getUids(mailbox) {
|
|
10637
10695
|
await this.ensureConnected();
|