imapflow 1.0.122 → 1.0.124
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 +4 -0
- package/lib/commands/authenticate.js +2 -0
- package/lib/commands/login.js +2 -0
- package/lib/imap-flow.js +28 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/lib/commands/login.js
CHANGED
package/lib/imap-flow.js
CHANGED
|
@@ -217,6 +217,8 @@ class ImapFlow extends EventEmitter {
|
|
|
217
217
|
* @type {Map<string, boolean|number>}
|
|
218
218
|
*/
|
|
219
219
|
this.capabilities = new Map();
|
|
220
|
+
this.authCapabilities = new Map();
|
|
221
|
+
|
|
220
222
|
this.rawCapabilities = null;
|
|
221
223
|
|
|
222
224
|
this.expectCapabilityUpdate = false; // force CAPABILITY after LOGIN
|
|
@@ -538,6 +540,7 @@ class ImapFlow extends EventEmitter {
|
|
|
538
540
|
|
|
539
541
|
switch (parsed.command.toUpperCase()) {
|
|
540
542
|
case 'OK':
|
|
543
|
+
case 'BYE':
|
|
541
544
|
await new Promise(resolve => request.resolve({ response: parsed, next: resolve }));
|
|
542
545
|
break;
|
|
543
546
|
|
|
@@ -972,6 +975,15 @@ class ImapFlow extends EventEmitter {
|
|
|
972
975
|
async sectionCapability(section) {
|
|
973
976
|
this.rawCapabilities = section;
|
|
974
977
|
this.capabilities = updateCapabilities(section);
|
|
978
|
+
|
|
979
|
+
if (this.capabilities) {
|
|
980
|
+
for (let [capa] of this.capabilities) {
|
|
981
|
+
if (/^AUTH=/i.test(capa)) {
|
|
982
|
+
this.authCapabilities.set(capa.toUpperCase(), false);
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
|
|
975
987
|
if (this.expectCapabilityUpdate) {
|
|
976
988
|
this.expectCapabilityUpdate = false;
|
|
977
989
|
}
|
|
@@ -980,6 +992,15 @@ class ImapFlow extends EventEmitter {
|
|
|
980
992
|
async untaggedCapability(untagged) {
|
|
981
993
|
this.rawCapabilities = untagged.attributes;
|
|
982
994
|
this.capabilities = updateCapabilities(untagged.attributes);
|
|
995
|
+
|
|
996
|
+
if (this.capabilities) {
|
|
997
|
+
for (let [capa] of this.capabilities) {
|
|
998
|
+
if (/^AUTH=/i.test(capa)) {
|
|
999
|
+
this.authCapabilities.set(capa.toUpperCase(), false);
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
|
|
983
1004
|
if (this.expectCapabilityUpdate) {
|
|
984
1005
|
this.expectCapabilityUpdate = false;
|
|
985
1006
|
}
|
|
@@ -2178,6 +2199,13 @@ class ImapFlow extends EventEmitter {
|
|
|
2178
2199
|
res.next();
|
|
2179
2200
|
}
|
|
2180
2201
|
}
|
|
2202
|
+
|
|
2203
|
+
if (!finished) {
|
|
2204
|
+
// FETCH never finished!
|
|
2205
|
+
let error = new Error('FETCH did not finish');
|
|
2206
|
+
error.code = 'ENotFinished';
|
|
2207
|
+
throw error;
|
|
2208
|
+
}
|
|
2181
2209
|
} catch (err) {
|
|
2182
2210
|
setImmediate(() => this.close());
|
|
2183
2211
|
throw err;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "imapflow",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.124",
|
|
4
4
|
"description": "IMAP Client for Node",
|
|
5
5
|
"main": "./lib/imap-flow.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"@babel/eslint-plugin": "7.19.1",
|
|
32
32
|
"@babel/plugin-syntax-class-properties": "7.12.13",
|
|
33
33
|
"@babel/preset-env": "7.20.2",
|
|
34
|
-
"@types/node": "18.15.
|
|
34
|
+
"@types/node": "18.15.10",
|
|
35
35
|
"braintree-jsdoc-template": "3.3.0",
|
|
36
36
|
"eslint": "8.36.0",
|
|
37
37
|
"eslint-config-nodemailer": "1.2.0",
|
|
38
|
-
"eslint-config-prettier": "8.
|
|
38
|
+
"eslint-config-prettier": "8.8.0",
|
|
39
39
|
"grunt": "1.6.1",
|
|
40
40
|
"grunt-cli": "1.4.3",
|
|
41
41
|
"grunt-contrib-nodeunit": "5.0.0",
|