@bobfrankston/mailx-imap 0.1.74 → 0.1.75

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.
Files changed (2) hide show
  1. package/index.js +13 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -594,7 +594,19 @@ export class ImapManager extends EventEmitter {
594
594
  if (!config)
595
595
  throw new Error(`No config for account ${accountId}`);
596
596
  const host = config.server || accountId;
597
- const releaseHostSlot = await this.acquireHostSlot(host);
597
+ // IDLE bypasses the host semaphore. The semaphore caps concurrent
598
+ // connection OPENS so a multi-account-on-one-host setup can't blow the
599
+ // server's connection limit — but IDLE is a SINGLE long-lived socket
600
+ // per account (the subscription), established once and parked. Gating
601
+ // it behind the same 4 permits that sync/prefetch/fast churn through
602
+ // meant that when sync saturated the pool (folders timing out at 360s),
603
+ // IDLE could not get a slot to (re)subscribe — so new mail stopped
604
+ // arriving by push and the user fell back to slow polling (Bob
605
+ // 2026-05-29: "you should be subscribed and not depend on sync"). The
606
+ // subscription must NEVER be starved by sync. One extra socket per
607
+ // account is well within any server cap.
608
+ const skipSemaphore = purpose === "idle";
609
+ const releaseHostSlot = skipSemaphore ? (() => { }) : await this.acquireHostSlot(host);
598
610
  let client;
599
611
  try {
600
612
  // Verbose IMAP wire trace for ops connections only — that's the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx-imap",
3
- "version": "0.1.74",
3
+ "version": "0.1.75",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",