emailengine-app 2.84.2 → 2.85.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.
Files changed (86) hide show
  1. package/.ncurc.js +5 -3
  2. package/.prettierignore +5 -1
  3. package/.prettierrc.js +2 -0
  4. package/.release-please-manifest.json +1 -1
  5. package/CHANGELOG.md +33 -0
  6. package/Dockerfile +6 -0
  7. package/README.md +1 -1
  8. package/bin/emailengine.js +434 -408
  9. package/copy-static-files.sh +39 -14
  10. package/data/google-crawlers.json +1 -1
  11. package/data/public_suffix_list.dat +16562 -0
  12. package/eslint.config.js +81 -99
  13. package/lib/account.js +36 -5
  14. package/lib/api-reference/format.js +4 -3
  15. package/lib/api-routes/account-routes.js +177 -12
  16. package/lib/api-routes/blocklist-routes.js +23 -2
  17. package/lib/api-routes/delivery-test-routes.js +26 -3
  18. package/lib/api-routes/export-routes.js +28 -2
  19. package/lib/api-routes/gateway-routes.js +28 -2
  20. package/lib/api-routes/mailbox-routes.js +41 -2
  21. package/lib/api-routes/message-routes.js +97 -3
  22. package/lib/api-routes/oauth2-app-routes.js +48 -15
  23. package/lib/api-routes/outbox-routes.js +45 -11
  24. package/lib/api-routes/permission-map.js +12 -1
  25. package/lib/api-routes/settings-routes.js +23 -2
  26. package/lib/api-routes/submit-routes.js +336 -309
  27. package/lib/api-routes/template-routes.js +38 -2
  28. package/lib/api-routes/token-routes.js +142 -96
  29. package/lib/api-routes/webhook-route-routes.js +13 -2
  30. package/lib/bounce-detect.js +397 -205
  31. package/lib/consts.js +5 -4
  32. package/lib/email-client/base-client.js +10 -31
  33. package/lib/email-client/gmail-client.js +9 -11
  34. package/lib/email-client/imap/mailbox.js +3 -19
  35. package/lib/email-client/imap/subconnection.js +1 -1
  36. package/lib/email-client/imap-client.js +1 -1
  37. package/lib/email-client/notification-handler.js +1 -2
  38. package/lib/gateway.js +2 -3
  39. package/lib/hapi-request-logger.js +107 -0
  40. package/lib/imapproxy/imap-core/README.md +6 -5
  41. package/lib/mcp/tools.js +37 -8
  42. package/lib/notify-attachments.js +17 -0
  43. package/lib/oauth/outlook-mailbox.js +35 -0
  44. package/lib/oauth/state.js +24 -0
  45. package/lib/oauth2-apps.js +1 -1
  46. package/lib/pbkdf2-phc.js +1 -1
  47. package/lib/schemas.js +1 -1
  48. package/lib/sso.js +1 -1
  49. package/lib/swagger-options.js +1 -1
  50. package/lib/thread-diagnostics.js +46 -0
  51. package/lib/timezones.js +109 -0
  52. package/lib/token-permission-view.js +3 -3
  53. package/lib/tools.js +40 -10
  54. package/lib/totp.js +2 -5
  55. package/lib/translations.js +1 -2
  56. package/lib/ui-routes/account-routes.js +475 -454
  57. package/lib/ui-routes/account-setup.js +99 -0
  58. package/lib/ui-routes/admin-config-routes.js +88 -10
  59. package/lib/ui-routes/admin-entities-routes.js +91 -7
  60. package/lib/ui-routes/auth-routes.js +90 -38
  61. package/lib/ui-routes/internals-routes.js +5 -0
  62. package/lib/ui-routes/oauth-config-routes.js +124 -82
  63. package/lib/ui-routes/route-helpers.js +19 -3
  64. package/lib/ui-routes/tls-config-routes.js +58 -15
  65. package/lib/utils/back-off.js +82 -0
  66. package/lib/utils/murmurhash3.js +66 -0
  67. package/lib/utils/public-suffix.js +122 -0
  68. package/lib/utils/random-id.js +26 -0
  69. package/lib/utils/version.js +74 -0
  70. package/lib/webhook-routing.js +27 -0
  71. package/lib/webhooks.js +41 -6
  72. package/package.json +27 -29
  73. package/sbom.json +7980 -1
  74. package/server.js +634 -441
  75. package/static/licenses.html +181 -1006
  76. package/translations/messages.pot +62 -63
  77. package/views/config/ai.hbs +1 -1
  78. package/views/config/security.hbs +2 -2
  79. package/views/config/service.hbs +3 -0
  80. package/views/internals/index.hbs +8 -0
  81. package/views/partials/webhook_form.hbs +1 -1
  82. package/views/suppression-lists/index.hbs +1 -1
  83. package/workers/api.js +738 -583
  84. package/workers/export.js +1 -1
  85. package/workers/submit.js +1 -1
  86. package/workers/webhooks.js +16 -32
