emailengine-app 2.85.0 → 2.86.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 (128) hide show
  1. package/.ncurc.js +24 -6
  2. package/.release-please-manifest.json +1 -1
  3. package/CHANGELOG.md +74 -0
  4. package/Dockerfile +14 -1
  5. package/ENVIRONMENT.md +139 -0
  6. package/README.md +1 -1
  7. package/config/default.toml +2 -0
  8. package/copy-static-files.sh +4 -2
  9. package/data/google-crawlers.json +1 -1
  10. package/data/public_suffix_list.dat +4 -3
  11. package/lib/account-assignment.js +19 -0
  12. package/lib/account.js +194 -165
  13. package/lib/api-error-codes.js +49 -0
  14. package/lib/api-reference/model.js +6 -1
  15. package/lib/api-routes/account-routes.js +78 -26
  16. package/lib/api-routes/blocklist-routes.js +68 -2
  17. package/lib/api-routes/delivery-test-routes.js +1 -1
  18. package/lib/api-routes/gateway-routes.js +82 -10
  19. package/lib/api-routes/index.js +4 -0
  20. package/lib/api-routes/license-routes.js +2 -2
  21. package/lib/api-routes/mailbox-routes.js +3 -3
  22. package/lib/api-routes/message-routes.js +15 -7
  23. package/lib/api-routes/oauth2-app-routes.js +15 -8
  24. package/lib/api-routes/outbox-routes.js +77 -66
  25. package/lib/api-routes/permission-map.js +55 -6
  26. package/lib/api-routes/scoped-routes.js +74 -0
  27. package/lib/api-routes/settings-routes.js +11 -4
  28. package/lib/api-routes/stats-routes.js +5 -1
  29. package/lib/api-routes/submit-routes.js +4 -3
  30. package/lib/api-routes/template-routes.js +7 -6
  31. package/lib/api-routes/token-routes.js +11 -5
  32. package/lib/api-routes/webhook-delivery-routes.js +262 -0
  33. package/lib/api-routes/webhook-route-routes.js +119 -4
  34. package/lib/calendar-event.js +81 -1
  35. package/lib/consts.js +38 -46
  36. package/lib/db.js +14 -6
  37. package/lib/delivery-error.js +6 -0
  38. package/lib/deprecations.js +270 -0
  39. package/lib/email-client/base-client.js +130 -156
  40. package/lib/email-client/fallback-poll.js +62 -0
  41. package/lib/email-client/gmail-client.js +51 -11
  42. package/lib/email-client/imap/adaptive-idle-store.js +73 -0
  43. package/lib/email-client/imap/adaptive-idle.js +278 -0
  44. package/lib/email-client/imap/connection-errors.js +14 -1
  45. package/lib/email-client/imap/idle-settings.js +31 -5
  46. package/lib/email-client/imap/listing-diff.js +37 -0
  47. package/lib/email-client/imap/mailbox.js +372 -226
  48. package/lib/email-client/imap/subconnection.js +7 -29
  49. package/lib/email-client/imap/sync-operations.js +220 -127
  50. package/lib/email-client/imap-client.js +227 -163
  51. package/lib/email-client/message-builder.js +14 -79
  52. package/lib/email-client/outlook-client.js +372 -338
  53. package/lib/email-client/smtp-pool-manager.js +16 -13
  54. package/lib/email-client/sync-state-fields.js +19 -0
  55. package/lib/encrypt.js +157 -41
  56. package/lib/enum-descriptions.js +3 -1
  57. package/lib/env-setting-overrides.js +288 -0
  58. package/lib/export-worker.js +751 -0
  59. package/lib/export.js +64 -15
  60. package/lib/gateway.js +17 -1
  61. package/lib/get-raw-email.js +25 -107
  62. package/lib/health.js +75 -0
  63. package/lib/lock-run.js +119 -0
  64. package/lib/logger-consts.js +48 -0
  65. package/lib/logger.js +1 -1
  66. package/lib/lua/z-head-scores.lua +28 -0
  67. package/lib/network-errors.js +1 -1
  68. package/lib/node-version.js +24 -0
  69. package/lib/notify-attachments.js +20 -1
  70. package/lib/oauth2-apps.js +630 -655
  71. package/lib/outbox.js +184 -54
  72. package/lib/parse-message.js +3 -3
  73. package/lib/privileged-settings.js +2 -2
  74. package/lib/queue-browser/definitions.js +11 -0
  75. package/lib/queue-browser/index.js +68 -19
  76. package/lib/queue-job-actions.js +18 -1
  77. package/lib/queue-retention.js +48 -12
  78. package/lib/queue-stats.js +11 -2
  79. package/lib/read-env-value.js +3 -0
  80. package/lib/redis-memory-warnings.js +99 -0
  81. package/lib/redis-reconnect.js +29 -0
  82. package/lib/request-timing.js +23 -0
  83. package/lib/respawn-backoff.js +35 -0
  84. package/lib/rewrite-text-nodes.js +19 -59
  85. package/lib/schemas.js +163 -39
  86. package/lib/settings.js +6 -2
  87. package/lib/smtp-auth.js +19 -1
  88. package/lib/thread-diagnostics.js +18 -1
  89. package/lib/tls/provision.js +6 -3
  90. package/lib/token-audit-log.js +19 -20
  91. package/lib/token-permission-view.js +4 -3
  92. package/lib/tools.js +8 -41
  93. package/lib/ui-routes/admin-config-routes.js +64 -90
  94. package/lib/ui-routes/admin-entities-routes.js +2 -14
  95. package/lib/ui-routes/imap-idle-field.js +1 -1
  96. package/lib/ui-routes/outlook-subscription-view.js +1 -1
  97. package/lib/ui-routes/overridable-fields.js +84 -0
  98. package/lib/ui-routes/queue-routes.js +8 -5
  99. package/lib/ui-routes/settings-page.js +6 -0
  100. package/lib/utils/decode-headers.js +3 -12
  101. package/lib/utils/filter-empty.js +20 -0
  102. package/lib/utils/int-setting.js +48 -0
  103. package/lib/utils/tracking-settings.js +35 -0
  104. package/lib/web-safe-html.js +18 -105
  105. package/lib/webhook-delivery.js +461 -0
  106. package/lib/webhook-failures.js +132 -0
  107. package/lib/webhook-request.js +29 -1
  108. package/lib/webhook-routing.js +30 -1
  109. package/lib/webhook-test.js +88 -0
  110. package/lib/webhooks.js +54 -41
  111. package/lib/worker-rpc-error.js +2 -1
  112. package/package.json +21 -20
  113. package/sbom.json +304 -382
  114. package/server.js +149 -76
  115. package/static/js/ace/ace.js +1 -1
  116. package/static/licenses.html +21 -31
  117. package/translations/messages.pot +26 -26
  118. package/views/config/security.hbs +22 -0
  119. package/views/config/service.hbs +44 -0
  120. package/views/config/webhooks.hbs +36 -0
  121. package/views/partials/queue_retention_note.hbs +12 -8
  122. package/views/partials/ui/env-managed-alert.hbs +16 -7
  123. package/workers/api.js +102 -28
  124. package/workers/export.js +16 -631
  125. package/workers/imap.js +13 -0
  126. package/workers/smtp.js +9 -11
  127. package/workers/webhooks.js +18 -432
  128. package/lib/email-client/outlook-fallback-poll.js +0 -30
