imapflow 1.0.199 → 1.1.0

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/.eslintrc CHANGED
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "rules": {
3
- "indent": 0,
4
3
  "no-await-in-loop": 0,
5
4
  "require-atomic-updates": 0
6
5
  },
@@ -10,7 +9,7 @@
10
9
  "extends": ["nodemailer", "prettier"],
11
10
  "parser": "@babel/eslint-parser",
12
11
  "parserOptions": {
13
- "ecmaVersion": 2018,
12
+ "ecmaVersion": 2020,
14
13
  "sourceType": "script"
15
14
  },
16
15
  "plugins": ["@babel"]
@@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
14
14
  Examples of behavior that contributes to creating a positive environment
15
15
  include:
16
16
 
17
- - Using welcoming and inclusive language
18
- - Being respectful of differing viewpoints and experiences
19
- - Gracefully accepting constructive criticism
20
- - Focusing on what is best for the community
21
- - Showing empathy towards other community members
17
+ - Using welcoming and inclusive language
18
+ - Being respectful of differing viewpoints and experiences
19
+ - Gracefully accepting constructive criticism
20
+ - Focusing on what is best for the community
21
+ - Showing empathy towards other community members
22
22
 
23
23
  Examples of unacceptable behavior by participants include:
24
24
 
25
- - The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- - Trolling, insulting/derogatory comments, and personal or political attacks
28
- - Public or private harassment
29
- - Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- - Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
25
+ - The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ - Trolling, insulting/derogatory comments, and personal or political attacks
28
+ - Public or private harassment
29
+ - Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ - Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
33
 
34
34
  ## Our Responsibilities
35
35
 
@@ -4,7 +4,6 @@ about: Create a report to help us improve
4
4
  title: ''
5
5
  labels: ''
6
6
  assignees: ''
7
-
8
7
  ---
9
8
 
10
9
  **Describe the bug**
@@ -12,6 +11,7 @@ A clear and concise description of what the bug is.
12
11
 
13
12
  **To Reproduce**
14
13
  Steps to reproduce the behavior:
14
+
15
15
  1. Go to '...'
16
16
  2. Click on '....'
17
17
  3. Scroll down to '....'
@@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
24
24
  If applicable, add screenshots to help explain your problem.
25
25
 
26
26
  **Desktop (please complete the following information):**
27
- - OS: [e.g. iOS]
28
- - Browser [e.g. chrome, safari]
29
- - Version [e.g. 22]
27
+
28
+ - OS: [e.g. iOS]
29
+ - Browser [e.g. chrome, safari]
30
+ - Version [e.g. 22]
30
31
 
31
32
  **Smartphone (please complete the following information):**
32
- - Device: [e.g. iPhone6]
33
- - OS: [e.g. iOS8.1]
34
- - Browser [e.g. stock browser, safari]
35
- - Version [e.g. 22]
33
+
34
+ - Device: [e.g. iPhone6]
35
+ - OS: [e.g. iOS8.1]
36
+ - Browser [e.g. stock browser, safari]
37
+ - Version [e.g. 22]
36
38
 
37
39
  **Additional context**
38
40
  Add any other context about the problem here.
@@ -4,7 +4,6 @@ about: Suggest an idea for this project
4
4
  title: ''
5
5
  labels: ''
6
6
  assignees: ''
7
-
8
7
  ---
9
8
 
10
9
  **Is your feature request related to a problem? Please describe.**
@@ -6,32 +6,31 @@ on:
6
6
  permissions:
7
7
  contents: write
8
8
  pull-requests: write
9
+ issues: write
9
10
  id-token: write
10
11
 
11
12
  name: release
12
13
  jobs:
13
14
  release-please:
14
15
  runs-on: ubuntu-latest
16
+ outputs:
17
+ release_created: ${{ steps.release.outputs.release_created }}
15
18
  steps:
16
- - uses: google-github-actions/release-please-action@v3
19
+ - uses: googleapis/release-please-action@v4
17
20
  id: release
21
+
22
+ publish:
23
+ needs: release-please
24
+ if: ${{ needs.release-please.outputs.release_created }}
25
+ runs-on: ubuntu-latest
26
+ permissions:
27
+ contents: read
28
+ id-token: write
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ - uses: actions/setup-node@v4
18
32
  with:
