@bobfrankston/mailx-imap 0.1.54 → 0.1.56
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 +13 -3
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { createAutoImapConfig, CompatImapClient } from "@bobfrankston/iflow-direct";
|
|
7
7
|
import { authenticateOAuth } from "@bobfrankston/oauthsupport";
|
|
8
|
-
import { parseSerial, storeBus } from "@bobfrankston/mailx-store";
|
|
8
|
+
import { parseSerial, fixCharsetDeclString, storeBus } from "@bobfrankston/mailx-store";
|
|
9
9
|
import { loadSettings, getConfigDir, getHistoryDays, getPrefetch } from "@bobfrankston/mailx-settings";
|
|
10
10
|
import { EventEmitter } from "node:events";
|
|
11
11
|
import * as fs from "node:fs";
|
|
@@ -106,7 +106,11 @@ function decodeEntities(text) {
|
|
|
106
106
|
/** Extract a plain-text preview from message source */
|
|
107
107
|
async function extractPreview(source) {
|
|
108
108
|
try {
|
|
109
|
-
|
|
109
|
+
// Normalize iso-8859-1 → windows-1252 in the part charset declaration
|
|
110
|
+
// before parsing, so the preview decodes 0x80-0x9F (smart quotes,
|
|
111
|
+
// em-dash) correctly — same correction the viewer path gets via
|
|
112
|
+
// sniffAndFixCharset (Bob 2026-05-22).
|
|
113
|
+
const parsed = await parseSerial(fixCharsetDeclString(source), "background");
|
|
110
114
|
const bodyText = parsed.text || "";
|
|
111
115
|
const bodyHtml = parsed.html || "";
|
|
112
116
|
// Use text part; fall back to stripping HTML tags if text is empty
|
|
@@ -2981,7 +2985,13 @@ export class ImapManager extends EventEmitter {
|
|
|
2981
2985
|
})());
|
|
2982
2986
|
});
|
|
2983
2987
|
await Promise.all(pending);
|
|
2984
|
-
}, { slow: true });
|
|
2988
|
+
}, { slow: true, timeoutMs: 300_000 });
|
|
2989
|
+
// 5-min cap, not the 90s interactive default:
|
|
2990
|
+
// prefetch is background, and a 25-message body
|
|
2991
|
+
// chunk on a slow Dovecot legitimately runs past
|
|
2992
|
+
// 90s. The short cap was tripping the folder-error
|
|
2993
|
+
// cooldown 17×/session, so INBOX bodies stopped
|
|
2994
|
+
// prefetching entirely (Bob 2026-05-21 log).
|
|
2985
2995
|
batchSucceeded = true;
|
|
2986
2996
|
this.clearFolderErrors(accountId, folder.path);
|
|
2987
2997
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobfrankston/mailx-imap",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.56",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@bobfrankston/mailx-types": "^0.1.18",
|
|
13
13
|
"@bobfrankston/mailx-settings": "^0.1.22",
|
|
14
|
-
"@bobfrankston/mailx-store": "^0.1.
|
|
14
|
+
"@bobfrankston/mailx-store": "^0.1.33",
|
|
15
15
|
"@bobfrankston/iflow-direct": "^0.1.50",
|
|
16
16
|
"@bobfrankston/tcp-transport": "^0.1.6",
|
|
17
17
|
"@bobfrankston/smtp-direct": "^0.1.8",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@bobfrankston/mailx-types": "^0.1.18",
|
|
41
41
|
"@bobfrankston/mailx-settings": "^0.1.22",
|
|
42
|
-
"@bobfrankston/mailx-store": "^0.1.
|
|
42
|
+
"@bobfrankston/mailx-store": "^0.1.33",
|
|
43
43
|
"@bobfrankston/iflow-direct": "^0.1.50",
|
|
44
44
|
"@bobfrankston/tcp-transport": "^0.1.6",
|
|
45
45
|
"@bobfrankston/smtp-direct": "^0.1.8",
|