@bobfrankston/mailx 1.0.199 → 1.0.201
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/bin/mailx.js +842 -0
- package/bin/bin/postinstall.js +39 -0
- package/bin/mailx.js +68 -19
- package/bin/packages/mailx-settings/cloud.js +243 -0
- package/bin/packages/mailx-settings/index.js +643 -0
- package/client/.msger-window.json +1 -1
- package/package.json +2 -2
- package/packages/mailx-imap/index.d.ts +2 -1
- package/packages/mailx-imap/index.js +24 -29
- package/packages/mailx-store-web/gmail-api-web.js +4 -1
|
@@ -1218,7 +1218,8 @@ export class ImapManager extends EventEmitter {
|
|
|
1218
1218
|
return next;
|
|
1219
1219
|
}
|
|
1220
1220
|
// Body fetch uses withConnection — no separate client needed
|
|
1221
|
-
/** Fetch a single message body on demand, caching in the store
|
|
1221
|
+
/** Fetch a single message body on demand, caching in the store.
|
|
1222
|
+
* Uses its own fresh connection — never blocked by background prefetch. */
|
|
1222
1223
|
async fetchMessageBody(accountId, folderId, uid) {
|
|
1223
1224
|
// Already cached?
|
|
1224
1225
|
if (await this.bodyStore.hasMessage(accountId, folderId, uid)) {
|
|
@@ -1233,36 +1234,30 @@ export class ImapManager extends EventEmitter {
|
|
|
1233
1234
|
if (this.isGmailAccount(accountId)) {
|
|
1234
1235
|
return this.fetchMessageBodyViaApi(accountId, folderId, uid, folder.path);
|
|
1235
1236
|
}
|
|
1236
|
-
// IMAP:
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
client = this.newClient(accountId);
|
|
1245
|
-
const msg = await client.fetchMessageByUid(folder.path, uid, { source: true });
|
|
1246
|
-
await client.logout();
|
|
1247
|
-
client = null;
|
|
1248
|
-
if (!msg?.source)
|
|
1249
|
-
return null;
|
|
1250
|
-
const raw = Buffer.from(msg.source, "utf-8");
|
|
1251
|
-
const bodyPath = await this.bodyStore.putMessage(accountId, folderId, uid, raw);
|
|
1252
|
-
this.db.updateBodyPath(accountId, uid, bodyPath);
|
|
1253
|
-
return raw;
|
|
1254
|
-
}
|
|
1255
|
-
catch (e) {
|
|
1256
|
-
console.error(` Body fetch error (${accountId}/${uid}): ${e.message}`);
|
|
1257
|
-
if (client) {
|
|
1258
|
-
try {
|
|
1259
|
-
await client.logout();
|
|
1260
|
-
}
|
|
1261
|
-
catch { /* */ }
|
|
1262
|
-
}
|
|
1237
|
+
// IMAP: fresh connection per on-demand fetch — never queued behind prefetch
|
|
1238
|
+
let client = null;
|
|
1239
|
+
try {
|
|
1240
|
+
client = this.newClient(accountId);
|
|
1241
|
+
const msg = await client.fetchMessageByUid(folder.path, uid, { source: true });
|
|
1242
|
+
await client.logout();
|
|
1243
|
+
client = null;
|
|
1244
|
+
if (!msg?.source)
|
|
1263
1245
|
return null;
|
|
1246
|
+
const raw = Buffer.from(msg.source, "utf-8");
|
|
1247
|
+
const bodyPath = await this.bodyStore.putMessage(accountId, folderId, uid, raw);
|
|
1248
|
+
this.db.updateBodyPath(accountId, uid, bodyPath);
|
|
1249
|
+
return raw;
|
|
1250
|
+
}
|
|
1251
|
+
catch (e) {
|
|
1252
|
+
console.error(` Body fetch error (${accountId}/${uid}): ${e.message}`);
|
|
1253
|
+
if (client) {
|
|
1254
|
+
try {
|
|
1255
|
+
await client.logout();
|
|
1256
|
+
}
|
|
1257
|
+
catch { /* */ }
|
|
1264
1258
|
}
|
|
1265
|
-
|
|
1259
|
+
return null;
|
|
1260
|
+
}
|
|
1266
1261
|
}
|
|
1267
1262
|
/** Fetch message body via Gmail/Outlook API */
|
|
1268
1263
|
async fetchMessageBodyViaApi(accountId, folderId, uid, folderPath) {
|
|
@@ -80,9 +80,12 @@ export class GmailApiWebProvider {
|
|
|
80
80
|
const specialUse = labelSpecialUse(label);
|
|
81
81
|
const path = label.name || label.id;
|
|
82
82
|
const name = path.includes("/") ? path.split("/").pop() : path;
|
|
83
|
+
// System labels like INBOX, SENT, TRASH are selectable — don't mark \Noselect
|
|
84
|
+
// Only container labels (categories) should be noselect
|
|
85
|
+
const noSelect = label.type === "system" && !specialUse && !label.messagesTotal;
|
|
83
86
|
folders.push({
|
|
84
87
|
path, name, delimiter: "/", specialUse,
|
|
85
|
-
flags:
|
|
88
|
+
flags: noSelect ? ["\\Noselect"] : [],
|
|
86
89
|
});
|
|
87
90
|
}
|
|
88
91
|
return folders;
|