@bobfrankston/rmfmail 1.2.10 → 1.2.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.
- package/bin/mailx.js +44 -1
- package/bin/mailx.js.map +1 -1
- package/bin/mailx.ts +41 -1
- package/client/app.bundle.js +11 -3
- package/client/app.bundle.js.map +2 -2
- package/client/app.js +19 -5
- package/client/app.js.map +1 -1
- package/client/app.ts +17 -4
- package/package.json +1 -1
- package/packages/mailx-imap/index.d.ts.map +1 -1
- package/packages/mailx-imap/index.js +23 -8
- package/packages/mailx-imap/index.js.map +1 -1
- package/packages/mailx-imap/index.ts +23 -8
- package/packages/mailx-imap/package-lock.json +2 -2
- package/packages/mailx-imap/package.json +1 -1
- package/packages/mailx-store/package.json +1 -1
|
@@ -3392,12 +3392,27 @@ export class ImapManager extends EventEmitter {
|
|
|
3392
3392
|
madeProgress = true;
|
|
3393
3393
|
}
|
|
3394
3394
|
} catch (e: any) {
|
|
3395
|
-
|
|
3396
|
-
//
|
|
3397
|
-
// corrupt body
|
|
3398
|
-
//
|
|
3399
|
-
//
|
|
3400
|
-
//
|
|
3395
|
+
const emsg = String(e?.message || e);
|
|
3396
|
+
// "IMAP command leaked into response stream" /
|
|
3397
|
+
// "corrupt body" means the byte-buffer parser lost
|
|
3398
|
+
// sync — a partial/flaky read shifted a literal
|
|
3399
|
+
// boundary so this FETCH body captured a later
|
|
3400
|
+
// command's bytes. The MESSAGE is probably fine; the
|
|
3401
|
+
// CONNECTION is poisoned (every subsequent read on
|
|
3402
|
+
// it is now garbage). Re-throw so withConnection
|
|
3403
|
+
// discards this client and the next chunk reconnects
|
|
3404
|
+
// clean — instead of marking a good message as poison
|
|
3405
|
+
// and limping on a dead socket until the 300s timeout,
|
|
3406
|
+
// which left bobma INBOX stuck and "no new mail"
|
|
3407
|
+
// (Bob 2026-06-15). Do NOT back the UID off; it
|
|
3408
|
+
// retries next tick on a clean connection.
|
|
3409
|
+
if (/command leaked|corrupt body|desync/i.test(emsg)) {
|
|
3410
|
+
console.error(` [prefetch] ${accountId}/${uid}: connection desync — discarding socket to resync: ${emsg.slice(0, 90)}`);
|
|
3411
|
+
throw new Error(`imap-desync: ${emsg.slice(0, 80)}`);
|
|
3412
|
+
}
|
|
3413
|
+
console.error(` [prefetch] ${accountId}/${uid}: store write failed: ${emsg}`);
|
|
3414
|
+
// Genuine poison body (not a desync): back off
|
|
3415
|
+
// 5m→30m→2h→12h so it isn't re-fetched on a loop.
|
|
3401
3416
|
this.markPrefetchEmpty(accountId, folderId, uid);
|
|
3402
3417
|
}
|
|
3403
3418
|
})());
|
|
@@ -3438,9 +3453,9 @@ export class ImapManager extends EventEmitter {
|
|
|
3438
3453
|
// (markPrefetchEmpty is per-message poison only) —
|
|
3439
3454
|
// they retry next tick. Genuine per-body errors are
|
|
3440
3455
|
// handled per-UID above and never reach here.
|
|
3441
|
-
const dead = /not connected|ETIMEDOUT|ECONNRESET|ECONNREFUSED|EPIPE|socket|connection (closed|reset|lost)|disconnect/i.test(msg);
|
|
3456
|
+
const dead = /not connected|ETIMEDOUT|ECONNRESET|ECONNREFUSED|EPIPE|socket|connection (closed|reset|lost)|disconnect|imap-desync/i.test(msg);
|
|
3442
3457
|
if (dead) {
|
|
3443
|
-
console.log(` [prefetch] ${accountId}/${folder.path}: connection down — deferring rest to next tick`);
|
|
3458
|
+
console.log(` [prefetch] ${accountId}/${folder.path}: connection down/desync — deferring rest to next tick (fresh socket)`);
|
|
3444
3459
|
break;
|
|
3445
3460
|
}
|
|
3446
3461
|
if (counters.errors >= ERROR_BUDGET) break;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobfrankston/mailx-imap",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.96",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@bobfrankston/mailx-imap",
|
|
9
|
-
"version": "0.1.
|
|
9
|
+
"version": "0.1.96",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@bobfrankston/iflow-direct": "^0.1.27",
|