emailengine-app 2.72.1 → 2.72.2

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.
@@ -1,6 +1,6 @@
1
1
  <!doctype html><html><head><meta charset="utf-8"><title>EmailEngine Licenses</title><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css" integrity="sha384-zCbKRCUGaJDkqS1kPbPd7TveP5iyJE0EjAuZQTgFLD2ylzuqKfdKlfG/eSrtxUkn" crossorigin="anonymous"></head><body>
2
2
  <div class="container-fluid">
3
- <h1>EmailEngine v2.72.0</h1><p>EmailEngine includes code from the following software packages:</p>
3
+ <h1>EmailEngine v2.72.1</h1><p>EmailEngine includes code from the following software packages:</p>
4
4
  <table class="table table-sm">
5
5
  <tr><thead class="thead-dark"><th>Package</th><th>Version</th><th>License</th><th>Publisher</th><th>Publisher's Email</th><th>Package URL</th></tr>
6
6
  <tbody>
@@ -1046,7 +1046,7 @@
1046
1046
  </tr>
1047
1047
  <tr>
1048
1048
  <td><a href="https://npmjs.com/package/@playwright/test">@playwright/test</a></td>
1049
- <td>1.61.0</td>
1049
+ <td>1.61.1</td>
1050
1050
  <td>Apache-2.0</td>
1051
1051
  <td>Microsoft Corporation</td>
1052
1052
  <td></td>
@@ -1086,7 +1086,7 @@
1086
1086
  </tr>
1087
1087
  <tr>
1088
1088
  <td><a href="https://npmjs.com/package/@postalsys/email-ai-tools">@postalsys/email-ai-tools</a></td>
1089
- <td>1.13.8</td>
1089
+ <td>1.13.9</td>
1090
1090
  <td>MIT</td>
1091
1091
  <td>Postal Systems O&#xDC;</td>
1092
1092
  <td></td>
@@ -1096,7 +1096,7 @@
1096
1096
  </tr>
1097
1097
  <tr>
1098
1098
  <td><a href="https://npmjs.com/package/@postalsys/email-text-tools">@postalsys/email-text-tools</a></td>
1099
- <td>2.4.8</td>
1099
+ <td>2.4.9</td>
1100
1100
  <td>MIT</td>
1101
1101
  <td>Postal Systems O&#xDC;</td>
1102
1102
  <td></td>
@@ -1246,7 +1246,7 @@
1246
1246
  </tr>
1247
1247
  <tr>
1248
1248
  <td><a href="https://npmjs.com/package/@sentry/core">@sentry/core</a></td>
1249
- <td>10.59.0</td>
1249
+ <td>10.61.0</td>
1250
1250
  <td>MIT</td>
1251
1251
  <td>Sentry</td>
1252
1252
  <td></td>
@@ -1256,7 +1256,7 @@
1256
1256
  </tr>
1257
1257
  <tr>
1258
1258
  <td><a href="https://npmjs.com/package/@sentry/node-core">@sentry/node-core</a></td>
1259
- <td>10.59.0</td>
1259
+ <td>10.61.0</td>
1260
1260
  <td>MIT</td>
1261
1261
  <td>Sentry</td>
1262
1262
  <td></td>
@@ -1266,7 +1266,7 @@
1266
1266
  </tr>
1267
1267
  <tr>
1268
1268
  <td><a href="https://npmjs.com/package/@sentry/node">@sentry/node</a></td>
1269
- <td>10.59.0</td>
1269
+ <td>10.61.0</td>
1270
1270
  <td>MIT</td>
1271
1271
  <td>Sentry</td>
1272
1272
  <td></td>
@@ -1276,7 +1276,7 @@
1276
1276
  </tr>
1277
1277
  <tr>
1278
1278
  <td><a href="https://npmjs.com/package/@sentry/opentelemetry">@sentry/opentelemetry</a></td>
1279
- <td>10.59.0</td>
1279
+ <td>10.61.0</td>
1280
1280
  <td>MIT</td>
1281
1281
  <td>Sentry</td>
1282
1282
  <td></td>
@@ -1286,7 +1286,7 @@
1286
1286
  </tr>
1287
1287
  <tr>
1288
1288
  <td><a href="https://npmjs.com/package/@sentry/server-utils">@sentry/server-utils</a></td>
1289
- <td>10.59.0</td>
1289
+ <td>10.61.0</td>
1290
1290
  <td>MIT</td>
1291
1291
  <td>Sentry</td>
1292
1292
  <td></td>
@@ -1336,7 +1336,7 @@
1336
1336
  </tr>
1337
1337
  <tr>
