@bobfrankston/iflow-direct 0.1.28 → 0.1.30

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/gmail.d.ts CHANGED
@@ -12,6 +12,7 @@ export interface GmailOAuthConfig {
12
12
  inactivityTimeout?: number;
13
13
  fetchChunkSize?: number;
14
14
  fetchChunkSizeMax?: number;
15
+ greetingTimeout?: number;
15
16
  }
16
17
  /**
17
18
  * Check if email address is Gmail
@@ -41,5 +42,6 @@ export declare function createAutoImapConfig(config: {
41
42
  inactivityTimeout?: number;
42
43
  fetchChunkSize?: number;
43
44
  fetchChunkSizeMax?: number;
45
+ greetingTimeout?: number;
44
46
  }): ImapClientConfig;
45
47
  //# sourceMappingURL=gmail.d.ts.map
package/gmail.js CHANGED
@@ -36,6 +36,7 @@ export function createGmailConfig(config) {
36
36
  inactivityTimeout: config.inactivityTimeout,
37
37
  fetchChunkSize: config.fetchChunkSize,
38
38
  fetchChunkSizeMax: config.fetchChunkSizeMax,
39
+ greetingTimeout: config.greetingTimeout,
39
40
  };
40
41
  }
41
42
  /**
@@ -56,6 +57,7 @@ export function createAutoImapConfig(config) {
56
57
  inactivityTimeout: config.inactivityTimeout,
57
58
  fetchChunkSize: config.fetchChunkSize,
58
59
  fetchChunkSizeMax: config.fetchChunkSizeMax,
60
+ greetingTimeout: config.greetingTimeout,
59
61
  });
60
62
  }
61
63
  else {
@@ -69,6 +71,7 @@ export function createAutoImapConfig(config) {
69
71
  inactivityTimeout: config.inactivityTimeout,
70
72
  fetchChunkSize: config.fetchChunkSize,
71
73
  fetchChunkSizeMax: config.fetchChunkSizeMax,
74
+ greetingTimeout: config.greetingTimeout,
72
75
  };
73
76
  }
74
77
  }
package/imap-native.d.ts CHANGED
@@ -173,6 +173,10 @@ export declare class NativeImapClient {
173
173
  * 60s accommodates Gmail which is slow on SEARCH for large folders.
174
174
  * Overridable via ImapClientConfig.inactivityTimeout — slow Dovecot servers need 180s+. */
175
175
  private inactivityTimeout;
176
+ /** Server-greeting timeout in ms — how long to wait for the server's
177
+ * initial banner after TCP/TLS connects. Default 10s; bumped to 30s
178
+ * for slow shared-hosting Dovecot in mailx-imap. */
179
+ private greetingTimeout;
176
180
  /** Fetch chunk sizes — start small for quick first paint, ramp up for throughput.
177
181
  * Default 25 initial → 500 max. Overridable via ImapClientConfig.fetchChunkSize /
178
182
  * fetchChunkSizeMax. Slow servers benefit from smaller chunks (fewer timeouts). */
package/imap-native.js CHANGED
@@ -34,6 +34,7 @@ export class NativeImapClient {
34
34
  this.inactivityTimeout = config.inactivityTimeout ?? 60000;
35
35
  this.fetchChunkSize = config.fetchChunkSize ?? 25;
36
36
  this.fetchChunkSizeMax = config.fetchChunkSizeMax ?? 500;
37
+ this.greetingTimeout = config.greetingTimeout ?? 10000;
37
38
  }
38
39
  get connected() { return this._connected; }
39
40
  /** Check the underlying transport's connected state — catches silently dead sockets. */
@@ -116,8 +117,8 @@ export class NativeImapClient {
116
117
  return new Promise((resolve, reject) => {
117
118
  const timeout = setTimeout(() => {
118
119
  this.greetingResolve = null;
119
- reject(new Error("Greeting timeout (10s)"));
120
- }, 10000);
120
+ reject(new Error(`Greeting timeout (${this.greetingTimeout / 1000}s)`));
121
+ }, this.greetingTimeout);
121
122
  this.greetingResolve = (resp) => {
122
123
  clearTimeout(timeout);
123
124
  resolve(resp);
@@ -728,6 +729,10 @@ export class NativeImapClient {
728
729
  * 60s accommodates Gmail which is slow on SEARCH for large folders.
729
730
  * Overridable via ImapClientConfig.inactivityTimeout — slow Dovecot servers need 180s+. */
730
731
  inactivityTimeout;
732
+ /** Server-greeting timeout in ms — how long to wait for the server's
733
+ * initial banner after TCP/TLS connects. Default 10s; bumped to 30s
734
+ * for slow shared-hosting Dovecot in mailx-imap. */
735
+ greetingTimeout;
731
736
  /** Fetch chunk sizes — start small for quick first paint, ramp up for throughput.
732
737
  * Default 25 initial → 500 max. Overridable via ImapClientConfig.fetchChunkSize /
733
738
  * fetchChunkSizeMax. Slow servers benefit from smaller chunks (fewer timeouts). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/iflow-direct",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
4
4
  "description": "Direct IMAP client — transport-agnostic, no Node.js dependencies, browser-ready",
5
5
  "main": "index.js",
6
6
  "types": "index.ts",
package/types.d.ts CHANGED
@@ -13,5 +13,6 @@ export interface ImapClientConfig {
13
13
  inactivityTimeout?: number;
14
14
  fetchChunkSize?: number;
15
15
  fetchChunkSizeMax?: number;
16
+ greetingTimeout?: number;
16
17
  }
17
18
  //# sourceMappingURL=types.d.ts.map