imapflow 1.0.79 → 1.0.80

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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ - 1.0.80 - 2022-02-07
4
+
5
+ - Added support for the missing NOMODSEQ mailbox modifier
6
+
3
7
  - 1.0.79 - 2021-12-29
4
8
 
5
9
  - Added property `greeting` that contains that first response from the server
@@ -86,7 +86,7 @@ module.exports = async (connection, range, query, options) => {
86
86
  }
87
87
 
88
88
  // always ask for modseq if possible
89
- if (connection.enabled.has('CONDSTORE')) {
89
+ if (connection.enabled.has('CONDSTORE') && !mailbox.noModseq) {
90
90
  queryStructure.push({ type: 'ATOM', value: 'MODSEQ' });
91
91
  }
92
92
 
@@ -137,7 +137,7 @@ module.exports = async (connection, range, query, options) => {
137
137
 
138
138
  attributes.push(queryStructure);
139
139
 
140
- if (options.changedSince && connection.enabled.has('CONDSTORE')) {
140
+ if (options.changedSince && connection.enabled.has('CONDSTORE') && !mailbox.noModseq) {
141
141
  attributes.push([
142
142
  {
143
143
  type: 'ATOM',
@@ -85,6 +85,16 @@ module.exports = async (connection, path, options) => {
85
85
 
86
86
  map[key] = value;
87
87
  }
88
+
89
+ if (section && section.length === 1 && section[0].type === 'ATOM' && typeof section[0].value === 'string') {
90
+ let key = section[0].value.toLowerCase();
91
+ switch (key) {
92
+ case 'nomodseq':
93
+ key = 'noModseq';
94
+ map[key] = true;
95
+ break;
96
+ }
97
+ }
88
98
  },
89
99
  FLAGS: async untagged => {
90
100
  if (!untagged.attributes || (!untagged.attributes.length && Array.isArray(untagged.attributes[0]))) {
@@ -53,7 +53,7 @@ module.exports = async (connection, range, flags, options) => {
53
53
 
54
54
  let attributes = [{ type: 'SEQUENCE', value: range }, { type: 'ATOM', value: operation }, flags.map(flag => ({ type: 'ATOM', value: flag }))];
55
55
 
56
- if (options.unchangedSince && connection.enabled.has('CONDSTORE')) {
56
+ if (options.unchangedSince && connection.enabled.has('CONDSTORE') && !connection.mailbox.noModseq) {
57
57
  attributes.push([
58
58
  {
59
59
  type: 'ATOM',
@@ -117,11 +117,13 @@ module.exports = async (response, options) => {
117
117
  case 'SECTION':
118
118
  val = (node.value || '').toString('binary');
119
119
 
120
- if (node.value === '' || imapFormalSyntax.verify(val.charAt(0) === '\\' ? val.substr(1) : val, imapFormalSyntax['ATOM-CHAR']()) >= 0) {
121
- val = JSON.stringify(val);
122
- }
120
+ if (!node.section || val) {
121
+ if (node.value === '' || imapFormalSyntax.verify(val.charAt(0) === '\\' ? val.substr(1) : val, imapFormalSyntax['ATOM-CHAR']()) >= 0) {
122
+ val = JSON.stringify(val);
123
+ }
123
124
 
124
- resp += val;
125
+ resp += val;
126
+ }
125
127
 
126
128
  if (node.section) {
127
129
  resp += '[';
package/lib/imap-flow.js CHANGED
@@ -58,6 +58,7 @@ const states = {
58
58
  * @property {Set<string>} permanentFlags A Set of flags available to use in this mailbox. If it is not set or includes special flag "\\\*" then any flag can be used.
59
59
  * @property {String} [mailboxId] unique mailbox ID if server has `OBJECTID` extension enabled
60
60
  * @property {BigInt} [highestModseq] latest known modseq value if server has CONDSTORE or XYMHIGHESTMODSEQ enabled
61
+ * @property {String} [noModseq] if true then the server doesn't support the persistent storage of mod-sequences for the mailbox
61
62
  * @property {BigInt} uidValidity Mailbox `UIDVALIDITY` value
62
63
  * @property {Number} uidNext Next predicted UID
63
64
  * @property {Number} exists Messages in this folder
package/lib/types.d.ts CHANGED
@@ -483,6 +483,7 @@ declare module "imapflow" {
483
483
  * @property permanentFlags - A Set of flags available to use in this mailbox. If it is not set or includes special flag "\\\*" then any flag can be used.
484
484
  * @property [mailboxId] - unique mailbox ID if server has `OBJECTID` extension enabled
485
485
  * @property [highestModseq] - latest known modseq value if server has CONDSTORE or XYMHIGHESTMODSEQ enabled
486
+ * @property [noModseq] - if true then the server doesn't support the persistent storage of mod-sequences for the mailbox
486
487
  * @property uidValidity - Mailbox `UIDVALIDITY` value
487
488
  * @property uidNext - Next predicted UID
488
489
  * @property exists - Messages in this folder
@@ -497,6 +498,7 @@ declare type MailboxObject = {
497
498
  permanentFlags: Set<string>;
498
499
  mailboxId?: string;
499
500
  highestModseq?: bigint;
501
+ noModseq?: string;
500
502
  uidValidity: bigint;
501
503
  uidNext: number;
502
504
  exists: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imapflow",
3
- "version": "1.0.79",
3
+ "version": "1.0.80",
4
4
  "description": "IMAP Client for Node",
5
5
  "main": "./lib/imap-flow.js",
6
6
  "scripts": {
@@ -26,20 +26,20 @@
26
26
  },
27
27
  "homepage": "https://imapflow.com/",
28
28
  "devDependencies": {
29
- "@babel/eslint-parser": "7.16.5",
29
+ "@babel/eslint-parser": "7.17.0",
30
30
  "@babel/eslint-plugin": "7.16.5",
31
31
  "@babel/plugin-syntax-class-properties": "7.12.13",
32
- "@babel/preset-env": "7.16.5",
33
- "@types/node": "17.0.5",
32
+ "@babel/preset-env": "7.16.11",
33
+ "@types/node": "17.0.15",
34
34
  "braintree-jsdoc-template": "3.3.0",
35
- "eslint": "8.5.0",
35
+ "eslint": "8.8.0",
36
36
  "eslint-config-nodemailer": "1.2.0",
37
37
  "eslint-config-prettier": "8.3.0",
38
38
  "grunt": "1.4.1",
39
39
  "grunt-cli": "1.4.3",
40
40
  "grunt-contrib-nodeunit": "4.0.0",
41
41
  "grunt-eslint": "24.0.0",
42
- "jsdoc": "3.6.7",
42
+ "jsdoc": "3.6.10",
43
43
  "tsd-jsdoc": "2.5.0"
44
44
  },
45
45
  "dependencies": {
@@ -50,7 +50,7 @@
50
50
  "libqp": "1.1.0",
51
51
  "mailsplit": "5.3.1",
52
52
  "nodemailer": "6.7.2",
53
- "pino": "7.6.2",
54
- "socks": "2.6.1"
53
+ "pino": "7.6.5",
54
+ "socks": "2.6.2"
55
55
  }
56
56
  }