package/.ncurc.js CHANGED
@@ -1,3 +1,5 @@
1
+ 'use strict';
2
+
1
3
  module.exports = {
2
4
  upgrade: true,
3
5
  // Node 20 is a hard runtime floor, not a preference. The DigitalOcean one-click images run
@@ -17,7 +19,7 @@ module.exports = {
17
19
  target: name =>
18
20
  ['pino', '@playwright/test'].includes(name)
19
21
  ? 'patch'
20
- : ['nanoid', 'gettext-parser', 'xgettext-template', 'chai', 'undici', 'marked', '@sentry/node-core', 'he'].includes(name)
22
+ : ['gettext-parser', 'xgettext-template', 'undici', 'marked', '@sentry/node-core', 'he', 'iconv-lite'].includes(name)
21
23
  ? 'minor'
22
24
  : 'latest',
23
25
  // pino - held on 10.3.x. 10.4.0 took PR #2294, which makes lib/caller.js prefer
@@ -38,15 +40,15 @@ module.exports = {
38
40
  // times out with "Received: undefined" while the page snapshot shows the button).
39
41
  // Same spec passes in 3.8 s on 1.63.0; nothing in the 1.64 release notes covers
40
42
  // it. Lift once a 1.64.x or later passes that spec unchanged.
41
- // nanoid - 4.x dropped the CommonJS require export (ESM-only)
42
43
  // gettext-parser - 8.x is ESM-only
43
44
  // xgettext-template - 6.x is ESM-only (translation build tool)
44
- // chai - 5.x is ESM-only (only used by the vendored imap-core tests)
45
45
  // undici - 8.x requires Node >=22.19 and crashes at require() on Node 20. Permanent while the
46
46
  // Node 20 floor above stands.
47
47
  // marked - 16.x dropped the CommonJS build (ESM-only, needs require(esm)/Node >=20.19); 15.x is the
48
48
  // last require()-compatible line. 15.0.12 verified on Node 20-24 and in a yao/pkg node24 build.
49
49
  // Permanent while the Node 20 floor above stands.
50
+ // iconv-lite - 1.0 (alpha since 2026-10) requires Node >=22 and moves to ES modules, relying on
51
+ // require(esm). Held on 0.x; libmime, imapflow and mailparser carry the same cap.
50
52
  // he - 2.x is ESM-only (exports only src/he.mjs) and requires Node >=22; require('he') throws
51
53
  // ERR_REQUIRE_ESM on Node 20 before 20.19. 1.2.0 is the last CommonJS release. mailparser,
52
54
  // which reaches EmailEngine through the same require, rejects 2.x for the same reason.
package/.prettierignore CHANGED
@@ -5,6 +5,7 @@ node_modules/
5
5
  ee-dist/
6
6
  dist/
7
7
  build/
8
+ coverage/
8
9
 
9
10
  # Static assets and vendor files
10
11
  static/
@@ -41,4 +42,7 @@ Thumbs.db
41
42
  *.swo
42
43
 
43
44
  # Documentation
44
- docs/
45
+ docs/
46
+
47
+ # Generated by release-please
48
+ CHANGELOG.md
package/.prettierrc.js CHANGED
@@ -1,3 +1,5 @@
1
+ 'use strict';
2
+
1
3
  module.exports = {
2
4
  printWidth: 160,
3
5
  tabWidth: 4,
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "2.84.2"
2
+ ".": "2.85.0"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.85.0](https://github.com/postalsys/emailengine/compare/v2.84.2...v2.85.0) (2026-10-20)
4
+
5
+
6
+ ### Features
7
+
8
+ * add an API endpoint to resume an account switched off after authentication failures ([6914729](https://github.com/postalsys/emailengine/commit/69147294647ba61dda1554aa67a0f402fa1ab3d9))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * accept cpus for the webhook, submit and export worker counts ([dc19eae](https://github.com/postalsys/emailengine/commit/dc19eaeaf8a6ee364d987b2683daa5e8a2ff4607))
14
+ * add resume_account to the MCP tools ([2c61fb2](https://github.com/postalsys/emailengine/commit/2c61fb2ffb180558b52eab13146f67abb92734c8))
15
+ * bump imapflow to 2.5.6 and bullmq to 6.3.17 ([5d9dccd](https://github.com/postalsys/emailengine/commit/5d9dccdba899d8e28929f47924feba91b8563cdb))
16
+ * bump imapflow to 2.5.8, gettext to 4.2.0, joi-messages to 1.4.0 and templates to 2.1.0 ([8891e9f](https://github.com/postalsys/emailengine/commit/8891e9f67ffa5fd87f1ad6e8954bdbab3314655d))
17
+ * bump imapflow to 2.5.9, bullmq to 6.3.19 and email-ai-tools to 2.3.1 ([a9ad209](https://github.com/postalsys/emailengine/commit/a9ad20985a0565d37999b8567298650e5c3ccf1a))
18
+ * bump ioredfour to 2.0.0, certs to 2.0.0 and pubface to 1.2.0 ([ec5ae18](https://github.com/postalsys/emailengine/commit/ec5ae18afb371a38f92b1c94c0f652b8a02feede))
19
+ * bump libmime to 5.5.2, gettext to 4.1.2, wild-config to 1.7.10 and bounce-classifier to 3.0.2 ([40482cd](https://github.com/postalsys/emailengine/commit/40482cd9558295f10512f29fcb2a7f28ac314f27))
20
+ * bump templates to 2.1.1, which formats dates without moment ([63bb897](https://github.com/postalsys/emailengine/commit/63bb89709b7130cd340113fc78000dca9ccb2b1c))
21
+ * cap the V8 young generation in the Docker image and the binaries ([7864aa5](https://github.com/postalsys/emailengine/commit/7864aa5a725b93edb60aa365b35a607605e51af0))
22
+ * complete the OAuth2 account setup the way the hosted form does ([1a33ecc](https://github.com/postalsys/emailengine/commit/1a33ecc987001e3205a251f8161c89acda76e045))
23
+ * decide webhook queueing before formatting the payload ([1b96844](https://github.com/postalsys/emailengine/commit/1b9684485a8c8541b80fc432bab7008a216c1985))
24
+ * drop psl and timezones-list for the source data and Intl ([55d9c7b](https://github.com/postalsys/emailengine/commit/55d9c7b8216c9afd2080bfe406165aa1cf8bb7e3))
25
+ * expose drafts, bulk message operations and more as MCP tools ([68ef849](https://github.com/postalsys/emailengine/commit/68ef8495b39858b14ada898e613218beaf34cae4))
26
+ * expose mailbox create, rename and delete as MCP tools ([faece57](https://github.com/postalsys/emailengine/commit/faece57b4525aa02ad5b799b629216252ec60077))
27
+ * log a resumed account once, with the reason it was re-enabled ([d752ed3](https://github.com/postalsys/emailengine/commit/d752ed3d9e1299eb13c3110afc9163ee1ef080a8))
28
+ * point the documentation links at the pages' current addresses ([7ce2ca8](https://github.com/postalsys/emailengine/commit/7ce2ca8bf6deb9f4c2df7b0f28ce24cc229eacb9))
29
+ * read .mo catalogs with @postalsys/gettext and bump owned packages ([5cf93a9](https://github.com/postalsys/emailengine/commit/5cf93a90f56c00f640a5c9340a83413bef398a6f))
30
+ * replace five small dependencies with in-house modules ([93da438](https://github.com/postalsys/emailengine/commit/93da43887c733fe09ea2d722eef4bfb40b3d4b21))
31
+ * report the event loop delay of every thread ([2b001fc](https://github.com/postalsys/emailengine/commit/2b001fcf5e1d352a0baeab3f9e2e7846d1db8382))
32
+ * stop downloading inline images for messageNew when nothing uses them ([7d63a88](https://github.com/postalsys/emailengine/commit/7d63a881259540c51fabd66fc05c43a49e542b9b))
33
+ * stop queueing webhook events that no delivery would send ([5a4921c](https://github.com/postalsys/emailengine/commit/5a4921c06a527ec5911eef78fed1019a07fedc5c))
34
+ * use a placeholder for the OAuth2 client secret example ([cd96134](https://github.com/postalsys/emailengine/commit/cd96134fdbd2a396d66f25f0261cf5dbe2166204))
35
+
3
36
  ## [2.84.2](https://github.com/postalsys/emailengine/compare/v2.84.1...v2.84.2) (2026-10-18)
4
37
 
5
38
 
package/Dockerfile CHANGED
@@ -100,6 +100,12 @@ ENV EENGINE_HOST=0.0.0.0
100
100
  ENV EENGINE_API_PROXY=true
101
101
  # The pure JavaScript msgpackr decoder is what the pkg binary uses, so npm and Docker installs decode the same way and no native addon is loaded
102
102
  ENV MSGPACKR_NATIVE_ACCELERATION_DISABLED=true
103
+ # Caps each thread's young generation at the size Node 22 used. Node 24 (V8 13.6) quadrupled the
104
+ # default, and every worker thread grows to it during startup, which raised the startup RSS of an
105
+ # empty instance by about half. The limit applies to each thread separately, not to the process. A
106
+ # NODE_OPTIONS given at run time replaces this one, so keep the flag in it to keep the cap. The pkg
107
+ # binary bakes the same value in package.json, and test/node-heap-options-test.js keeps the two equal.
108
+ ENV NODE_OPTIONS=--max-semi-space-size=16
103
109
 
104
110
  ENTRYPOINT ["/usr/bin/dumb-init", "--"]
105
111
  CMD ["node", "/emailengine/server.js"]
package/README.md CHANGED
@@ -13,7 +13,7 @@ A headless email client application that provides access to IMAP, SMTP, Gmail AP
13
13
 
14
14
  - Sync users' emails with your service and send emails on their behalf.
15
15
  - Integrate your app with a dedicated email account, such as your support email.
16
- - [Monitor INBOX and Junk folders](https://learn.emailengine.app/docs/advanced/inbox-placement-testing) of a test email account to track where sent emails land.
16
+ - [Monitor INBOX and Junk folders](https://learn.emailengine.app/docs/sending/deliverability/inbox-placement-testing) of a test email account to track where sent emails land.
17
17
  - Ideal for lightweight webmail and mobile email apps that prefer to avoid direct IMAP and MIME processing.
18
18
 
19
19
  ## Features