@bobfrankston/mailx-imap 0.1.76 → 0.1.78
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 +16 -1
- package/package.json +5 -5
package/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Syncs messages to local store, emits events for new mail.
|
|
5
5
|
*/
|
|
6
6
|
import { createAutoImapConfig, CompatImapClient } from "@bobfrankston/iflow-direct";
|
|
7
|
-
import { authenticateOAuth } from "@bobfrankston/oauthsupport";
|
|
7
|
+
import { authenticateOAuth, clearReauthBackoff } from "@bobfrankston/oauthsupport";
|
|
8
8
|
import { parseSerial, fixCharsetDeclString, storeBus } from "@bobfrankston/mailx-store";
|
|
9
9
|
import { loadSettings, getConfigDir, getHistoryDays, getPrefetch, tokenDirName } from "@bobfrankston/mailx-settings";
|
|
10
10
|
import { EventEmitter } from "node:events";
|
|
@@ -119,7 +119,15 @@ async function extractPreview(source) {
|
|
|
119
119
|
// from a Quill compose pasted-image HTML) collapsed to [image] too.
|
|
120
120
|
let raw;
|
|
121
121
|
if (bodyHtml) {
|
|
122
|
+
// Drop the CONTENTS of style/script/head blocks and HTML comments
|
|
123
|
+
// first — a plain tag-strip removes the <style> tags but leaves the
|
|
124
|
+
// CSS rules between them, which then leak into the preview as
|
|
125
|
+
// `*{box-sizing:border-box}` / `@media …{ … }` garbage (Bob's
|
|
126
|
+
// 2026-05-31 marketing-mail shot). Order matters: kill blocks, then
|
|
127
|
+
// images → [image], then any remaining tags.
|
|
122
128
|
raw = bodyHtml
|
|
129
|
+
.replace(/<!--[\s\S]*?-->/g, " ")
|
|
130
|
+
.replace(/<(style|script|head)\b[^>]*>[\s\S]*?<\/\1>/gi, " ")
|
|
123
131
|
.replace(/<img\b[^>]*>/gi, " [image] ")
|
|
124
132
|
.replace(/<[^>]+>/g, " ");
|
|
125
133
|
}
|
|
@@ -312,6 +320,13 @@ export class ImapManager extends EventEmitter {
|
|
|
312
320
|
fs.unlinkSync(tokenPath);
|
|
313
321
|
console.log(` [reauth] Deleted ${tokenPath}`);
|
|
314
322
|
}
|
|
323
|
+
// User explicitly asked to re-auth — clear any re-auth backoff so
|
|
324
|
+
// addAccount's token validation opens the browser immediately
|
|
325
|
+
// instead of honoring the "don't reopen tabs" cooldown.
|
|
326
|
+
try {
|
|
327
|
+
clearReauthBackoff(tokenDir);
|
|
328
|
+
}
|
|
329
|
+
catch { /* */ }
|
|
315
330
|
// Re-register the account to get a fresh config with new tokenProvider
|
|
316
331
|
this.configs.delete(accountId);
|
|
317
332
|
await this.addAccount(account);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobfrankston/mailx-imap",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.78",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@bobfrankston/mailx-types": "^0.1.18",
|
|
13
13
|
"@bobfrankston/mailx-settings": "^0.1.25",
|
|
14
|
-
"@bobfrankston/mailx-store": "^0.1.
|
|
14
|
+
"@bobfrankston/mailx-store": "^0.1.42",
|
|
15
15
|
"@bobfrankston/iflow-direct": "^0.1.51",
|
|
16
16
|
"@bobfrankston/tcp-transport": "^0.1.6",
|
|
17
17
|
"@bobfrankston/smtp-direct": "^0.1.8",
|
|
18
18
|
"@bobfrankston/mailx-sync": "^0.1.19",
|
|
19
|
-
"@bobfrankston/oauthsupport": "^1.0.
|
|
19
|
+
"@bobfrankston/oauthsupport": "^1.0.31"
|
|
20
20
|
},
|
|
21
21
|
"repository": {
|
|
22
22
|
"type": "git",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@bobfrankston/mailx-types": "^0.1.18",
|
|
41
41
|
"@bobfrankston/mailx-settings": "^0.1.25",
|
|
42
|
-
"@bobfrankston/mailx-store": "^0.1.
|
|
42
|
+
"@bobfrankston/mailx-store": "^0.1.42",
|
|
43
43
|
"@bobfrankston/iflow-direct": "^0.1.51",
|
|
44
44
|
"@bobfrankston/tcp-transport": "^0.1.6",
|
|
45
45
|
"@bobfrankston/smtp-direct": "^0.1.8",
|
|
46
46
|
"@bobfrankston/mailx-sync": "^0.1.19",
|
|
47
|
-
"@bobfrankston/oauthsupport": "^1.0.
|
|
47
|
+
"@bobfrankston/oauthsupport": "^1.0.31"
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
}
|