imapflow 1.0.175 → 1.0.177
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/CHANGELOG.md +14 -0
- package/lib/commands/idle.js +7 -3
- package/lib/imap-flow.js +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.0.177](https://github.com/postalsys/imapflow/compare/v1.0.176...v1.0.177) (2025-01-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **login:** When using slashes in username (indicates an Exchange account or drive account), use LOGIN as the authentication mechanism ([7ac0036](https://github.com/postalsys/imapflow/commit/7ac00369a13ff35ed0b923b44e97ba933eee397c))
|
|
9
|
+
|
|
10
|
+
## [1.0.176](https://github.com/postalsys/imapflow/compare/v1.0.175...v1.0.176) (2025-01-15)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **idle:** Treat preCheck as async function ([346bb43](https://github.com/postalsys/imapflow/commit/346bb430e2ddeeb877b5778f9f1bdfd97a83ee4c))
|
|
16
|
+
|
|
3
17
|
## [1.0.175](https://github.com/postalsys/imapflow/compare/v1.0.174...v1.0.175) (2025-01-15)
|
|
4
18
|
|
|
5
19
|
|
package/lib/commands/idle.js
CHANGED
|
@@ -14,7 +14,7 @@ async function runIdle(connection) {
|
|
|
14
14
|
let doneSent = false;
|
|
15
15
|
let canEnd = false;
|
|
16
16
|
|
|
17
|
-
let preCheck = () => {
|
|
17
|
+
let preCheck = async () => {
|
|
18
18
|
doneRequested = true;
|
|
19
19
|
if (canEnd && !doneSent) {
|
|
20
20
|
connection.log.debug({
|
|
@@ -52,7 +52,7 @@ async function runIdle(connection) {
|
|
|
52
52
|
doneSent
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
preCheck();
|
|
55
|
+
preCheck().catch(err => connection.log.warn({ err, cid: connection.id }));
|
|
56
56
|
|
|
57
57
|
return handler;
|
|
58
58
|
};
|
|
@@ -64,7 +64,11 @@ async function runIdle(connection) {
|
|
|
64
64
|
connection.log.debug({ msg: `Initiated IDLE, waiting for server input`, lockId: connection.currentLock?.lockId, doneRequested });
|
|
65
65
|
canEnd = true;
|
|
66
66
|
if (doneRequested) {
|
|
67
|
-
|
|
67
|
+
try {
|
|
68
|
+
await preCheck();
|
|
69
|
+
} catch (err) {
|
|
70
|
+
connection.log.warn({ err, cid: connection.id });
|
|
71
|
+
}
|
|
68
72
|
}
|
|
69
73
|
},
|
|
70
74
|
onSend: () => {
|
package/lib/imap-flow.js
CHANGED
|
@@ -1055,6 +1055,10 @@ class ImapFlow extends EventEmitter {
|
|
|
1055
1055
|
this.expectCapabilityUpdate = true;
|
|
1056
1056
|
|
|
1057
1057
|
let loginMethod = (this.options.auth.loginMethod || '').toString().trim().toUpperCase();
|
|
1058
|
+
if (!loginMethod && /\\|\//.test(this.options.auth.user)) {
|
|
1059
|
+
// Special override for MS Exchange when authenticating as some other user or non-email account
|
|
1060
|
+
loginMethod = 'LOGIN';
|
|
1061
|
+
}
|
|
1058
1062
|
|
|
1059
1063
|
if (this.options.auth.accessToken) {
|
|
1060
1064
|
this.authenticated = await this.run('AUTHENTICATE', this.options.auth.user, { accessToken: this.options.auth.accessToken });
|