1338
1338
  <td><a href="https://npmjs.com/package/@simplewebauthn/server">@simplewebauthn/server</a></td>
1339
- <td>13.3.1</td>
1339
+ <td>13.3.2</td>
1340
1340
  <td>MIT</td>
1341
1341
  <td>Matthew Miller</td>
1342
1342
  <td>matthew@millerti.me</td>
@@ -1396,7 +1396,7 @@
1396
1396
  </tr>
1397
1397
  <tr>
1398
1398
  <td><a href="https://npmjs.com/package/@zone-eu/mailsplit">@zone-eu/mailsplit</a></td>
1399
- <td>5.4.12</td>
1399
+ <td>5.4.13</td>
1400
1400
  <td>(MIT OR EUPL-1.1+)</td>
1401
1401
  <td>Andris Reinman</td>
1402
1402
  <td></td>
@@ -1776,7 +1776,7 @@
1776
1776
  </tr>
1777
1777
  <tr>
1778
1778
  <td><a href="https://npmjs.com/package/bn.js">bn.js</a></td>
1779
- <td>4.12.3</td>
1779
+ <td>4.12.4</td>
1780
1780
  <td>MIT</td>
1781
1781
  <td>Fedor Indutny</td>
1782
1782
  <td>fedor@indutny.com</td>
@@ -1846,7 +1846,7 @@
1846
1846
  </tr>
1847
1847
  <tr>
1848
1848
  <td><a href="https://npmjs.com/package/bullmq">bullmq</a></td>
1849
- <td>5.79.0</td>
1849
+ <td>5.79.1</td>
1850
1850
  <td>MIT</td>
1851
1851
  <td>Taskforce.sh Inc.</td>
1852
1852
  <td></td>
@@ -2565,6 +2565,16 @@
2565
2565
  </td
2566
2566
  </tr>
2567
2567
  <tr>
2568
+ <td><a href="https://npmjs.com/package/entities">entities</a></td>
2569
+ <td>8.0.0</td>
2570
+ <td>BSD-2-Clause</td>
2571
+ <td>Felix Boehm</td>
2572
+ <td>me@feedic.com</td>
2573
+ <td>
2574
+ <a href="https://github.com/fb55/entities">github.com/fb55/entities</a>
2575
+ </td
2576
+ </tr>
2577
+ <tr>
2568
2578
  <td><a href="https://npmjs.com/package/es-define-property">es-define-property</a></td>
2569
2579
  <td>1.0.1</td>
2570
2580
  <td>MIT</td>
@@ -3646,7 +3656,7 @@
3646
3656
  </tr>
3647
3657
  <tr>
3648
3658
  <td><a href="https://npmjs.com/package/imapflow">imapflow</a></td>
3649
- <td>1.4.2</td>
3659
+ <td>1.4.3</td>
3650
3660
  <td>MIT</td>
3651
3661
  <td>Postal Systems O&#xDC;</td>
3652
3662
  <td></td>
@@ -3656,7 +3666,7 @@
3656
3666
  </tr>
3657
3667
  <tr>
3658
3668
  <td><a href="https://npmjs.com/package/import-in-the-middle">import-in-the-middle</a></td>
3659
- <td>3.1.0</td>
3669
+ <td>3.2.0</td>
3660
3670
  <td>Apache-2.0</td>
3661
3671
  <td>Bryan English</td>
3662
3672
  <td>bryan.english@datadoghq.com</td>
@@ -4076,7 +4086,7 @@
4076
4086
  </tr>
4077
4087
  <tr>
4078
4088
  <td><a href="https://npmjs.com/package/libmime">libmime</a></td>
4079
- <td>5.3.8</td>
4089
+ <td>5.4.0</td>
4080
4090
  <td>MIT</td>
4081
4091
  <td>Andris Reinman</td>
4082
4092
  <td>andris@kreata.ee</td>
@@ -4256,7 +4266,7 @@
4256
4266
  </tr>
4257
4267
  <tr>
4258
4268
  <td><a href="https://npmjs.com/package/mailparser">mailparser</a></td>
4259
- <td>3.9.11</td>
4269
+ <td>3.9.12</td>
4260
4270
  <td>MIT</td>
4261
4271
  <td>Andris Reinman</td>
4262
4272
  <td></td>
@@ -4566,7 +4576,7 @@
4566
4576
  </tr>
4567
4577
  <tr>
4568
4578
  <td><a href="https://npmjs.com/package/nanoid">nanoid</a></td>
4569
- <td>3.3.13</td>
4579
+ <td>3.3.15</td>
4570
4580
  <td>MIT</td>
4571
4581
  <td>Andrey Sitnik</td>