19
- release-type: node
20
- package-name: imapflow
21
- pull-request-title-pattern: 'chore${scope}: release ${version} [skip-ci]'
22
- # The logic below handles the npm publication:
23
- - uses: actions/checkout@v3
24
- # these if statements ensure that a publication only occurs when
25
- # a new release is created:
26
- if: ${{ steps.release.outputs.release_created }}
27
- - uses: actions/setup-node@v3
28
- with:
29
- node-version: 18
33
+ node-version: 24
30
34
  registry-url: 'https://registry.npmjs.org'
31
- if: ${{ steps.release.outputs.release_created }}
32
35
  - run: npm ci
33
- if: ${{ steps.release.outputs.release_created }}
34
36
  - run: npm publish --provenance --access public
35
- env:
36
- NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
37
- if: ${{ steps.release.outputs.release_created }}
@@ -12,9 +12,9 @@ jobs:
12
12
  os: [ubuntu-latest]
13
13
  runs-on: ${{ matrix.os }}
14
14
  steps:
15
- - uses: actions/checkout@v2
15
+ - uses: actions/checkout@v4
16
16
  - name: Use Node.js ${{ matrix.node }}
17
- uses: actions/setup-node@v1
17
+ uses: actions/setup-node@v4
18
18
  with:
19
19
  node-version: ${{ matrix.node }}
20
20
  - run: npm install
package/.ncurc.js CHANGED
@@ -1,4 +1,4 @@
1
1
  module.exports = {
2
2
  upgrade: true,
3
- reject: ['jsdoc', 'eslint', 'grunt-eslint', 'eslint-config-prettier']
3
+ reject: ['jsdoc', 'grunt-eslint']
4
4
  };