package/.ncurc.js CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  module.exports = {
4
4
  upgrade: true,
5
- // Node 20 is a hard runtime floor, not a preference. The DigitalOcean one-click images run
5
+ // Node 20 is a hard runtime floor, not a preference (engines.node says >=20.19.0, the oldest 20.x the
6
+ // dependency tree itself accepts; server.js only warns below it). The DigitalOcean one-click images run
6
7
  // EmailEngine on Node 20 and ship an upgrade script for EmailEngine but none for Node, so those
7
8
  // installs keep self-updating on a runtime that never moves; raising the floor breaks them on
8
9
  // their next upgrade. Node 20 being EOL upstream, and CI and the pkg targets being on Node 24,
@@ -12,7 +13,13 @@ module.exports = {
12
13
  // CommonJS and is bundled into a binary with pkg), needs a Node newer than the floor above, or
13
14
  // is a major we are deliberately soaking. Using 'minor' instead of a blanket reject so these
14
15
  // still receive security/patch updates within the safe major instead of being frozen at one
15
- // exact version. Verified against Node 20 (Docker) 2026-06-17.
16
+ // exact version. Last verified against Node 20 (Docker) 2026-06-17; re-check whenever an entry
17
+ // below is reconsidered.
18
+ //
19
+ // Two different constraints drive these caps, and they lift on different terms. "Needs a newer
20
+ // Node" is the floor above. "ESM-only" is pkg: the binary bundles a CommonJS module graph and cannot
21
+ // load ES modules whatever Node version runs it, so an ESM-only runtime dependency stays out even
22
+ // if the floor ever moves (see "Pure JavaScript only" in CLAUDE.md).
16
23
  //
17
24
  // `pino` is capped harder than the rest, at 'patch', because the break arrived in a MINOR and a
18
25
  // major cap would not have stopped it. See its entry below.
@@ -41,20 +48,26 @@ module.exports = {
41
48
  // Same spec passes in 3.8 s on 1.63.0; nothing in the 1.64 release notes covers
42
49
  // it. Lift once a 1.64.x or later passes that spec unchanged.
43
50
  // gettext-parser - 8.x is ESM-only
44
- // xgettext-template - 6.x is ESM-only (translation build tool)
51
+ // xgettext-template - 6.x and later are ESM-only and need Node >=22. It only runs as a CLI in the
52
+ // translation build, so ESM alone would not keep it out (build tools are exempt
53
+ // from the CommonJS rule); the Node requirement does, since the tooling has to
54
+ // run on the Node 20 floor too.
45
55
  // undici - 8.x requires Node >=22.19 and crashes at require() on Node 20. Permanent while the
46
56
  // Node 20 floor above stands.
47
57
  // marked - 16.x dropped the CommonJS build (ESM-only, needs require(esm)/Node >=20.19); 15.x is the
48
58
  // last require()-compatible line. 15.0.12 verified on Node 20-24 and in a yao/pkg node24 build.
49
- // Permanent while the Node 20 floor above stands.
59
+ // Permanent: an ESM-only release cannot be bundled by pkg, whatever the Node floor.
50
60
  // iconv-lite - 1.0 (alpha since 2026-10) requires Node >=22 and moves to ES modules, relying on
51
61
  // require(esm). Held on 0.x; libmime, imapflow and mailparser carry the same cap.
62
+ // The ES module move keeps it out of the pkg bundle even past the Node floor.
52
63
  // he - 2.x is ESM-only (exports only src/he.mjs) and requires Node >=22; require('he') throws
53
64
  // ERR_REQUIRE_ESM on Node 20 before 20.19. 1.2.0 is the last CommonJS release. mailparser,
54
65
  // which reaches EmailEngine through the same require, rejects 2.x for the same reason.
66
+ // Permanent for the same pkg reason as marked, not because of the Node floor.
55
67
  // @sentry/node-core - held on the 10.x line for the reasons @sentry/node (which it replaced, through its
56
- // `light` entry) was held there: @sentry/node 11.x requires Node >=20.19 (the DigitalOcean
57
- // images are not guaranteed to be on a 20.x that new), and it depends on
68
+ // `light` entry) was held there: @sentry/node 11.x requires Node >=20.19 (engines now says the
69
+ // same, but the startup check only warns below it, so a DigitalOcean image on an older 20.x
70
+ // still runs; the error-reporting path must not be what fails there), and it depends on
58
71
  // @sentry/bundler-plugins, which pulls the 16 MB Sentry CLI (package `sentry`, licensed
59
72
  // FSL-1.1-Apache-2.0, not an OSI license) into the runtime tree and the pkg bundle. The
60
73
  // node-core line is versioned in step with @sentry/node, so lift this only once an 11.x
@@ -81,5 +94,10 @@ module.exports = {
81
94
  // @asamuzakjp/css-color >=4.1.2 pulls in @csstools/* v4 which are pure ESM and break pkg bundling
82
95
  // (transitive via @postalsys/email-text-tools -> jsdom -> cssstyle; also pinned in package.json "overrides").
83
96
  '@asamuzakjp/css-color'
97
+ // Not a direct dependency, so nothing here moves it: the "overrides" entry in package.json
98
+ // lifts cheerio from the 1.0.0 that juice 11 (via @postalsys/email-text-tools) pins exactly,
99
+ // which drags in a second copy of undici (6.x) next to ours. cheerio 1.2.0 shares our undici
100
+ // 7 and keeps a CommonJS build; juice 12 would fix this itself but is ESM-only and needs
101
+ // Node 22. Re-check the override when juice or email-text-tools changes its cheerio range.
84
102
  ]
85
103
  };
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "2.85.0"
2
+ ".": "2.86.0"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,79 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.86.0](https://github.com/postalsys/emailengine/compare/v2.85.0...v2.86.0) (2026-10-22)
4
+
5
+
6
+ ### Features
7
+
8
+ * make the failed-job retention, token log and thread collapse limits settings ([6d297cf](https://github.com/postalsys/emailengine/commit/6d297cf18701827a32ce8ec80a717c289975f781))
9
+ * per-account outbox endpoints and account and state filters on GET /v1/outbox ([9536c3d](https://github.com/postalsys/emailengine/commit/9536c3dfba6bf81aed0ac0f01742684e275d594b))
10
+ * REST endpoints for failed webhook deliveries ([3dfd5cf](https://github.com/postalsys/emailengine/commit/3dfd5cfe2fa307ed54dd78c7f3f1a7661f8dae19))
11
+ * REST endpoints for the admin UI actions that had none ([7a0bc67](https://github.com/postalsys/emailengine/commit/7a0bc6749f683af2e804dc96500774352b2383f3))
12
+ * webhooksDeliveryAttempts and webhooksRetryDelay settings for the webhook retry policy ([4e54e99](https://github.com/postalsys/emailengine/commit/4e54e9911cad156ee24f16c77c7b0a2034baedc3))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * accept a duration for EENGINE_GMAIL_FALLBACK_POLL_INTERVAL ([431be3a](https://github.com/postalsys/emailengine/commit/431be3a2e98299f3772727aa2b48cb856b17a524))
18
+ * announce that the pre-2.79 token endpoints and legacy SMTP options go after 2027-01-01 ([1a81df4](https://github.com/postalsys/emailengine/commit/1a81df4e67a89b537f12aaf41b66caa66eec1b88))
19
+ * announce the removal of the leftover deprecated request fields and the bull-board redirects ([531c411](https://github.com/postalsys/emailengine/commit/531c411d96a1fd2e5e6f6dfd5fca72b3df6a5068))
20
+ * answer every API 404 with code NotFound ([ff9c5c9](https://github.com/postalsys/emailengine/commit/ff9c5c9f399a9b55cd6c1f32569d8198e84cfd13))
21
+ * bump bullmq to 6.4.0 ([e687a87](https://github.com/postalsys/emailengine/commit/e687a877d644961a7a75447867412b76e59807f6))
22
+ * clean failed queue jobs by EENGINE_QUEUE_KEEP_FAILED_AGE instead of a fixed week ([3a404a5](https://github.com/postalsys/emailengine/commit/3a404a5fcd94fed1c1466a5fc69a7fa4fb8477df))
23
+ * clean failed queue jobs by the failed-job retention setting ([95fc040](https://github.com/postalsys/emailengine/commit/95fc04085e88a2c22b9a586eb849427847ad426f))
24
+ * close the IMAP command connection within the IDLE restart interval ([a659c26](https://github.com/postalsys/emailengine/commit/a659c266b9fb8d48004f1b3022e7dcb5d4229a54))
25
+ * count each queue's failed jobs in the same read and the three queues at once for /metrics ([7c47e8d](https://github.com/postalsys/emailengine/commit/7c47e8dcda6d86db626d0a01f8c566a5743304a1))
26
+ * cut per-account and per-message Redis round trips on the sync paths ([7e2cefe](https://github.com/postalsys/emailengine/commit/7e2cefed2470a49b2ca4e03466cacf8737c99081))
27
+ * declare Node 20.19.0 in engines and warn at startup on an older 20.x ([95b8d53](https://github.com/postalsys/emailengine/commit/95b8d53f7d131eb637cfc878858dad3f957a9d9e))
28
+ * decode outbound text parts with libmime and leave a part it can not decode untouched ([efa6406](https://github.com/postalsys/emailengine/commit/efa6406f8d44e8d01c5212e49fd213bb451e9859))
29
+ * derive account credential keys off the event loop when loading account data ([a530179](https://github.com/postalsys/emailengine/commit/a53017938e22bc26a8fda4d34664c253f7f0af2b))
30
+ * encode custom headers on the raw send path and use nodemailer's own delivery details ([d59b382](https://github.com/postalsys/emailengine/commit/d59b382427ae449907e364b92bef59bdb5691bf6))
31
+ * end an IMAP sync pass when ImapFlow finds no mailbox selected, and use its public client API ([8521aeb](https://github.com/postalsys/emailengine/commit/8521aebbd791115f08fbc47ec0f05197547effab))
32
+ * extend the export job lock per message, not per batch of 100 ([f22b1d1](https://github.com/postalsys/emailengine/commit/f22b1d1015830e4831f406b94f876a8e37db586f))
33
+ * filter a queue listing by account or route on the job data alone ([08300f9](https://github.com/postalsys/emailengine/commit/08300f9e44427fc1a82af267d42b5148548f7f2f))
34
+ * give the Docker image a health check and keep its application tree read-only ([0c0b70d](https://github.com/postalsys/emailengine/commit/0c0b70d014645f513ab8db261c0ad8c23265cb14))
35
+ * index a full sync's changed messages a chunk at a time and drop deleted ones in the same round trip ([8b49c09](https://github.com/postalsys/emailengine/commit/8b49c0996eb4c73ba9bf3eefd07db501e01166db))
36
+ * keep retrying account assignment after the quick retries at startup ([de1c8d6](https://github.com/postalsys/emailengine/commit/de1c8d6b38e436fe01e05def11315a0f713b60db))
37
+ * learn the IDLE restart interval of a server that drops idle sessions ([19c3844](https://github.com/postalsys/emailengine/commit/19c384493261881af18f58053191f1850257072c))
38
+ * let EENGINE_REDIS_PREFIX and the other lib/consts.js variables be read from a file ([de9ba70](https://github.com/postalsys/emailengine/commit/de9ba705dfa3653f84e3dccf8e91a93fb4579f36))
39
+ * let POST /v1/settings clear the overridable settings, and parse their values in one place ([7bcd190](https://github.com/postalsys/emailengine/commit/7bcd1902de9ea078dc947bf64e48304c466a46c4))
40
+ * list the GET /v1/settings include flags as chips again in the API reference ([7b5c122](https://github.com/postalsys/emailengine/commit/7b5c122d658eea0bbcaeeb217acc6bf26095e0c0))
41
+ * make account flush and delete complete on Gmail API and MS Graph accounts ([7484bdc](https://github.com/postalsys/emailengine/commit/7484bdc9b8976e6502cd628d496cf74f4ab493e8))
42
+ * MCP tools for the new endpoints, server signatures and raw message source ([aeb1ae5](https://github.com/postalsys/emailengine/commit/aeb1ae57aaf99ac84a6762316835971ef1bcb9d3))
43
+ * name every OpenAPI schema deliberately and describe the terse operations ([4e7bddc](https://github.com/postalsys/emailengine/commit/4e7bddc4f392196190788775b20dc116d1d5d7a9))
44
+ * parse envelope recipients and header addresses with mailparser ([378b003](https://github.com/postalsys/emailengine/commit/378b003800d5c9ba0e7b3bc7dec6639cd661f124))
45
+ * queue a message through outbox.enqueue() and read its queue settings in one round trip ([54c66d4](https://github.com/postalsys/emailengine/commit/54c66d4407a26fc53d9495feaf5ed88a419b8e61))
46
+ * queue export messages a page at a time and write export progress once per batch ([d22d9f0](https://github.com/postalsys/emailengine/commit/d22d9f0e052f0abfbf264051fe0d53b757d207e3))
47
+ * queue new messages of an IMAP fast sync in one transaction instead of two round trips each ([ed8cc3f](https://github.com/postalsys/emailengine/commit/ed8cc3f1966615871d4d551eced2c50f467e4a86))
48
+ * read only the jobs of the page shown when listing one account's outbox ([2ffbcfe](https://github.com/postalsys/emailengine/commit/2ffbcfe034d705b3e2128638b414ebf1a29e049a))
49
+ * read only what the category lookup, webhook clears and account teardown need ([6c3d081](https://github.com/postalsys/emailengine/commit/6c3d081d019a1790b6d14dd3b06efd1b375d180e))
50
+ * read the IMAP message index once per chunk in a full sync and stop deleting the wrong entries ([34ca00b](https://github.com/postalsys/emailengine/commit/34ca00bd5d444b9125130263590725747451c317))
51
+ * refresh an open IMAP folder before searching it and share waiting sync passes ([2e5c436](https://github.com/postalsys/emailengine/commit/2e5c43693ce7bd5588ddf6fcc8167e42ee3bc3dd))
52
+ * refresh the public suffix list ([c72b1e1](https://github.com/postalsys/emailengine/commit/c72b1e1603f9a983557225a147f0383f35e79184))
53
+ * refresh the public suffix list ([eed6753](https://github.com/postalsys/emailengine/commit/eed67531b5cbeef1d313fff4f5bbd5bec70051c1))
54
+ * report export queue depth, failed jobs, API latency and per-thread heap in /metrics ([269876c](https://github.com/postalsys/emailengine/commit/269876c37366bce9916d771471f97fa01accfb5c))
55
+ * report missing IMAP workers from /health and add liveness and readiness endpoints ([f30f561](https://github.com/postalsys/emailengine/commit/f30f5611497b7627c10843283394beb75cad5825))
56
+ * resolve a sent message's tracking flags in one place ([1873f3c](https://github.com/postalsys/emailengine/commit/1873f3cabdcf3b000c8fecd1a0b833a9abec2073))
57
+ * resolve Gmail categories over IMAP for a whole pass of new messages at once ([710fc6b](https://github.com/postalsys/emailengine/commit/710fc6b9f2e0bd84b58c11b2175a6bb68c9c631a))
58
+ * restore the newer public suffix list, and never replace it with an older download ([3f2399a](https://github.com/postalsys/emailengine/commit/3f2399a1f558bad11ed56e386f5b478dcde8ae44))
59
+ * resume IDLE after an upload only once the connection is free ([1276c48](https://github.com/postalsys/emailengine/commit/1276c48ca81c6453df7b30da0744711ac296298e))
60
+ * search webhook routes by their target URL without its credentials ([c155541](https://github.com/postalsys/emailengine/commit/c155541254209605f11b9b903ed36fb16aee2ce6))
61
+ * send an API call's latency with its counter instead of a second message per request ([2822fe2](https://github.com/postalsys/emailengine/commit/2822fe262bc5c4b9f256cf5ae871f5d9f8999d2a))
62
+ * show why a first TLS certificate order failed instead of a guessed reason ([43bbdf5](https://github.com/postalsys/emailengine/commit/43bbdf5c6a66dd636cd67a8e0c468f0e228c4a68))
63
+ * skip messages deleted mid-listing on Gmail and stop leaking outbox content and download streams ([048b7d6](https://github.com/postalsys/emailengine/commit/048b7d61a2472d955305c5ed91f86d8ce2cd0648))
64
+ * stop a full Redis from turning into a worker restart loop ([936b937](https://github.com/postalsys/emailengine/commit/936b9379e22e73668765d48ed97bf9461fcc31bc))
65
+ * switch SMTP server authentication per session instead of for every open connection ([2a7c9de](https://github.com/postalsys/emailengine/commit/2a7c9deab05cb0099d848e0a5df181fef0a29936))
66
+ * the Gmail watch check reads the stored field through the account's own decoding ([5cbb53d](https://github.com/postalsys/emailengine/commit/5cbb53dd7c009f3f545717e677c88d48956b5765))
67
+ * the learned IDLE interval holds on hosts with several accounts and no longer reads its own side effects as a session cap ([808dd58](https://github.com/postalsys/emailengine/commit/808dd58969d8a5497bc2747c2852d019479e0567))
68
+ * update dependencies ([e2adc4f](https://github.com/postalsys/emailengine/commit/e2adc4f911e7745ec56ecd9ddb1361f7b222ee64))
69
+ * update dotenv to 18.0.9 ([ba55217](https://github.com/postalsys/emailengine/commit/ba55217b67d8682aa1a904265c8e80c742edec87))
70
+ * update ImapFlow to 2.6.0, nodemailer to 10.2.0, mailparser to 3.11.0 and the other libraries we own ([a98b458](https://github.com/postalsys/emailengine/commit/a98b458764e25c377379d3d6455f8bc86e17130c))
71
+ * update ImapFlow to 2.7.0 and ioredfour to 2.2.0 ([6bed980](https://github.com/postalsys/emailengine/commit/6bed980c867e64707d23b124a4c416df5c68f6e5))
72
+ * update ImapFlow to 2.8.0 and mailparser to 3.12.0 ([18023a1](https://github.com/postalsys/emailengine/commit/18023a185024615bad5e28844c4b284bd689a6d1))
73
+ * update ImapFlow to 2.9.0 ([1ec9a62](https://github.com/postalsys/emailengine/commit/1ec9a621df418554bc7981d5727e2ffa9ace3f52))
74
+ * update mailparser to 3.12.2 ([55cc131](https://github.com/postalsys/emailengine/commit/55cc1310f962bdd99c1e9de2815de5be5978d761))
75
+ * write a full sync's new and deleted messages a chunk at a time, and share the new-message enrichment ([bd60313](https://github.com/postalsys/emailengine/commit/bd603135dd1bf81df61f04de9c3614bc2e30e1ba))
76
+
3
77
  ## [2.85.0](https://github.com/postalsys/emailengine/compare/v2.84.2...v2.85.0) (2026-10-20)
4
78
 
5
79
 
package/Dockerfile CHANGED
@@ -88,7 +88,10 @@ RUN addgroup -S emailenginegroup && adduser -S emailengineuser -G emailenginegro
88
88
 
89
89
  WORKDIR /emailengine
90
90
 
91
- COPY --from=builder --chown=emailengineuser:emailenginegroup /emailengine /emailengine
91
+ # Owned by root and only readable by the runtime user, so a compromised process cannot rewrite the
92
+ # code it runs or plant a module the next start would load. Nothing at runtime writes under
93
+ # /emailengine: exports go to EENGINE_EXPORT_PATH, which defaults to the system temporary directory.
94
+ COPY --from=builder /emailengine /emailengine
92
95
 
93
96
  RUN node -e "console.log('node arch: ' + os.arch())"
94
97
  RUN node -e "console.log(process.versions)"
@@ -107,5 +110,15 @@ ENV MSGPACKR_NATIVE_ACCELERATION_DISABLED=true
107
110
  # binary bakes the same value in package.json, and test/node-heap-options-test.js keeps the two equal.
108
111
  ENV NODE_OPTIONS=--max-semi-space-size=16
109
112
 
113
+ EXPOSE 3000
114
+
115
+ # The liveness check: answers while the process can serve HTTP, without waiting on Redis or the
116
+ # workers, so an orchestrator restarts the container only when restarting can help. Readiness
117
+ # (workers and Redis) is /health/ready, for whatever routes traffic to it. 127.0.0.1 rather than
118
+ # localhost for the reason docker-compose.yml gives: BusyBox wget on musl tries ::1 only, and
119
+ # EmailEngine listens on IPv4. Shell form so a changed EENGINE_PORT (or PORT) is followed.
120
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
121
+ CMD wget --no-verbose --tries=1 --spider "http://127.0.0.1:${EENGINE_PORT:-${PORT:-3000}}/health/live" || exit 1
122
+
110
123
  ENTRYPOINT ["/usr/bin/dumb-init", "--"]
111
124
  CMD ["node", "/emailengine/server.js"]
package/ENVIRONMENT.md ADDED
@@ -0,0 +1,139 @@
1
+ # Environment variables
2
+
3
+ Every `EENGINE_*` variable EmailEngine reads. Most have a matching command line option and
4
+ configuration file key (see `config/default.toml`); the environment variable wins over both.
5
+
6
+ Any variable can also be read from a file: set `<NAME>_FILE` to the path of a file holding the
7
+ value (the Docker and Kubernetes secrets convention). Surrounding whitespace in the file is
8
+ trimmed, and a variable set directly wins over its `_FILE` form.
9
+
10
+ Durations take a number with a unit (`30s`, `10m`, `1h`, `7d`) or plain milliseconds unless the
11
+ entry says otherwise. Sizes take a number with a unit (`5MB`, `1GB`) or plain bytes.
12
+
13
+ `test/env-docs-guardrail-test.js` fails when the code reads a variable this file does not list.
14
+
15
+ ## Core
16
+
17
+ | Variable | Default | Description |
18
+ | --------------------------------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
19
+ | `EENGINE_REDIS` | `redis://127.0.0.1:6379/8` | Redis connection URI. `REDIS_URL` is read when this is unset. |
20
+ | `EENGINE_REDIS_PREFIX` | none | Prefix for every Redis key, so several instances can share one database. |
21
+ | `EENGINE_SECRET` | none | Encryption secret for stored credentials. Changing it makes stored credentials unreadable; use `emailengine encrypt` to rotate. |
22
+ | `EENGINE_PORT` | `3000` | API and admin UI port. `PORT` is read when this is unset. |
23
+ | `EENGINE_HOST` | `127.0.0.1` | API and admin UI bind address. |
24
+ | `EENGINE_TIMEOUT` | `10s` | How long an API request waits for a worker to answer (duration). |
25
+ | `EENGINE_LOG_LEVEL` | `trace` | Logging level. |
26
+ | `EENGINE_LOG_RAW` | `false` | Log raw IMAP and SMTP protocol traffic. Credentials are masked either way. |
27
+ | `EENGINE_SETTINGS` | none | JSON object of settings, re-applied on every start. A value saved in the admin UI for one of its keys reverts at the next restart. |
28
+ | `EENGINE_PREPARED_TOKEN` | none | A base64url msgpack-encoded API token to provision at start. |
29
+ | `EENGINE_PREPARED_PASSWORD` | none | A base64url PBKDF2 admin password hash to apply at start. Writing a different hash ends every admin session. |
30
+ | `EENGINE_PREPARED_LICENSE` | none | A license key to apply at start. |
31
+ | `EENGINE_REQUIRE_API_AUTH` | none | Initial value for whether API requests need an access token (`true`/`false`), used when the setting has never been saved. |
32
+ | `EENGINE_ENABLE_OAUTH_TOKENS_API` | none | Initial value for the setting that allows the OAuth2 access token API, used when it has never been saved. |
33
+ | `EENGINE_CONNECTION_SETUP_DELAY` | `0` | Pause between two account assignments while accounts are handed to workers, to spread the connection load at start (duration). |
34
+ | `EENGINE_UPDATE_CHECK_DISABLED` | `false` | Stop checking for new EmailEngine releases. |
35
+ | `EENGINE_BEACON_DISABLED` | `false` | Opt out of the anonymized feature-usage diagnostics sent with license validation. License validation itself is unaffected. |
36
+ | `EENGINE_DISABLE_SETUP_WARNINGS` | `false` | Hide the setup warning banners in the admin UI. |
37
+ | `EENGINE_DOCEAN` | none | Set by the DigitalOcean one-click image; adjusts the dashboard and diagnostics. Not for manual use. |
38
+ | `EENGINE_INSTALL_SCRIPT` | none | Set by the install script; adjusts the dashboard and diagnostics. Not for manual use. |
39
+
40
+ ## Workers and queues
41
+
42
+ | Variable | Default | Description |
43
+ | ---------------------------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
44
+ | `EENGINE_WORKERS` | `4` | IMAP worker threads. |
45
+ | `EENGINE_WORKERS_API` | `1` | API worker threads. Values above 1 need `SO_REUSEPORT` (Linux) and fall back to 1 elsewhere. |
46
+ | `EENGINE_WORKERS_WEBHOOKS` | `1` | Webhook worker threads. |
47
+ | `EENGINE_WORKERS_SUBMIT` | `1` | Submit (outgoing mail) worker threads. |
48
+ | `EENGINE_WORKERS_EXPORT` | `1` | Export worker threads. |
49
+ | `EENGINE_NOTIFY_QC` | `1` | Webhook deliveries each webhook worker runs at once. |
50
+ | `EENGINE_SUBMIT_QC` | `1` | Messages each submit worker sends at once. |
51
+ | `EENGINE_SUBMIT_DELAY` | none | Minimum delay between two messages from one submit worker (duration). |
52
+ | `EENGINE_EXPORT_QC` | `1` | Exports each export worker runs at once. |
53
+ | `EENGINE_EXPORT_TIMEOUT` | `5m` | Timeout of a single export operation (duration). |
54
+ | `EENGINE_EXPORT_PATH` | system temporary directory | Where export files are written. |
55
+ | `EENGINE_EXPORT_MAX_AGE` | `86400000` | How long a finished export is kept, in milliseconds. The `exportMaxAge` setting wins when set. |
56
+ | `EENGINE_QUEUE_REMOVE_AFTER` | `0` | Initial value for the `queueKeep` setting: completed queue entries to retain. |
57
+ | `EENGINE_QUEUE_KEEP_FAILED` | `500` | Failed queue entries retained per queue, at least. Overrides the `queueKeepFailed` setting. |
58
+ | `EENGINE_QUEUE_KEEP_FAILED_AGE` | `604800` | How long failed queue entries are retained, in seconds. Overrides the `queueKeepFailedAge` setting. |
59
+ | `EENGINE_QUEUE_KEEP_FAILED_CONTENT` | `100` | How many of the most recent failed messages keep their content so they can be retried (`0` keeps none). Overrides the `queueKeepFailedContent` setting. |
60
+ | `EENGINE_QUEUE_KEEP_FAILED_CONTENT_SIZE` | `100MB` | Total size of the retained failed-message content (size). Overrides the `queueKeepFailedContentSize` setting. |
61
+
62
+ ## Mail synchronization
63
+
64
+ | Variable | Default | Description |
65
+ | ---------------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
66
+ | `EENGINE_FETCH_BATCH_SIZE` | `1000` | Messages fetched per IMAP FETCH command during a sync. |
67
+ | `EENGINE_CHUNK_SIZE` | `1000000` | Chunk size for streaming attachment and message downloads (size). |
68
+ | `EENGINE_IMAP_SOCKET_TIMEOUT` | ImapFlow default | Inactivity timeout of IMAP connections (duration). |
69
+ | `EENGINE_DISABLE_COMPRESSION` | `false` | Do not negotiate IMAP COMPRESS=DEFLATE. |
70
+ | `EENGINE_IMAP_STALE_CHECK_INTERVAL` | disabled | Quiet period after which a resync checks the main mailbox over the command connection and reconnects an account whose primary connection stopped seeing new messages (duration). |
71
+ | `EENGINE_MAX_IMAP_AUTH_FAILURE_TIME` | `3d` | How long authentication may keep failing before syncing is switched off for the account (duration). |
72
+ | `EENGINE_GMAIL_FALLBACK_POLL_INTERVAL` | `10m` | How often a Gmail API account polls for changes when no Pub/Sub notification arrives (duration, or plain milliseconds). |
73
+ | `EENGINE_OUTLOOK_FALLBACK_POLL_INTERVAL` | `10m` | How often each MS Graph account runs a missed-notification recovery pass (duration, `0` disables, never below 10 seconds). |
74
+ | `EENGINE_FETCH_TIMEOUT` | `90000` | Response timeout of outbound HTTP requests made through the shared dispatchers (provider APIs, OAuth2, attachments given by URL), in milliseconds. |
75
+
76
+ ## API and admin UI
77
+
78
+ | Variable | Default | Description |
79
+ | --------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
80
+ | `EENGINE_API_PROXY` | `false` | Trust `X-Forwarded-For` from a reverse proxy. The Docker image sets it to `true`. |
81
+ | `EENGINE_API_PROXY_ADDRESSES` | none | IPs or CIDRs of the proxies allowed to set `X-Forwarded-For`. Set it whenever you rely on the admin address allowlist or per-token address restrictions. |
82
+ | `EENGINE_ADMIN_ACCESS_ADDRESSES` | none | IPs or CIDRs allowed to reach `/admin`. |
83
+ | `EENGINE_CORS_ORIGIN` | none | Allowed CORS origins, space separated (`*` for any). CORS is off while unset. |
84
+ | `EENGINE_CORS_MAX_AGE` | `60` | How long browsers may cache a CORS preflight answer, in seconds. |
85
+ | `EENGINE_MAX_SIZE` | `5MB` | Largest attachment accepted in an API request (size). |
86
+ | `EENGINE_MAX_BODY_SIZE` | `50MB` | Largest API request body (size). |
87
+ | `EENGINE_MAX_PAYLOAD_TIMEOUT` | `10s` | How long an API request body may take to arrive (duration). |
88
+ | `EENGINE_CSP_MODE` | `enforce` | How the Content-Security-Policy is delivered: `enforce`, `report-only` or `off`. |
89
+ | `EENGINE_DISABLE_MESSAGE_BROWSER` | `false` | Remove the message browser from the account pages. |
90
+ | `EENGINE_MCP_ENABLED` | `true` | Register the MCP endpoint routes. The `mcpEnabled` setting is the runtime switch. |
91
+ | `EENGINE_TOKEN_LOG_ENTRIES` | `1000` | Requests retained per access token in the audit log. Overrides the `tokenLogEntries` setting. |
92
+ | `EENGINE_TOKEN_LOG_AGE` | `604800` | How long a token's audit log survives its last use, in seconds. Overrides the `tokenLogAge` setting. |
93
+ | `EENGINE_DISABLE_THREAD_COLLAPSE` | `false` | Stop web-safe HTML from folding quoted thread history into a collapsed block. Overrides the `disableThreadCollapse` setting. |
94
+
95
+ ## Webhooks and outbound HTTP
96
+
97
+ | Variable | Default | Description |
98
+ | ------------------------------- | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
99
+ | `EENGINE_WEBHOOK_TIMEOUT` | `30s` | Wall-clock cap on one webhook delivery attempt (duration). |
100
+ | `EENGINE_WEBHOOK_EGRESS_POLICY` | `link-local` | Where webhook deliveries and autodiscovery lookups may connect: `link-local`, `private` or `off`. |
101
+ | `EENGINE_HTTP_PROXY_ENABLED` | none | Overrides the `httpProxyEnabled` setting (the dedicated proxy for outbound HTTP). `false` keeps HTTP direct while IMAP and SMTP use the global proxy. |
102
+ | `EENGINE_HTTP_PROXY_URL` | none | Overrides the `httpProxyUrl` setting. |
103
+ | `EENGINE_GCP_METADATA_HOST` | `metadata.google.internal` | Where a Cloud Pub/Sub app using the attached service account reaches the metadata server (`host`, `host:port` or `http://host[:port]`). |
104
+
105
+ ## Built-in SMTP server and IMAP proxy
106
+
107
+ The `EENGINE_SMTP_ENABLED`, `_SECRET`, `_PORT`, `_HOST` and `_PROXY` variables are deprecated and
108
+ will be removed after 2027-01-01; configure the SMTP server in the admin UI or through the settings
109
+ API instead. All of these only seed the setting while it has never been saved.
110
+
111
+ | Variable | Default | Description |
112
+ | ------------------------------- | ----------- | ----------------------------------------------------------------- |
113
+ | `EENGINE_SMTP_ENABLED` | `false` | Initial value for `smtpServerEnabled`. Deprecated. |
114
+ | `EENGINE_SMTP_SECRET` | none | Initial value for `smtpServerPassword`. Deprecated. |
115
+ | `EENGINE_SMTP_PORT` | `2525` | Initial value for `smtpServerPort`. Deprecated. |
116
+ | `EENGINE_SMTP_HOST` | `127.0.0.1` | Initial value for `smtpServerHost`. Deprecated. |
117
+ | `EENGINE_SMTP_PROXY` | `false` | Initial value for `smtpServerProxy` (PROXY protocol). Deprecated. |
118
+ | `EENGINE_SMTP_MAX_CLIENTS` | `100` | Maximum concurrent SMTP server connections. |
119
+ | `EENGINE_MAX_SMTP_MESSAGE_SIZE` | `25MB` | Largest message the SMTP server accepts (size). |
120
+ | `EENGINE_IMAP_PROXY_ENABLED` | `false` | Initial value for `imapProxyServerEnabled`. |
121
+ | `EENGINE_IMAP_PROXY_SECRET` | none | Initial value for `imapProxyServerPassword`. |
122
+ | `EENGINE_IMAP_PROXY_PORT` | `2993` | Initial value for `imapProxyServerPort`. |
123
+ | `EENGINE_IMAP_PROXY_HOST` | `127.0.0.1` | Initial value for `imapProxyServerHost`. |
124
+ | `EENGINE_IMAP_PROXY_PROXY` | `false` | Initial value for `imapProxyServerProxy` (PROXY protocol). |
125
+ | `EENGINE_IMAPPROXY_MAX_CLIENTS` | `1000` | Maximum concurrent IMAP proxy connections. |
126
+
127
+ ## TLS
128
+
129
+ | Variable | Default | Description |
130
+ | ---------------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
131
+ | `EENGINE_API_TLS` | `false` | Serve the API and admin UI over HTTPS. |
132
+ | `EENGINE_API_TLS_*` | none | TLS material and options for the API listener: `_CERT`, `_KEY`, `_CA`, `_DHPARAM`, `_PASSPHRASE`, `_CIPHERS`, `_ECDH_CURVE`, `_MIN_VERSION`, `_MAX_VERSION`, `_REJECT_UNAUTHORIZED`, `_REQUEST_CERT`. Material given here outranks every certificate EmailEngine manages. |
133
+ | `EENGINE_SMTP_TLS_*` | none | The same names for the SMTP server. |
134
+ | `EENGINE_IMAPPROXY_TLS_*` | none | The same names for the IMAP proxy. |
135
+ | `EENGINE_TLS_MIN_VERSION` | `TLSv1` | Oldest TLS version accepted when connecting to mail servers. |
136
+ | `EENGINE_TLS_MIN_DH_SIZE` | `1024` | Smallest Diffie-Hellman key accepted from mail servers. |
137
+ | `EENGINE_TLS_CIPHERS` | `DEFAULT@SECLEVEL=0` | Cipher list for connections to mail servers. |
138
+ | `EENGINE_ACME_DIRECTORY_URL` | Let's Encrypt production | ACME directory certificates are ordered from. Override together with `EENGINE_ACME_ENVIRONMENT`. |
139
+ | `EENGINE_ACME_ENVIRONMENT` | `emailengine` | Name of the stored ACME account record. Override together with `EENGINE_ACME_DIRECTORY_URL`. |
package/README.md CHANGED
@@ -62,7 +62,7 @@ A headless email client application that provides access to IMAP, SMTP, Gmail AP
62
62
 
63
63
  ## Configuring EmailEngine
64
64
 
65
- Refer to the [configuration documentation](https://learn.emailengine.app/docs/configuration) for details on setting up EmailEngine.
65
+ Refer to the [configuration documentation](https://learn.emailengine.app/docs/configuration) for details on setting up EmailEngine. [ENVIRONMENT.md](ENVIRONMENT.md) lists every environment variable EmailEngine reads, with its default.
66
66
 
67
67
  ## App Access
68
68
 
@@ -38,6 +38,8 @@ maxSize = "5M" # maximum size of an attachment when submitting or uploading
38
38
  #keyPath = "/path/to/key.pem"
39
39
 
40
40
  [smtp]
41
+ # enabled, port, host, secret and proxy are deprecated and removed after 2027-01-01. They only seed
42
+ # the SMTP server settings on a first start; configure the SMTP server in the admin UI instead
41
43
  enabled = false
42
44
  port = 2525
43
45
  host = "127.0.0.1"
@@ -95,8 +95,10 @@ node -e 'console.log("Google crawlers updated: "+require("./data/google-crawlers
95
95
 
96
96
  # The Public Suffix List, read by lib/utils/public-suffix.js. Kept verbatim (it is MPL-2.0 and carries
97
97
  # its own licence header), and only accepted when both sections arrived whole: a truncated list would
98
- # not fail to parse, it would just quietly know fewer suffixes.
99
- fetch_checked data/public_suffix_list.dat 'const t=require("fs").readFileSync(process.argv[1],"utf8");for(const m of ["===BEGIN ICANN DOMAINS===","===END ICANN DOMAINS===","===BEGIN PRIVATE DOMAINS===","===END PRIVATE DOMAINS==="])if(!t.includes(m))throw new Error("missing "+m)' wget -q -O - https://publicsuffix.org/list/public_suffix_list.dat
98
+ # not fail to parse, it would just quietly know fewer suffixes. Nor is a list older than the one
99
+ # already here: the site's CDN has served a copy two days behind the one committed the same morning,
100
+ # and the refresh replaced the newer list with it. Exit code 3 keeps the current copy without a warning
101
+ fetch_checked data/public_suffix_list.dat 'const fs=require("fs");const t=fs.readFileSync(process.argv[1],"utf8");for(const m of ["===BEGIN ICANN DOMAINS===","===END ICANN DOMAINS===","===BEGIN PRIVATE DOMAINS===","===END PRIVATE DOMAINS==="])if(!t.includes(m))throw new Error("missing "+m);const v=x=>((x.match(/^\/\/ VERSION: (\S+)/m)||[])[1]||"");let old="";try{old=v(fs.readFileSync(process.argv[2],"utf8"))}catch(e){}if(old&&v(t)<old){console.error("Public Suffix List: the download ("+(v(t)||"no version")+") is older than the copy here ("+old+"), keeping it");process.exit(3)}' wget -q -O - https://publicsuffix.org/list/public_suffix_list.dat
100
102
  grep -m1 '^// VERSION:' data/public_suffix_list.dat || true
101
103
 
102
104
  # The SBOM shipped in the binary and served at /sbom.json, generated from the installed tree by npm
@@ -1,5 +1,5 @@
1
1
  {
2
- "creationTime": "2026-10-20T14:46:18.000000",
2
+ "creationTime": "2026-10-22T14:46:14.000000",
3
3
  "prefixes": [
4
4
  {
5
5
  "ipv6Prefix": "2001:4860:4801:2008::/64"
@@ -5,8 +5,8 @@
5
5
  // Please pull this list from, and only from https://publicsuffix.org/list/public_suffix_list.dat,
6
6
  // rather than any other VCS sites. Pulling from any other URL is not guaranteed to be supported.
7
7
 
8
- // VERSION: 2026-10-20_08-40-56_UTC
9
- // COMMIT: 5dd321ffe02039e2431382a095cf80e27ff5eb94
8
+ // VERSION: 2026-10-22_08-36-41_UTC
9
+ // COMMIT: 8437e5262f13305f94087abe699b4fe2be1d1de8
10
10
 
11
11
  // Instructions on pulling and using this list can be found at https://publicsuffix.org/list/.
12
12
 
@@ -11346,9 +11346,10 @@ barsy.ca
11346
11346
  *.compute.estate
11347
11347
  *.alces.network
11348
11348
 
11349
- // Alibaba Cloud API Gateway
11349
+ // Alibaba
11350
11350
  // Submitted by Alibaba Cloud Security <cloud_product_security_team@alibaba-inc.com>
11351
11351
  alibabacloudcs.com
11352
+ *.ztna-dingtalk.com
11352
11353
  ms.fun
11353
11354
  ms.show
11354
11355
 
@@ -164,7 +164,26 @@ function planRebalance({ workerAssigned, availableWorkers }, targetWorker) {
164
164
  return moves;
165
165
  }
166
166
 
167
+ // Quick retries after an assignment pass that left accounts unassigned, then a slow one for as long
168
+ // as it takes: the quick ones used to be all there was, so a Redis or worker problem that outlasted
169
+ // them (about 30 seconds) left those accounts unassigned until something unrelated assigned again
170
+ const QUICK_ASSIGN_RETRIES = 3;
171
+ const QUICK_ASSIGN_RETRY_STEP = 5000;
172
+ const SLOW_ASSIGN_RETRY_DELAY = 60 * 1000;
173
+
174
+ /**
175
+ * Delay before the next assignment retry
176
+ * @param {number} retry - Consecutive retries so far, including this one (1 based)
177
+ * @returns {number} Milliseconds
178
+ */
179
+ function assignRetryDelay(retry) {
180
+ return retry <= QUICK_ASSIGN_RETRIES ? QUICK_ASSIGN_RETRY_STEP * retry : SLOW_ASSIGN_RETRY_DELAY;
181
+ }
182
+
167
183
  module.exports = {
184
+ assignRetryDelay,
185
+ QUICK_ASSIGN_RETRIES,
186
+ SLOW_ASSIGN_RETRY_DELAY,
168
187
  pickLeastLoadedWorker,
169
188
  rollbackAssignment,
170
189
  releaseWorkerAccounts,