4572
4582
  <td>andrey@sitnik.ru</td>
@@ -4626,7 +4636,7 @@
4626
4636
  </tr>
4627
4637
  <tr>
4628
4638
  <td><a href="https://npmjs.com/package/node-html-parser">node-html-parser</a></td>
4629
- <td>7.1.0</td>
4639
+ <td>8.0.3</td>
4630
4640
  <td>MIT</td>
4631
4641
  <td>Xiaoyi Shi</td>
4632
4642
  <td>ashi009@gmail.com</td>
@@ -5096,7 +5106,7 @@
5096
5106
  </tr>
5097
5107
  <tr>
5098
5108
  <td><a href="https://npmjs.com/package/playwright-core">playwright-core</a></td>
5099
- <td>1.61.0</td>
5109
+ <td>1.61.1</td>
5100
5110
  <td>Apache-2.0</td>
5101
5111
  <td>Microsoft Corporation</td>
5102
5112
  <td></td>
@@ -5106,7 +5116,7 @@
5106
5116
  </tr>
5107
5117
  <tr>
5108
5118
  <td><a href="https://npmjs.com/package/playwright">playwright</a></td>
5109
- <td>1.61.0</td>
5119
+ <td>1.61.1</td>
5110
5120
  <td>Apache-2.0</td>
5111
5121
  <td>Microsoft Corporation</td>
5112
5122
  <td></td>
@@ -5266,7 +5276,7 @@
5266
5276
  </tr>
5267
5277
  <tr>
5268
5278
  <td><a href="https://npmjs.com/package/qs">qs</a></td>
5269
- <td>6.15.2</td>
5279
+ <td>6.15.3</td>
5270
5280
  <td>BSD-3-Clause</td>
5271
5281
  <td></td>
5272
5282
  <td></td>
@@ -5986,7 +5996,7 @@
5986
5996
  </tr>
5987
5997
  <tr>
5988
5998
  <td><a href="https://npmjs.com/package/swagger-ui-dist">swagger-ui-dist</a></td>
5989
- <td>5.32.6</td>
5999
+ <td>5.32.8</td>
5990
6000
  <td>Apache-2.0</td>
5991
6001
  <td></td>
5992
6002
  <td></td>
@@ -6066,7 +6076,7 @@
6066
6076
  </tr>
6067
6077
  <tr>
6068
6078
  <td><a href="https://npmjs.com/package/tldts-core">tldts-core</a></td>
6069
- <td>7.4.3</td>
6079
+ <td>7.4.4</td>
6070
6080
  <td>MIT</td>
6071
6081
  <td>R&#xE9;mi Berson</td>
6072
6082
  <td></td>
@@ -6076,7 +6086,7 @@
6076
6086
  </tr>
6077
6087
  <tr>
6078
6088
  <td><a href="https://npmjs.com/package/tldts">tldts</a></td>
6079
- <td>7.4.3</td>
6089
+ <td>7.4.4</td>
6080
6090
  <td>MIT</td>
6081
6091
  <td>R&#xE9;mi Berson</td>
6082
6092
  <td></td>
@@ -1,7 +1,7 @@
1
1
  msgid ""
2
2
  msgstr ""
3
3
  "Content-Type: text/plain; charset=ascii\n"
4
- "POT-Creation-Date: 2026-06-19 17:14+0000\n"
4
+ "POT-Creation-Date: 2026-06-26 08:10+0000\n"
5
5
 
6
6
  #: views/error.hbs:4
7
7
  #: workers/api.js:2957
@@ -126,14 +126,6 @@ msgstr ""
126
126
  msgid "Continue"
127
127
  msgstr ""
128
128
 
129
- #: views/accounts/register/index.hbs:2
130
- msgid "Choose your email account provider"
131
- msgstr ""
132
-
133
- #: views/accounts/register/index.hbs:15
134
- msgid "Standard IMAP"
135
- msgstr ""
136
-
137
129
  #: views/accounts/register/imap-server.hbs:19
138
130
  msgid "IMAP"
139
131
  msgstr ""
@@ -249,6 +241,14 @@ msgstr ""
249
241
  msgid "Request failed."
250
242
  msgstr ""
251
243
 
244
+ #: views/accounts/register/index.hbs:2
245
+ msgid "Choose your email account provider"
246
+ msgstr ""
247
+
248
+ #: views/accounts/register/index.hbs:15
249
+ msgid "Standard IMAP"
250
+ msgstr ""
251
+
252
252
  #: lib/autodetect-imap-settings.js:80
253
253
  msgid ""
254
254
  "Microsoft has disabled password-based sign-ins (including app passwords) "