@@ -0,0 +1,4 @@
1
+ node_modules
2
+ package-lock.json
3
+ CHANGELOG.md
4
+ docs/
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "1.1.0"
3
+ }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,103 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.1.0](https://github.com/postalsys/imapflow/compare/imapflow-v1.0.200...imapflow-v1.1.0) (2025-10-23)
4
+
5
+
6
+ ### Features
7
+
8
+ * added default SPECIAL-USE when given params to list ([e26953f](https://github.com/postalsys/imapflow/commit/e26953f4cdc1d1bc32d1432e4a6d841f60aca993))
9
+ * added default SPECIAL-USE when given params to list ([79e59f8](https://github.com/postalsys/imapflow/commit/79e59f8456d227ce1b587d86b573870aed4a1814))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * Add async yielding to compression readNext() to prevent CPU blocking ([18e806d](https://github.com/postalsys/imapflow/commit/18e806d5485defe6d4a0ef3eb502b17f3b2d8c2d))
15
+ * Add async yielding to lock processing loop ([fbf1d9a](https://github.com/postalsys/imapflow/commit/fbf1d9a3aa93b4733a123553d8be0b1785f4135e))
16
+ * Add async yielding to processInput() to prevent CPU blocking ([6b619ce](https://github.com/postalsys/imapflow/commit/6b619ced453c3ee8556e18646ad476ad82a68fbf))
17
+ * Add async yielding to reader() method to prevent CPU blocking ([40574e3](https://github.com/postalsys/imapflow/commit/40574e322be27d8b3cdd1b32416e8395d7e395b5))
18
+ * Add exponential backoff to FETCH retry logic ([fb99e2d](https://github.com/postalsys/imapflow/commit/fb99e2d26c9cb29e69b6d33083ef101264b4b039))
19
+ * Add rate limiting for compression operations ([f54c1d0](https://github.com/postalsys/imapflow/commit/f54c1d0caf1bd8cc41a0779e12c915adbb55f346))
20
+ * Added authzid option for AUTH=PLAIN authentication ([541c43a](https://github.com/postalsys/imapflow/commit/541c43ab0f15608c7d28f19c810e1a14bc8519bc))
21
+ * **address:** do not use '@' instead of empyt address if a field does not contain a value ([aeabbde](https://github.com/postalsys/imapflow/commit/aeabbded3bf3c6ba7266f79d4bc001980644da0d))
22
+ * Allow to call the connect method only once ([ca7ec96](https://github.com/postalsys/imapflow/commit/ca7ec969f19a93c5dc574bf3873cd7afc4d7af47))
23
+ * **api:** Add fetchAll method ([#207](https://github.com/postalsys/imapflow/issues/207)) ([bc09998](https://github.com/postalsys/imapflow/commit/bc09998270006ea6ff8430b3461619dd9b3e91c8))
24
+ * **atom:** Allow < and [ in an atom value ([53b96bb](https://github.com/postalsys/imapflow/commit/53b96bb347705bd96efa3bd2503784d5f501f728))
25
+ * **Authentication:** Report errors; Fix LOGINDISABLED ([#275](https://github.com/postalsys/imapflow/issues/275)) ([a3a3fb9](https://github.com/postalsys/imapflow/commit/a3a3fb993dee66c02b34bba0e0b26fc349487b26))
26
+ * **auth:** Fixed AUTHENTICATE LOGIN if server uses 'VXNlciBOYW1lAA==' for username ([86c08a7](https://github.com/postalsys/imapflow/commit/86c08a769e2a98fe59375857cd16661e804f79a7))
27
+ * **auth:** Prefer AUTH=LOGIN and AUTH=PLAIN to LOGIN ([3efd98a](https://github.com/postalsys/imapflow/commit/3efd98a5033db29228023302fc4663316b2b28fb))
28
+ * **bodystructure:** Handle invalid BODYSTRUCTURE from Bluemind mail server ([b63f861](https://github.com/postalsys/imapflow/commit/b63f861f2894d0a34583ad9ff512ef5071f63228))
29
+ * **bodystructure:** Handle unicode filenames for servers that do not know how to use parameter continuations ([2b4b240](https://github.com/postalsys/imapflow/commit/2b4b2408bf19a337958888f5f2bcdd9af86424c1))
30
+ * Bumped deps ([fd568db](https://github.com/postalsys/imapflow/commit/fd568db7c0087bcee9c21e7be079b00a53d77040))
31
+ * Bumped deps ([e7b06e1](https://github.com/postalsys/imapflow/commit/e7b06e16eead8b1654e8f516ab2f78c96bc703df))
32
+ * Bumped deps ([6efb9f6](https://github.com/postalsys/imapflow/commit/6efb9f6952ff1f17d80054edb3d46aa43d540756))
33
+ * **connection-failure:** Reject all pending commands, not just LOGOUT ([1b42a61](https://github.com/postalsys/imapflow/commit/1b42a6116a76bf8fc8a9cf9a0421b53c659a5e98))
34
+ * **copy:** Updated cipyright year to 2024 ([e3f5040](https://github.com/postalsys/imapflow/commit/e3f5040e8f90523e12108e978ac5002f8caa9e1e))
35
+ * Correct log source indicator for client commands ([bb3ea09](https://github.com/postalsys/imapflow/commit/bb3ea09c3135c131fc8bedd733311aa3fe176261))
36
+ * Date time format in IMAP requires space before a single digit ([#272](https://github.com/postalsys/imapflow/issues/272)) ([bdb6b09](https://github.com/postalsys/imapflow/commit/bdb6b09a9939e65e0342219539e13045ce3f6995))
37
+ * **deps:** Bumped dependencies ([e8f5e8c](https://github.com/postalsys/imapflow/commit/e8f5e8ce431debddeecf523fa8739ae5ad23c659))
38
+ * **deps:** Bumped deps ([53ccd8b](https://github.com/postalsys/imapflow/commit/53ccd8b1027782dcd2af6dd1f7d337007a7f79c0))
39
+ * **deps:** Bumped deps ([559aa72](https://github.com/postalsys/imapflow/commit/559aa72337018f21a3675f4521ce4aae87e0aabb))
40
+ * **deps:** Bumped Nodemailer version ([ee02764](https://github.com/postalsys/imapflow/commit/ee0276493494ecf08be557cc0c486fe309d359bf))
41
+ * destroy _inflate and _deflate streams if set ([eab274b](https://github.com/postalsys/imapflow/commit/eab274b15b2ea2ee93aa027fd874249b1860167e))
42
+ * do not allow too large IMAP literals ([680a44d](https://github.com/postalsys/imapflow/commit/680a44d6550d51fc00602c49d6c5a377046c3504))
43
+ * **docs:** Fixed mailbox property name in AppendResponseObject ([ca6d789](https://github.com/postalsys/imapflow/commit/ca6d789b761d3117f733ed7b026122098f4d9142))
44
+ * **exchange:** handle special error response from exchange ([3ed4198](https://github.com/postalsys/imapflow/commit/3ed4198c1b5504ab0b46926fec179c682988b2e3))
45
+ * **FETCH:** throw on failing FETCH ([12f9a45](https://github.com/postalsys/imapflow/commit/12f9a45530c6f3a2f35ba2968819011eea9c32b2))
46
+ * **fetc:** Treat 'Some of the requested messages no longer exist' as a success, not a failure ([565f988](https://github.com/postalsys/imapflow/commit/565f988178fc4a4d3989fe027451980f3ee0d412))
47
+ * **filename:** Fixed filename decoding for the download method ([68a8159](https://github.com/postalsys/imapflow/commit/68a8159a0988245bf3f7c9b002823b01d9d24876))
48
+ * Fixed race condition when opening multiple mailboxes simultaneusly ([1248f84](https://github.com/postalsys/imapflow/commit/1248f8494afe0cc2c9faf31642fa3ea045ec0453))
49
+ * **flag-colors:** added a method to set Flag Color. The color is also included in the Fetch response structure ([d840951](https://github.com/postalsys/imapflow/commit/d8409513075b864e9131665af3f1670a0714d05c))
50
+ * **idle:** Do not clear preCheck from other command ([cdf7643](https://github.com/postalsys/imapflow/commit/cdf7643952c975556e11a03ceca85f8a57fe1420))
51
+ * **idle:** removed unneeded variable ([da59d9a](https://github.com/postalsys/imapflow/commit/da59d9a960dd0992b22335902808a315b1cb6ded))
52
+ * **idle:** Treat preCheck as async function ([346bb43](https://github.com/postalsys/imapflow/commit/346bb430e2ddeeb877b5778f9f1bdfd97a83ee4c))
53
+ * **imap ID:** Re-request ID information if only a single key was returned ([87bc016](https://github.com/postalsys/imapflow/commit/87bc016ae677b4428916d4a2047abcdeb95950bb))
54
+ * **imap:** Fixed issue with a single + response ([51be3a9](https://github.com/postalsys/imapflow/commit/51be3a98205cc900eba6d3cf1962bc42a8de942d))
55
+ * **imap:** Support invalid servers that return a full partial instead of starting byte for a FETCH property ([7281ce9](https://github.com/postalsys/imapflow/commit/7281ce98683946f825b5bfec197beecad7867a70))
56
+ * improved error handling ([0b955e4](https://github.com/postalsys/imapflow/commit/0b955e4e4a4ce05cae61ae603b68b84f3e19539c))
57
+ * Improved exception handling ([0eb77ac](https://github.com/postalsys/imapflow/commit/0eb77ac28a0f36b085769b6f9a20fd89d9214060))
58
+ * Improved socket handler listener setup/cleanup ([0b72714](https://github.com/postalsys/imapflow/commit/0b727140866d220ff1df07d7245c60aa72e3be4a))
59
+ * **license:** Bumped license timeframe ([ce308b6](https://github.com/postalsys/imapflow/commit/ce308b66e5d30819c6bab7d75752528abc4b8436))
60
+ * **license:** bumped license timeframe in README ([9a04730](https://github.com/postalsys/imapflow/commit/9a047309d10c0ef056c53fba3493df9f2fea5a1d))
61
+ * **listTree:** pass listing options as an optional argument ([917ba80](https://github.com/postalsys/imapflow/commit/917ba80f21b2fe485154acd252d6565b838e73e6))
62
+ * **locking:** log extra information about locks ([9790ec5](https://github.com/postalsys/imapflow/commit/9790ec575f405820d05dd4777987a88e0a4e819d))
63
+ * **login:** Always treat username and password as strings, not atom ([01b3471](https://github.com/postalsys/imapflow/commit/01b347145551c046e4400b8824be9be3c69d353b))
64
+ * **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))
65
+ * **logout:** Fixed race condition for logout and TCP close. Fixes [#161](https://github.com/postalsys/imapflow/issues/161) ([39a7333](https://github.com/postalsys/imapflow/commit/39a7333a39499e4876abb29149f7c72f2f99a63d))
66
+ * **logs:** Log mailbox lock description ([ce87cf5](https://github.com/postalsys/imapflow/commit/ce87cf5a256ddc324624893a1c17992475fafeb3))
67
+ * Merge branch 'master' into mustang-im-trycatch ([b024a0a](https://github.com/postalsys/imapflow/commit/b024a0a6375e9e62b8f5a0e1183c34d7e39bd5b7))
68
+ * messageFlagsSet with empty flag array ([#268](https://github.com/postalsys/imapflow/issues/268)) ([7de471c](https://github.com/postalsys/imapflow/commit/7de471c80590284fab6747221d9bcc1491d2a505))
69
+ * micro-optimizations for parser ([3451ad2](https://github.com/postalsys/imapflow/commit/3451ad235532ca1a64a829f9f2f8e77bcef3a17d))
70
+ * migrated from mailsplit to [@zone](https://github.com/zone).eu/mailsplit ([464f5f6](https://github.com/postalsys/imapflow/commit/464f5f6d68c57c4a60d284f94811c440f96031cc))
71
+ * **MS365:** Wait until responding with a throttling response ([#142](https://github.com/postalsys/imapflow/issues/142)) ([09bfb3e](https://github.com/postalsys/imapflow/commit/09bfb3e1b90bdd37bc1c9b40e9284ad4afbd5c72))
72
+ * **parser:** Fixed DIGIT handling' ([75389f1](https://github.com/postalsys/imapflow/commit/75389f12036cf746e7fa490843d27ade26fe1e78))
73
+ * **parser:** parse subfolders with square brackets ([0d0e8a6](https://github.com/postalsys/imapflow/commit/0d0e8a6ea379adf11594684d49a1ce5031339939))
74
+ * **parsing:** Limit the depth of nested input ([c6cd7ce](https://github.com/postalsys/imapflow/commit/c6cd7cef9f9b8a1ff137a08e8aebf2555e596a23))
75
+ * **password-auth:** Added option auth.loginMethod to set specific authentication method ('LOGIN', 'AUTH=PLAIN', 'AUTH=LOGIN') ([ce3c339](https://github.com/postalsys/imapflow/commit/ce3c33908f5ad445b1a2fdcf2dfcbd4859413cf7))
76
+ * **readme:** testing note format ([3038c4d](https://github.com/postalsys/imapflow/commit/3038c4d9740af0a5161bbc45dd13b86d4febc0ac))
77
+ * **release:** Added package-lock ([e35bda8](https://github.com/postalsys/imapflow/commit/e35bda8a2b14503ba30a46b555df82ab1084cf5a))
78
+ * **release:** updated package-lock ([b59220f](https://github.com/postalsys/imapflow/commit/b59220f54a58111e0b3259c502ff51b2a624f397))
79
+ * **release:** updated provenance setting ([e178629](https://github.com/postalsys/imapflow/commit/e1786296569e5a0acfb997b007091925519c7d79))
80
+ * **release:** updated provenance setting ([4fd5fa8](https://github.com/postalsys/imapflow/commit/4fd5fa8aa74756c1b9ff166febf294acda4792b8))
81
+ * Remove diacritics in ID values ([c79df56](https://github.com/postalsys/imapflow/commit/c79df5619f3cc6db36d3657a4746a112d2f33b15))
82
+ * remove unneeded timer ([1867606](https://github.com/postalsys/imapflow/commit/1867606aaf5ea37935c460aca1b615ab2a2b6534))
83
+ * **search:** add a `not` option for search options ([#281](https://github.com/postalsys/imapflow/issues/281)) ([000686b](https://github.com/postalsys/imapflow/commit/000686b2ace1ef0e21cca64d8e056d1f7f7f8914))
84
+ * **search:** Prefer WITHIN YOUNGER/OLDER instead of BEFORE/SINCE for searches if possible ([7492ac9](https://github.com/postalsys/imapflow/commit/7492ac9bd5598beadee7a72e3e3c63e25e9bc1f5))
85
+ * **search:** Use the next day when searching BEFORE/SENTBEFORE to include current day in the range as well ([9e6d749](https://github.com/postalsys/imapflow/commit/9e6d749ac781c6240b3113f2ec8d329ad831d740))
86
+ * **socket:** Throw an error if trying to write to a closed socket ([1d8e941](https://github.com/postalsys/imapflow/commit/1d8e941485223c76c4f22080e985587349c0e458))
87
+ * **socket:** Use destroy() instead of destroySoon() ([830c2d1](https://github.com/postalsys/imapflow/commit/830c2d18f3d27eb12dc6babe4edd37fed5f65490))
88
+ * **special-use:** support custom special use flags for the Archive folder ([17aa6a8](https://github.com/postalsys/imapflow/commit/17aa6a8baf180a7349fe30f897184eb8e359a498))
89
+ * **throttling:** automatically retry throttled FETCH commands a few times ([07a9aea](https://github.com/postalsys/imapflow/commit/07a9aea37ae55ed885ccc4c0e3732b367ad82cd3))
90
+ * **tls:** If socket fails then clear upgrade timeout as well ([12c60d2](https://github.com/postalsys/imapflow/commit/12c60d23d46d3bb315ecb184fbd1eea709f93269))
91
+ * Trying to re-publish as previous release attempt failed, no actual changes ([d882816](https://github.com/postalsys/imapflow/commit/d8828163e87067182c6011abda109a17baabac35))
92
+ * **uidvalidity:** Do not expect UIDVALIDITY to always exist ([7761653](https://github.com/postalsys/imapflow/commit/7761653e92965a09be8a872813363eb81f7f3d9a))
93
+
94
+ ## [1.0.200](https://github.com/postalsys/imapflow/compare/v1.0.199...v1.0.200) (2025-10-17)
95
+
96
+
97
+ ### Bug Fixes
98
+
99
+ * migrated from mailsplit to [@zone](https://github.com/zone).eu/mailsplit ([464f5f6](https://github.com/postalsys/imapflow/commit/464f5f6d68c57c4a60d284f94811c440f96031cc))
100
+
3
101
  ## [1.0.199](https://github.com/postalsys/imapflow/compare/v1.0.198...v1.0.199) (2025-10-09)
4
102
 
5
103
 
package/Gruntfile.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- module.exports = function(grunt) {
3
+ module.exports = function (grunt) {
4
4
  // Project configuration.
5
5
  grunt.initConfig({
6
6
  eslint: {
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ const { FlatCompat } = require('@eslint/eslintrc');
4
+ const js = require('@eslint/js');
5
+
6
+ const compat = new FlatCompat({
7
+ baseDirectory: __dirname,
8
+ recommendedConfig: js.configs.recommended
9
+ });
10
+
11
+ module.exports = [
12
+ {
13
+ ignores: ['node_modules/**', 'examples/**', 'docs/**']
14
+ },
15
+ ...compat.extends('nodemailer', 'prettier'),
16
+ {
17
+ languageOptions: {
18
+ ecmaVersion: 2020,
19
+ sourceType: 'script',
20
+ globals: {
21
+ BigInt: 'readonly'
22
+ },
23
+ parser: require('@babel/eslint-parser'),
24
+ parserOptions: {
25
+ requireConfigFile: false
26
+ }
27
+ },
28
+ plugins: {
29
+ '@babel': require('@babel/eslint-plugin')
30
+ },
31
+ rules: {
32
+ 'no-await-in-loop': 0,
33
+ 'require-atomic-updates': 0
34
+ }
35
+ },
36
+ {
37
+ files: ['eslint.config.js', '.prettierrc.js', '.ncurc.js'],
38
+ rules: {
39
+ 'global-require': 0,
40
+ strict: 0
41
+ }
42
+ }
43
+ ];
package/lib/imap-flow.js CHANGED
@@ -11,7 +11,7 @@ const { EventEmitter } = require('events');
11
11
  const logger = require('./logger');
12
12
  const libmime = require('libmime');
13
13
  const zlib = require('zlib');
14
- const { Headers } = require('mailsplit');
14
+ const { Headers } = require('@zone-eu/mailsplit');
15
15
  const { LimitedPassthrough } = require('./limited-passthrough');
16
16
 
17
17
  const { ImapStream } = require('./handler/imap-stream');
@@ -20,7 +20,7 @@ const packageInfo = require('../package.json');
20
20
 
21
21
  const libqp = require('libqp');
22
22
  const libbase64 = require('libbase64');
23
- const FlowedDecoder = require('mailsplit/lib/flowed-decoder');
23
+ const FlowedDecoder = require('@zone-eu/mailsplit/lib/flowed-decoder');
24
24
  const { PassThrough } = require('stream');
25
25
 
26
26
  const { proxyConnection } = require('./proxy-connection');
@@ -688,7 +688,7 @@ class ImapFlow extends EventEmitter {
688
688
  isLogging: true
689
689
  })
690
690
  ).toString();
691
- } catch (err) {
691
+ } catch {
692
692
  // ignore
693
693
  }
694
694
 
@@ -2894,7 +2894,7 @@ class ImapFlow extends EventEmitter {
2894
2894
  meta.disposition = disposition.value.toLowerCase().trim() || false;
2895
2895
  try {
2896
2896
  meta.disposition = libmime.decodeWords(meta.disposition);
2897
- } catch (err) {
2897
+ } catch {
2898
2898
  // failed to parse disposition, keep as is (most probably an unknown charset is used)
2899
2899
  }
2900
2900
  }
@@ -2910,7 +2910,7 @@ class ImapFlow extends EventEmitter {
2910
2910
  if (filename) {
2911
2911
  try {
2912
2912
  filename = libmime.decodeWords(filename);
2913
- } catch (err) {
2913
+ } catch {
2914
2914
  // failed to parse filename, keep as is (most probably an unknown charset is used)
2915
2915
  }
2916
2916
  meta.filename = filename;
@@ -2955,7 +2955,7 @@ class ImapFlow extends EventEmitter {
2955
2955
  output = output.pipe(decoder);
2956
2956
  // force to utf-8 for output
2957
2957
  meta.charset = 'utf-8';
2958
- } catch (E) {
2958
+ } catch {
2959
2959
  // do not decode charset
2960
2960
  }
2961
2961
  }
@@ -3174,7 +3174,7 @@ class ImapFlow extends EventEmitter {
3174
3174
  data[key].meta.disposition = disposition.value.toLowerCase().trim() || false;
3175
3175
  try {
3176
3176
  data[key].meta.disposition = libmime.decodeWords(data[key].meta.disposition);
3177
- } catch (err) {
3177
+ } catch {
3178
3178
  // failed to parse disposition, keep as is (most probably an unknown charset is used)
3179
3179
  }
3180
3180
  }
@@ -3190,7 +3190,7 @@ class ImapFlow extends EventEmitter {
3190
3190
  if (filename) {
3191
3191
  try {
3192
3192
  filename = libmime.decodeWords(filename);
3193
- } catch (err) {
3193
+ } catch {
3194
3194
  // failed to parse filename, keep as is (most probably an unknown charset is used)
3195
3195
  }
3196
3196
  data[key].meta.filename = filename;
package/lib/jp-decoder.js CHANGED
@@ -34,7 +34,7 @@ class JPDecoder extends Transform {
34
34
  output = Buffer.from(output);
35
35
  }
36
36
  this.push(output);
37
- } catch (err) {
37
+ } catch {
38
38
  // keep as is on errors
39
39
  this.push(input);
40
40
  }
package/lib/tools.js CHANGED
@@ -21,7 +21,7 @@ const tools = {
21
21
  if (!connection.enabled.has('UTF8=ACCEPT') && /[&\x00-\x08\x0b-\x0c\x0e-\x1f\u0080-\uffff]/.test(path)) {
22
22
  try {
23
23
  path = iconv.encode(path, 'utf-7-imap').toString();
24
- } catch (err) {
24
+ } catch {
25
25
  // ignore, keep name as is
26
26
  }
27
27
  }
@@ -33,7 +33,7 @@ const tools = {
33
33
  if (!connection.enabled.has('UTF8=ACCEPT') && /[&]/.test(path)) {
34
34
  try {
35
35
  path = iconv.decode(Buffer.from(path), 'utf-7-imap').toString();
36
- } catch (err) {
36
+ } catch {
37
37
  // ignore, keep name as is
38
38
  }
39
39
  }
@@ -392,7 +392,7 @@ const tools = {
392
392
  if (/[0x80-0xff]/.test(path)) {
393
393
  try {
394
394
  path = iconv.encode(path, 'utf-7-imap').toString();
395
- } catch (err) {
395
+ } catch {
396
396
  // ignore
397
397
  }
398
398
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imapflow",
3
- "version": "1.0.199",
3
+ "version": "1.1.0",
4
4
  "description": "IMAP Client for Node",
5
5
  "main": "lib/imap-flow.js",
6
6
  "types": "lib/imap-flow.d.ts",
@@ -10,7 +10,9 @@
10
10
  "docs": "rm -rf docs && mkdir -p docs && jsdoc lib/imap-flow.js -c jsdoc.json -R README.md --destination docs/ && cp assets/favicon.ico docs",
11
11
  "build": "npm run docs",
12
12
  "st": "npm run docs && st -d docs -i index.html",
13
- "update": "rm -rf node_modules package-lock.json && ncu -u && npm install"
13
+ "update": "rm -rf node_modules package-lock.json && ncu -u && npm install",
14
+ "format": "prettier --write \"**/*.{js,json,md,yml,yaml}\" --ignore-path .prettierignore",
15
+ "lint": "eslint ."
14
16
  },
15
17
  "repository": {
16
18
  "type": "git",
@@ -32,16 +34,19 @@
32
34
  "@babel/eslint-plugin": "7.27.1",
33
35
  "@babel/plugin-syntax-class-properties": "7.12.13",
34
36
  "@babel/preset-env": "7.28.3",
35
- "@types/node": "24.7.0",
36
- "eslint": "8.57.0",
37
+ "@eslint/eslintrc": "3.3.1",
38
+ "@eslint/js": "9.19.0",
39
+ "@types/node": "24.9.1",
40
+ "eslint": "9.19.0",
37
41
  "eslint-config-nodemailer": "1.2.0",
38
- "eslint-config-prettier": "9.1.0",
42
+ "eslint-config-prettier": "10.1.8",
39
43
  "grunt": "1.6.1",
40
44
  "grunt-cli": "1.5.0",
41
45
  "grunt-contrib-nodeunit": "5.0.0",
42
46
  "grunt-eslint": "24.3.0",
43
47
  "imapflow-jsdoc-template": "3.4.0-imapflow.3",
44
48
  "jsdoc": "4.0.4",
49
+ "prettier": "3.6.2",
45
50
  "st": "3.0.3",
46
51
  "typescript": "5.9.3"
47
52
  },
@@ -51,9 +56,9 @@
51
56
  "libbase64": "1.3.0",
52
57
  "libmime": "5.3.7",
53
58
  "libqp": "2.1.1",
54
- "mailsplit": "5.4.6",
55
- "nodemailer": "7.0.9",
56
- "pino": "10.0.0",
59
+ "@zone-eu/mailsplit": "5.4.7",
60
+ "nodemailer": "7.0.10",
61
+ "pino": "10.1.0",
57
62
  "socks": "2.8.7"
58
63
  }
59
64
  }
@@ -0,0 +1,9 @@
1
+ {
2
+ "packages": {
3
+ ".": {
4
+ "release-type": "node",
5
+ "package-name": "imapflow",
6
+ "pull-request-title-pattern": "chore${scope}: release ${version} [skip-ci]"
7
+ }
8
+ }
9
+ }
@@ -7,7 +7,7 @@ module.exports['Commands: Client instantiation'] = test => {
7
7
  host: 'imap.example.com',
8
8
  auth: { user: 'test', pass: 'test' }
9
9
  });
10
-
10
+
11
11
  test.ok(client);
12
12
  test.equal(typeof client.exec, 'function');
13
13
  test.done();
@@ -18,7 +18,7 @@ module.exports['Commands: Method availability'] = test => {
18
18
  host: 'imap.example.com',
19
19
  auth: { user: 'test', pass: 'test' }
20
20
  });
21
-
21
+
22
22
  // Check that key IMAP methods exist
23
23
  test.equal(typeof client.connect, 'function');
24
24
  test.equal(typeof client.logout, 'function');
@@ -35,7 +35,7 @@ module.exports['Commands: State management methods'] = test => {
35
35
  host: 'imap.example.com',
36
36
  auth: { user: 'test', pass: 'test' }
37
37
  });
38
-
38
+
39
39
  test.equal(typeof client.mailboxCreate, 'function');
40
40
  test.equal(typeof client.mailboxDelete, 'function');
41
41
  test.equal(typeof client.mailboxRename, 'function');
@@ -49,7 +49,7 @@ module.exports['Commands: Message operation methods'] = test => {
49
49
  host: 'imap.example.com',
50
50
  auth: { user: 'test', pass: 'test' }
51
51
  });
52
-
52
+
53
53
  test.equal(typeof client.messageFlagsSet, 'function');
54
54
  test.equal(typeof client.messageFlagsAdd, 'function');
55
55
  test.equal(typeof client.messageFlagsRemove, 'function');
@@ -64,10 +64,10 @@ module.exports['Commands: Utility methods'] = test => {
64
64
  host: 'imap.example.com',
65
65
  auth: { user: 'test', pass: 'test' }
66
66
  });
67
-
67
+
68
68
  test.equal(typeof client.noop, 'function');
69
69
  test.equal(typeof client.getQuota, 'function');
70
70
  test.equal(typeof client.stats, 'function');
71
71
  test.equal(typeof client.getRandomId, 'function');
72
72
  test.done();
73
- };
73
+ };