@bobfrankston/mailx 1.0.238 → 1.0.239
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/package.json +3 -3
- package/packages/mailx-imap/index.js +16 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobfrankston/mailx",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.239",
|
|
4
4
|
"description": "Local-first email client with IMAP sync and standalone native app",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "bin/mailx.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@bobfrankston/iflow-node": "^0.1.2",
|
|
25
25
|
"@bobfrankston/miscinfo": "^1.0.8",
|
|
26
26
|
"@bobfrankston/oauthsupport": "^1.0.22",
|
|
27
|
-
"@bobfrankston/msger": "^0.1.
|
|
27
|
+
"@bobfrankston/msger": "^0.1.301",
|
|
28
28
|
"@capacitor/android": "^8.3.0",
|
|
29
29
|
"@capacitor/cli": "^8.3.0",
|
|
30
30
|
"@capacitor/core": "^8.3.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@bobfrankston/iflow-node": "^0.1.2",
|
|
79
79
|
"@bobfrankston/miscinfo": "^1.0.8",
|
|
80
80
|
"@bobfrankston/oauthsupport": "^1.0.22",
|
|
81
|
-
"@bobfrankston/msger": "^0.1.
|
|
81
|
+
"@bobfrankston/msger": "^0.1.301",
|
|
82
82
|
"@capacitor/android": "^8.3.0",
|
|
83
83
|
"@capacitor/cli": "^8.3.0",
|
|
84
84
|
"@capacitor/core": "^8.3.0",
|
|
@@ -1221,18 +1221,27 @@ export class ImapManager extends EventEmitter {
|
|
|
1221
1221
|
/** Start periodic sync */
|
|
1222
1222
|
startPeriodicSync(intervalMinutes) {
|
|
1223
1223
|
this.stopPeriodicSync();
|
|
1224
|
-
// Per-account quick inbox check — adapts to server constraints
|
|
1225
|
-
//
|
|
1226
|
-
//
|
|
1227
|
-
//
|
|
1224
|
+
// Per-account quick inbox check — adapts to server constraints.
|
|
1225
|
+
// Accounts with IDLE running get a long interval (5 min) because IDLE
|
|
1226
|
+
// already pushes instant notifications — the STATUS poll is just a
|
|
1227
|
+
// safety net. Non-IDLE accounts (rare) use a shorter interval.
|
|
1228
|
+
//
|
|
1229
|
+
// CRITICAL: the previous value (2500ms for everyone) was hammering
|
|
1230
|
+
// Dovecot with 24 logins per minute. That's what tripped the server
|
|
1231
|
+
// operator's fail2ban on mail1, and was still flooding the desktop
|
|
1232
|
+
// connection. Each STATUS poll creates a disposable connection
|
|
1233
|
+
// (TLS + auth + STATUS + close), not a lightweight keep-alive.
|
|
1228
1234
|
for (const [accountId] of this.configs) {
|
|
1229
|
-
|
|
1230
|
-
|
|
1235
|
+
// Gmail uses API sync, not IMAP STATUS. IMAP accounts use IDLE
|
|
1236
|
+
// which gives instant push — the STATUS poll is just a fallback
|
|
1237
|
+
// in case IDLE silently dropped.
|
|
1238
|
+
const isGmail = this.isGmailAccount(accountId);
|
|
1239
|
+
const interval = isGmail ? 15000 : 300000; // Gmail API: 15s; IMAP with IDLE: 5min
|
|
1231
1240
|
const timer = setInterval(() => {
|
|
1232
1241
|
this.quickInboxCheckAccount(accountId).catch(() => { });
|
|
1233
1242
|
}, interval);
|
|
1234
1243
|
this.syncIntervals.set(`quick:${accountId}`, timer);
|
|
1235
|
-
console.log(` [periodic] ${accountId}: STATUS check every ${interval / 1000}s (${
|
|
1244
|
+
console.log(` [periodic] ${accountId}: STATUS check every ${interval / 1000}s (${isGmail ? "API" : "IMAP+IDLE"})`);
|
|
1236
1245
|
}
|
|
1237
1246
|
// Sync actions (sends + flags/deletes/moves) every 30 seconds — skip during active sync
|
|
1238
1247
|
const actionsInterval = setInterval(async () => {
|