@@ -1 +0,0 @@
1
- !placeholder
@@ -1,233 +0,0 @@
1
- # EmailEngine - Feature Map & Prioritized Test Plan
2
-
3
- Generated 2026-06-16. Read-only audit across five feature areas (email sync engine, REST API, admin UI, background workers/queues, core libraries). No source or tests were modified.
4
-
5
- Baseline: ~70k LOC source (lib + workers + server.js) vs ~16.1k LOC unit tests, ~1.8k integration, 180 e2e.
6
-
7
- ---
8
-
9
- ## 1. Feature & functionality map
10
-
11
- EmailEngine is a multi-threaded (Worker Threads), Redis-backed email sync platform exposing a REST API + admin UI.
12
-
13
- ### Email sync engine (lib/email-client/*, workers/imap.js, lib/account*)
14
- - Three providers behind a shared `BaseClient`: IMAP (ImapFlow + IDLE), Gmail API (Pub/Sub + 10-min poll fallback), Outlook/Graph (subscription webhooks, 3-day renewal).
15
- - Message ops: list/get/getText/getRawMessage/getAttachment/update/move/delete/upload (+ bulk variants).
16
- - Mailbox ops: list/create/modify/delete; special-use resolution; provider path encoding (Outlook `/`,`%`; Gmail label<->folder).
17
- - IMAP sync: `determineSyncStrategy` -> none/partial(condstore|simple)/full; UIDValidity change -> full resync + index reseed; lost-index silent reseed; batched fetch with retry/backoff.
18
- - Reliability: exponential reconnect/backoff; auth-failure tracking + auto-disable (`setErrorState`); error classification -> account state (authenticationError vs connectError); state machine (account-state.js).
19
- - Send path: `queueMessage`/`submitMessage` (SMTP + Gmail/Outlook API), idempotency keys, post-delivery Sent-folder upload + Answered/Forwarded flags + gateway stats.
20
-
21
- ### REST API (lib/api-routes/*, ~8.1k LOC, 20 modules)
22
- - Account + message + mailbox CRUD/ops; submit; outbox; export; gateways; templates; tokens; settings; oauth2-apps; webhook-routes; blocklist; chat (doc-store-gated); delivery-test; license; pubsub; stats; bull-board.
23
- - Single `api-token` bearer strategy: scope derived from route tags (all REST modules use `api`); account-token binding restricts to own `{account}`; IP/referrer allowlist + per-token rate limit; `disableTokens` open-API bypass.
24
-
25
- ### Admin UI (lib/ui-routes/*, lib/routes-ui.js, workers/api.js; ~128 routes)
26
- - Auth: session cookie (`ee`), TOTP, passkeys/WebAuthn (intentionally bypasses TOTP), OKTA OAuth2, pbkdf2 password, `passwordVersion` force-logout.
27
- - CSRF via @hapi/crumb (skip-list: api/metrics/static/external tags).
28
- - Config screens: webhooks, service, AI, logging/Sentry, license, OAuth apps, network/proxy, SMTP/IMAP-proxy servers, document-store (deprecated, self-gates off).
29
- - Public (auth:false) flows: add-account wizard (HMAC-signed form), OAuth start/redirect (account creation), unsubscribe.
30
-
31
- ### Background workers & servers (workers/*, server.js, lib/webhooks.js, lib/export.js)
32
- - Submit worker: BullMQ delivery, retry/backoff classification (`NON_RETRYABLE_CODES`, 5xx-not-503 -> discard).
33
- - Webhooks worker: BullMQ delivery (10 attempts, HMAC sig), custom routes with sandboxed `fn`/`map` (SubScript/vm).
34
- - Export worker: phased NDJSON export, gzip + optional AES-256-GCM, recovery, atomic concurrency Lua.
35
- - SMTP server (MSA) + IMAP proxy: three auth modes each (global password / scoped hex token / header or passthrough).
36
- - Documents worker: deprecated Elasticsearch indexing, gated off by default.
37
- - server.js main process: worker spawn/health/restart, account assignment (load-aware round-robin + rendezvous reassignment), RPC with timeout.
38
-
39
- ### Core libraries (lib/*)
40
- - oauth2-apps.js (OAuth2 app config + token orchestration, 5 providers, WIF, Pub/Sub IAM), oauth/* providers.
41
- - tokens.js (API + session tokens, hashed storage), encrypt.js (AES-256-GCM), settings.js (encrypted keys).
42
- - tools.js (binary sync-state serialize/unserialize, license verify, signed-form HMAC, glob matcher, redaction).
43
- - bounce-detect.js / arf-detect.js (DSN + FBL parsing), add-trackers.js, get-raw-email.js, autodetect-imap-settings.js, rewrite-text-nodes.js, templates.js, redis-operations.js.
44
-
45
- ---
46
-
47
- ## 2. Current coverage assessment
48
-
49
- Strong (real source imported, good cases):
50
- - IMAP sync-strategy helpers, lost-index recovery, processChanges, null/event guards, mailbox-listing diff, Outlook folder encoding, label search filters, account-state helpers (email sync).
51
- - Gmail Pub/Sub manager recovery, WIF external-account signer, OAuth token-request encoding + scope/nonce/error-status, tokens.js, encrypt.js, stream-encrypt, export.js internals + concurrency Lua, IMAP-proxy protocol hardening, redis-operations helpers, bounce/ARF structured (RFC 3464) parsing.
52
-
53
- Thin or absent:
54
- - Entire api-routes/ and ui-routes/ handler execution: exercised only via integration smoke (401-without-token + 200-with-`*`-token) and one e2e happy path. No scoped/cross-tenant token tests, no CSRF assertion, no POST mutation handlers, no parameterized routes.
55
- - Send/submit pipeline, auth auto-disable, reconnect/backoff, Gmail history sync, Outlook subscription lifecycle: only the flaky non-hermetic live integration suite.
56
- - SubScript sandbox, server.js account assignment/reassignment, SMTP/IMAP-proxy auth layers: zero tests.
57
- - Large files barely touched: outlook-client.js (4584), gmail-client.js (3079), base-client.js (3279), imap/mailbox.js (3255), workers/api.js (3185), schemas.js (2497), tools.js (2372, ~27% of exports + all binary/crypto/async untested), oauth2-apps.js handler class, autodetect-imap-settings.js (779, 0 tests), get-raw-email.js (552, 0).
58
-
59
- ---
60
-
61
- ## 3. Cross-cutting findings
62
-
63
- ### 3a. "Illusory coverage" - tests that re-implement source instead of importing it
64
- These pass green even when the shipping code breaks. Highest ROI to fix:
65
- - `worker-not-available-test.js` - copies the submit discard predicate; omits the `NON_RETRYABLE_CODES` (EAUTH/EOAUTH2/ETLS/...) branch entirely.
66
- - `autoreply-test.js` - re-defines `isAutoreply`; real `BaseClient.isAutoreply` (base-client.js:2173) untested.
67
- - `complaint-test.js` - re-implements `mightBeAComplaint`; real wrapper untested (underlying arf-detect IS tested).
68
- - `email-client-test.js` - defines its own PageCursor + constants; real Gmail `PageCursor` untested.
69
- - `retry-logic-test.js` - defines its own `calculateBackoffDelay`/`simulateRequestWithRetry`; real Outlook `requestWithRetry` (outlook-client.js:222) untested.
70
-
71
- ### 3b. Auth boundaries asserted only at "401 without any token"
72
- Scope enforcement, cross-account binding, CSRF, session invalidation, and the admin auth gate are never positively tested with real (scoped / cross-tenant / crumb-less) requests. The test prepared token decodes to `scopes:["*"]`, so every integration/e2e run is a full-root token.
73
-
74
- ### 3c. Latent bugs surfaced during the audit (not tests - fix separately)
75
- - arf-detect.js:112 - reads `report['source-ip']` but writes `report.arf['source-ip']` (source IP never populated).
76
- - worker-not-available-test.js silently omits a whole discard branch (see 3a).
77
- - `mightBeABounce`/`mightBeAComplaint`/`mightBeDSNResponse` are duplicated in both base-client.js (2832-2890) and imap/mailbox.js (3056-3204) - drift risk; consolidate.
78
-
79
- ---
80
-
81
- ## 4. Prioritized test backlog
82
-
83
- Priority = blast radius x regression likelihood x security sensitivity, weighted by cost-to-implement (cheap high-value first).
84
-
85
- ### P0 - Do first
86
-
87
- | # | Test | Why | Type |
88
- |---|------|-----|------|
89
- | 1 | Fix the 5 "illusory coverage" tests to import real exports (submit discard incl. NON_RETRYABLE_CODES, isAutoreply, mightBeAComplaint, Gmail PageCursor, Outlook requestWithRetry) | False green today; cheapest possible win; unblocks trust in the suite | unit |
90
- | 2 | SubScript sandbox (lib/sub-script.js) - timeout enforcement, no process/require/global escape, env/scriptEnv injection, payload isolation, compile-error caching | Arbitrary user JS runs in-process on every webhook; zero tests | unit |
91
- | 3 | tools.serialize / unserialize round-trip - UID+flags+modseq+msgpack, D/N sentinels, BigInt modseq | Corrupts sync state for ALL accounts (dup/dropped messages + webhooks); zero tests; pure/cheap | unit |
92
- | 4 | API token scope enforcement + cross-account binding (workers/api.js:1106,1121-1170) - smtp/imap-proxy-only token must 403 on /v1/*; account token must 403 on a different account; template special-casing | Core security boundaries, tested only at 401-without-token; provision tokens via lib/tokens.provision() in existing smoke harness | integration |
93
- | 5 | Admin UI auth gate + CSRF + passwordVersion - boot server WITH admin password: anonymous /admin/* -> 302 login; crumb-less POST -> 403; passwordVersion bump invalidates old cookie | Closes the 3 highest-blast-radius UI gaps at once; a regression making admin world-readable passes all current tests | integration |
94
-
95
- ### P1 - High
96
-
97
- | # | Test | Why | Type |
98
- |---|------|-----|------|
99
- | 6 | Send/submit pipeline + idempotency (base-client.js submitMessage/queueMessageEntry/handleSubmitError, checkIdempotencyKey) - permanent-5xx vs transient, Sent-folder upload, reference flags, gateway stats | Data loss / duplicate sends; only happy-path live coverage | unit + 1 integration error path |
100
- | 7 | server.js account assignment & reassignment (assignAccounts, rendezvous reassign trigger, call-failure rollback, worker-exit -> unassigned, 10s failsafe, health -> restart) | Highest orchestration blast radius (one routing bug hits all accounts); zero tests | unit (extract) / integration with fake workers |
101
- | 8 | setErrorState auth-failure auto-disable (base-client.js:383) - error-count, same-error dedupe, MAX_IMAP_AUTH_FAILURE_TIME threshold, disable+close | Safety mechanism vs reconnect storms; untested | unit (mock redis txn + clock) |
102
- | 9 | SMTP server + IMAP-proxy AUTH layers (workers/smtp.js:112-246, imapproxy/imap-server.js:153-247) - global password, scoped hex token, account==username, IP restriction, API-only rejection | Auth-bypass surface; protocol hardening is tested but auth is not | integration |
103
- | 10 | Bulk message mutate/delete REST (message-routes.js PUT /messages, /messages/move, /messages/delete?force) | Highest data-loss blast radius among untested endpoints; matches prior Outlook bulk-delete finding | integration |
104
- | 11 | bounce-detect text-heuristic fallback (~13 vendor matchers: Exim/Postfix/Google/KDDI/Verizon/James/generic 5xx, bounce-detect.js:417-832) | Largest real-world regression surface; regex-fragile (ReDoS-hardened, no regression test) | unit (fixtures) |
105
- | 12 | OAuth2AppsHandler stateful core (oauth2-apps.js create/update/del encryption, getServiceAccessToken caching/lock:1641, getClient per-provider:1422) + Gmail/Outlook checkForFlags error->flag mapping | Mis-stored/plaintext creds, token stampede, wrong auth flags; only leaf helpers tested today | unit |
106
- | 13 | Gmail history sync (processHistory/processHistoryEntry, gmail-client.js:2737-3001) + Outlook subscription lifecycle (renewSubscription/ensureSubscription/syncMissedMessages, outlook-client.js:3224-3971) | Core real-time correctness; only flaky live coverage; silent event loss | unit (mock request) |
107
- | 14 | IMAP reconnect/backoff + error->state classification (imap-client.js reconnect:910, start() catch:1557) | Timing-sensitive; high regression likelihood | unit (fake timers) |
108
-
109
- ### P2 - Medium
110
-
111
- | # | Test | Why | Type |
112
- |---|------|-----|------|
113
- | 15 | bull-board auth (/admin/bull-board/* relies only on default session guard) | Queue job payloads (recipients/message data) leak if guard regresses | integration |
114
- | 16 | chat / unified-search REST doc-store gating (/v1/chat 404 + /v1/unified/search runtime-404 when feature off) | doc-store-disabled test covers UI only | route-table + integration |
115
- | 17 | Secret masking on read (GET /v1/account, /v1/oauth2 -> ******) | Assert secrets never round-trip cleartext | integration |
116
- | 18 | Public account-setup HMAC verification (/accounts/new/imap/server, POST /v1/authentication/form) + signed-form replay/TTL/nonce | Unauth account creation + credential write if sig check regresses | integration + unit |
117
- | 19 | settings.js secret encrypt/decrypt + POST /v1/settings write broadcast | Silent corruption of stored OAuth secrets/serviceSecret; global blast radius | unit + integration |
118
- | 20 | Security redaction units: formatPartialSecretKey, add-trackers redirect rewriting (open-redirect via /redirect), get-raw-email X-EE-*/BCC stripping | Header/secret leakage on every outbound message | unit |
119
- | 21 | UIDVALIDITY-change full-resync branch (mailbox.js onOpen:2102-2127) | Distinct from lost-index reseed; wrong handling re-floods or drops messages | unit |
120
- | 22 | Export recovery + encryption end-to-end (markInterruptedAsFailed, gzip->encrypt->decryptable artifact, lease extension) | Classifiers tested in isolation; recovery flow not | integration |
121
- | 23 | Webhook custom-route fn/map filter/transform end-to-end + payload formatting/truncation + route-disable-on-compile-error + HMAC sig value | Handler cache tested; actual filter/transform behavior not | unit/integration |
122
- | 24 | autodetect-imap-settings.js (779 LOC, 0 tests) - provider table, autoconfig XML substitution, escapeXml autodiscover injection, SRV parsing | Every new-account config; high churn; injection surface | unit (stub dns/undici) |
123
- | 25 | smtp-pool-manager generatePoolKey (credential isolation) + cleanupIdlePools | Pool-key collision could cross-send via wrong account | unit |
124
- | 26 | Broad POST mutation + parameterized route execution (token provision/delete, account delete/edit, gateway/oauth/webhook/template CRUD, network config) with a prepared session | ~20 handlers only snapshot-checked, never run | integration / e2e |
125
- | 27 | gateway CRUD + delivery-stats hincrby + encrypted-pass roundtrip | Holds SMTP creds; only route-name smoke today | unit/integration |
126
-
127
- ### P3 - Lower / opportunistic
128
-
129
- - message-builder.js + notification-handler.js builders (synchronous, cheap; payload contract).
130
- - export-routes / outbox / blocklist / template / license HTTP behavior (404 + force semantics + download stream).
131
- - redis-url parsing, redis-scan-delete batching, reconnection-manager backoff cap, rate-limit bucket math, capa CSV parser, templates CRUD.
132
- - arf-detect edge branches (and fix the source-ip read/write bug, 3c).
133
- - OKTA login flow, disableTokens open-API mode, sess_ browse round-trip, requireTotp path-allowlist correctness.
134
- - mergeObjects prototype-pollution guard, comparePattern/matcher glob+LRU, checkLicense ECDSA verify.
135
- - Documents/ES enabled path (deprecated, off by default - lowest priority).
136
-
137
- ---
138
-
139
- ## 5. Suggested sequencing
140
-
141
- 1. Land P0 #1 (illusory-coverage fixes) immediately - cheapest, removes false confidence, and #1's submit/autoreply/complaint cases overlap with P1 #6/#11.
142
- 2. P0 #2/#3 (SubScript, serialize) - pure units, high blast radius, no infra needed.
143
- 3. P0 #4/#5 + P2 #15/#16/#17/#26 share one new integration harness: boot the test server with an admin password and provision scoped tokens via lib/tokens.provision(). Build that harness once, then the auth/scope/CSRF/masking/gating tests are incremental.
144
- 4. P1 #6-#14 are the email-engine correctness core; most are unit-testable with mocked redis/transport/request and benefit from extracting pure logic out of the giant client files as you go.
145
-
146
- ---
147
-
148
- ## 6. Implementation status (2026-06-16)
149
-
150
- Branch `test-coverage-p0-p1`. Each test file was verified to pass individually
151
- (the full local suite cannot run all files in parallel on a dev machine due to
152
- process-isolation + Redis connection accumulation; CI runs the unit tier in a
153
- clean dedicated job). Source changes are additive exports or behavior-preserving
154
- extractions, verified not to break existing consumers.
155
-
156
- Done (committed):
157
- - P0 #1 - illusory-coverage tests now exercise real code (submit discard via new
158
- lib/delivery-error.js incl. NON_RETRYABLE_CODES; isAutoreply; Mailbox
159
- mightBeAComplaint + base-client drift; Gmail PageCursor; Outlook
160
- requestWithRetry incl. transient-network branch).
161
- - P0 #2 - SubScript sandbox (timeout, context isolation, env, compile cache).
162
- - P0 #3 - tools.serialize/unserialize round-trip.
163
- - P0 #4 - API token scope enforcement + cross-account binding (integration).
164
- - P0 #5 - admin CSRF crumb enforcement (integration). [partial]
165
- - P1 #8 - setErrorState auth-failure tracking + IMAP auto-disable.
166
- - P1 #11 - bounce-detect text-heuristic fallback.
167
- - P1 #12 - Gmail/Outlook checkForFlags/checkForUserFlags error mapping. [partial]
168
- - P1 #14 - ReconnectionManager backoff/jitter/reset. [partial]
169
- - P1 #6 - idempotency-key handling (duplicate-submission guard). [partial]
170
-
171
- Remaining (deferred, with reason):
172
- - P0 #5 remainder - anonymous /admin/* -> 302 redirect and passwordVersion
173
- session invalidation need an isolated server WITH an admin password; belongs
174
- in the Playwright e2e suite (cannot verify locally without Chromium + the
175
- external trial endpoint). The shared integration server is password-less by
176
- design, so these must not mutate its global auth state.
177
- - P1 #6 remainder - full submitMessage pipeline (permanent-vs-transient retry,
178
- Sent-folder upload, reference flags, gateway stats): large surface in a
179
- 3.3k-line client, heavy transport/Redis mocking.
180
- - P1 #7 - server.js account assignment/reassignment: highest blast radius but
181
- the orchestration is entangled with module state; needs logic extraction (a
182
- refactor of a critical orchestrator) or a fake-worker harness.
183
- - P1 #9 - SMTP server + IMAP-proxy auth: those servers are not enabled in the
184
- shared test config; needs a dedicated server boot with them enabled.
185
- - P1 #10 - bulk message mutate/delete REST: needs a connected mailbox with
186
- messages; not meaningfully testable against the credential-less test server.
187
- - P1 #12 remainder - OAuth2AppsHandler CRUD encryption / getServiceAccessToken
188
- caching / getClient: stateful, needs Redis + secret + provider mocking.
189
- - P1 #13 - Gmail history sync + Outlook subscription lifecycle: heavy mocking of
190
- the 3k-4.5k-line client classes.
191
- - P1 #14 remainder - imap-client reconnect() method + start() error->state
192
- classification: needs an IMAPClient instance with a mocked ImapFlow + fake
193
- timers.
194
-
195
- Guiding constraint: no unverified or fragile tests were committed. The deferred
196
- items each require infrastructure (extra server, live mailbox, orchestrator
197
- refactor, or large-class mocking) beyond what a test can assert reliably in this
198
- environment.
199
-
200
- ## 7. Deferred-item follow-up (2026-06-16, same branch)
201
-
202
- A second pass converted most of the deferred items into verified tests by
203
- extracting testable units (leaf workers only - never server.js) and using the
204
- real handlers against the test Redis:
205
-
206
- Done (committed):
207
- - P1 #12 remainder - OAuth2AppsHandler create/get/update/list/del with
208
- credential encryption at rest (oauth2-apps-crud-test.js).
209
- - P1 #9 - SMTP auth (extracted lib/smtp-auth.js) and IMAP-proxy auth (extracted
210
- lib/imap-proxy-auth.js): rejection paths (password/token account/scope/IP) and
211
- accept paths, plus the IMAP-proxy API-only-account ACCOUNTDISABLED rejection.
212
- - P1 #14 remainder - IMAPClient.reconnect() guard logic (no double-connect /
213
- reconnect-storm), via the prototype with start() stubbed.
214
- - P1 #13 (partial) - Gmail flag/label mapping (flagToLabel/flagsToLabelIds incl.
215
- inverse \Seen<->UNREAD and set precedence) and Outlook parseExpirationDate.
216
- - P1 #6 (decision logic) - message-builder send-pipeline deciders
217
- (SentMailCopyDecider, ProviderMessageIdHandler, SmtpErrorBuilder,
218
- NetworkRoutingBuilder, NotificationBuilder).
219
-
220
- Still remaining (genuinely blocked):
221
- - P1 #7 - server.js account assignment: the assignAccounts loop is entangled
222
- with module state and per-iteration rollback; a faithful extraction risks
223
- changing assignment behavior on worker-crash recovery (highest blast radius).
224
- Not done autonomously - needs a reviewed refactor. The consistency-critical
225
- half (rendezvous reassignment) is already covered by tools-test.js.
226
- - P1 #6 remainder - the full submitMessage orchestration (actual SMTP send +
227
- retry loop) - decision logic is now covered; the glue needs integration/e2e.
228
- - P1 #13 remainder - Gmail processHistoryEntry / Outlook renew-subscription
229
- orchestration: multi-step async over 3k-4.5k-line client classes.
230
- - P0 #5 remainder / P1 #10 - e2e auth-gate + passwordVersion and bulk-message
231
- REST: need the Playwright e2e instance (isolated server with a password and a
232
- live mailbox) which depends on Chromium + external endpoints not reliably
233
- reachable here.