@bobfrankston/iflow 1.0.41 → 1.0.43
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/imaplib/imap-native.js +11 -9
- package/package.json +1 -1
package/imaplib/imap-native.js
CHANGED
|
@@ -141,18 +141,16 @@ export class NativeImapClient {
|
|
|
141
141
|
this.capabilities.add(c.toUpperCase());
|
|
142
142
|
}
|
|
143
143
|
async logout() {
|
|
144
|
+
// Send LOGOUT but don't wait — just close the transport immediately.
|
|
145
|
+
// The server will clean up the session when the socket closes.
|
|
144
146
|
try {
|
|
145
147
|
if (this._connected) {
|
|
146
148
|
const tag = proto.nextTag();
|
|
147
|
-
|
|
148
|
-
await Promise.race([
|
|
149
|
-
this.sendCommand(tag, proto.logoutCommand(tag)),
|
|
150
|
-
new Promise((_, reject) => setTimeout(() => reject(new Error("LOGOUT timeout")), 5000))
|
|
151
|
-
]);
|
|
149
|
+
this.transport.write(proto.logoutCommand(tag)).catch(() => { });
|
|
152
150
|
}
|
|
153
151
|
}
|
|
154
|
-
catch { /* ignore
|
|
155
|
-
this.pendingCommand = null;
|
|
152
|
+
catch { /* ignore */ }
|
|
153
|
+
this.pendingCommand = null;
|
|
156
154
|
this.transport.close();
|
|
157
155
|
this._connected = false;
|
|
158
156
|
}
|
|
@@ -530,9 +528,13 @@ export class NativeImapClient {
|
|
|
530
528
|
this.pendingCommand.responses.push(resp);
|
|
531
529
|
continue;
|
|
532
530
|
}
|
|
533
|
-
// Continuation
|
|
531
|
+
// Continuation response
|
|
534
532
|
if (resp.tag === "+") {
|
|
535
|
-
//
|
|
533
|
+
// If not in IDLE and no one is waiting for continuation (APPEND),
|
|
534
|
+
// this is likely an AUTHENTICATE challenge — send empty line to cancel
|
|
535
|
+
if (!this.idleTag && this.pendingCommand) {
|
|
536
|
+
this.transport.write("\r\n").catch(() => { });
|
|
537
|
+
}
|
|
536
538
|
continue;
|
|
537
539
|
}
|
|
538
540
|
// Tagged response — command complete
|