emailengine-app 2.81.2 → 2.82.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 (204) hide show
  1. package/.ncurc.js +12 -11
  2. package/.release-please-manifest.json +1 -1
  3. package/CHANGELOG.md +27 -0
  4. package/Dockerfile +2 -0
  5. package/bin/emailengine.js +28 -18
  6. package/config/default.toml +0 -5
  7. package/config/test.toml +0 -5
  8. package/data/google-crawlers.json +1 -1
  9. package/encrypt.js +70 -42
  10. package/getswagger.sh +0 -4
  11. package/lib/account/account-state.js +2 -110
  12. package/lib/account/expected-identity.js +1 -1
  13. package/lib/account-assignment.js +138 -1
  14. package/lib/account.js +254 -859
  15. package/lib/api-reference/index.js +2 -3
  16. package/lib/api-reference/schema-tree.js +53 -3
  17. package/lib/api-routes/account-routes.js +18 -29
  18. package/lib/api-routes/blocklist-routes.js +2 -2
  19. package/lib/api-routes/bull-board-routes.js +1 -6
  20. package/lib/api-routes/export-routes.js +2 -22
  21. package/lib/api-routes/gateway-routes.js +5 -14
  22. package/lib/api-routes/index.js +1 -13
  23. package/lib/api-routes/mailbox-routes.js +2 -7
  24. package/lib/api-routes/mcp-oauth-routes.js +2 -1
  25. package/lib/api-routes/mcp-routes.js +7 -7
  26. package/lib/api-routes/message-routes.js +40 -235
  27. package/lib/api-routes/mint-bounds.js +110 -0
  28. package/lib/api-routes/oauth2-app-routes.js +23 -32
  29. package/lib/api-routes/operation-impact.js +1 -1
  30. package/lib/api-routes/outbox-routes.js +2 -2
  31. package/lib/api-routes/permission-map.js +1 -7
  32. package/lib/api-routes/route-helpers.js +11 -5
  33. package/lib/api-routes/settings-routes.js +19 -19
  34. package/lib/api-routes/stats-routes.js +1 -1
  35. package/lib/api-routes/submit-routes.js +17 -18
  36. package/lib/api-routes/template-routes.js +4 -9
  37. package/lib/api-routes/token-routes.js +27 -5
  38. package/lib/api-token-scheme.js +71 -0
  39. package/lib/arf-detect.js +33 -6
  40. package/lib/auth-token.js +44 -24
  41. package/lib/autodetect-imap-settings.js +163 -123
  42. package/lib/bounce-detect.js +25 -16
  43. package/lib/calendar-event.js +78 -0
  44. package/lib/consts.js +42 -5
  45. package/lib/create-imap-client.js +24 -0
  46. package/lib/db.js +76 -11
  47. package/lib/delivery-error.js +2 -1
  48. package/lib/egress-fetch.js +54 -3
  49. package/lib/egress-filter.js +11 -0
  50. package/lib/email-client/api-retry.js +147 -0
  51. package/lib/email-client/base-client.js +377 -523
  52. package/lib/email-client/gmail/gmail-api.js +38 -125
  53. package/lib/email-client/gmail/send-request.js +1 -1
  54. package/lib/email-client/gmail-client.js +76 -50
  55. package/lib/email-client/imap/mailbox.js +158 -324
  56. package/lib/email-client/imap/stale-view.js +109 -0
  57. package/lib/email-client/imap/subconnection.js +46 -9
  58. package/lib/email-client/imap/sync-operations.js +5 -37
  59. package/lib/email-client/imap-client.js +188 -64
  60. package/lib/email-client/message-builder.js +9 -14
  61. package/lib/email-client/notification-handler.js +5 -219
  62. package/lib/email-client/outlook/graph-api.js +147 -126
  63. package/lib/email-client/outlook/send-request.js +10 -4
  64. package/lib/email-client/outlook-client.js +194 -397
  65. package/lib/email-client/smtp-pool-manager.js +3 -2
  66. package/lib/encrypt.js +184 -19
  67. package/lib/enum-descriptions.js +1 -2
  68. package/lib/export.js +133 -39
  69. package/lib/gateway.js +20 -6
  70. package/lib/get-raw-email.js +26 -44
  71. package/lib/handlebars-helpers.js +31 -10
  72. package/lib/imap-proxy-auth.js +13 -29
  73. package/lib/imapproxy/imap-core/README.md +1 -0
  74. package/lib/imapproxy/imap-core/lib/handler/imap-parser.js +12 -0
  75. package/lib/imapproxy/imap-core/lib/imap-command.js +74 -10
  76. package/lib/imapproxy/imap-core/lib/imap-connection.js +9 -1
  77. package/lib/imapproxy/imap-core/lib/imap-server.js +112 -26
  78. package/lib/imapproxy/imap-core/lib/imap-stream.js +41 -1
  79. package/lib/imapproxy/imap-core/lib/imap-tools.js +10 -2
  80. package/lib/imapproxy/imap-core/lib/indexer/indexer.js +4 -2
  81. package/lib/imapproxy/imap-server.js +17 -177
  82. package/lib/imapproxy/proxy-handoff.js +235 -0
  83. package/lib/imapproxy/response-error.js +33 -0
  84. package/lib/imapproxy/upstream-client.js +2 -2
  85. package/lib/license-beacon.js +3 -9
  86. package/lib/llm-pre-process.js +182 -43
  87. package/lib/logger.js +1 -1
  88. package/lib/lua/ee-export-queue-add.lua +39 -0
  89. package/lib/lua/ee-get-idempotency.lua +15 -3
  90. package/lib/lua/ee-release-attempts.lua +23 -0
  91. package/lib/lua/ee-reserve-attempts.lua +42 -0
  92. package/lib/lua/h-set-bigger.lua +12 -2
  93. package/lib/lua/s-list-accounts.lua +6 -3
  94. package/lib/mcp/index.js +1 -2
  95. package/lib/mcp/listen.js +221 -18
  96. package/lib/mcp/oauth.js +44 -5
  97. package/lib/mcp/resources.js +8 -2
  98. package/lib/mcp/tools.js +13 -0
  99. package/lib/message-port-stream.js +64 -6
  100. package/lib/oauth/external-account-signer.js +16 -13
  101. package/lib/oauth/gmail.js +22 -20
  102. package/lib/oauth/outlook.js +19 -16
  103. package/lib/oauth/pubsub/google.js +38 -2
  104. package/lib/oauth/scope-checker.js +4 -7
  105. package/lib/oauth/verify-app.js +2 -2
  106. package/lib/oauth2-apps.js +139 -44
  107. package/lib/openapi/build-document.js +1 -1
  108. package/lib/openapi/joi-schema.js +78 -9
  109. package/lib/parse-message.js +21 -0
  110. package/lib/payload-examples-webhooks.json +4 -7
  111. package/lib/pbkdf2-phc.js +101 -0
  112. package/lib/privileged-settings.js +0 -14
  113. package/lib/rate-limit.js +54 -15
  114. package/lib/redis-scan-delete.js +56 -29
  115. package/lib/redis-url.js +3 -1
  116. package/lib/respawn-backoff.js +5 -4
  117. package/lib/response-stream.js +25 -4
  118. package/lib/rewrite-text-nodes.js +27 -40
  119. package/lib/routes-ui.js +0 -5
  120. package/lib/schemas.js +122 -242
  121. package/lib/sentry.js +21 -5
  122. package/lib/settings.js +58 -59
  123. package/lib/smtp-auth.js +6 -2
  124. package/lib/smtp-message-processor.js +28 -7
  125. package/lib/sso.js +7 -3
  126. package/lib/stream-encrypt.js +14 -13
  127. package/lib/swagger-options.js +3 -1
  128. package/lib/tls/provision.js +69 -3
  129. package/lib/tls/store.js +14 -1
  130. package/lib/tools.js +113 -52
  131. package/lib/totp.js +16 -1
  132. package/lib/ui-routes/account-routes.js +27 -63
  133. package/lib/ui-routes/admin-config-routes.js +111 -134
  134. package/lib/ui-routes/admin-entities-routes.js +101 -191
  135. package/lib/ui-routes/ai-options.js +104 -0
  136. package/lib/ui-routes/auth-routes.js +98 -18
  137. package/lib/ui-routes/export-routes.js +3 -23
  138. package/lib/ui-routes/internals-routes.js +12 -9
  139. package/lib/ui-routes/network-config-routes.js +8 -18
  140. package/lib/ui-routes/oauth-config-routes.js +80 -214
  141. package/lib/ui-routes/route-helpers.js +40 -44
  142. package/lib/ui-routes/unsubscribe-routes.js +2 -2
  143. package/lib/utils/decode-headers.js +32 -5
  144. package/lib/utils/header-map.js +62 -1
  145. package/lib/utils/network.js +2 -0
  146. package/lib/web-safe-html.js +77 -4
  147. package/lib/webhook-request.js +9 -1
  148. package/lib/webhook-routing.js +27 -1
  149. package/lib/webhooks.js +120 -43
  150. package/lib/worker-rpc-error.js +43 -2
  151. package/list-generate.js +13 -2
  152. package/package.json +33 -41
  153. package/sbom.json +1 -1
  154. package/scripts/refresh-test-tokens.js +42 -14
  155. package/server.js +317 -289
  156. package/static/css/flyonui.css +1 -1
  157. package/static/css/src/app.tailwind.css +7 -8
  158. package/static/js/ee-client.js +145 -70
  159. package/static/js/ui.js +350 -154
  160. package/static/licenses.html +434 -1835
  161. package/translations/messages.pot +97 -97
  162. package/views/accounts/browse.hbs +10 -4
  163. package/views/config/ai.hbs +49 -41
  164. package/views/config/oauth/app.hbs +2 -1
  165. package/views/dashboard.hbs +18 -16
  166. package/views/layout/app.hbs +0 -22
  167. package/views/layout/login.hbs +2 -1
  168. package/views/partials/filter_editor_js.hbs +4 -3
  169. package/views/partials/side_menu.hbs +0 -4
  170. package/views/partials/ui/account-picker.hbs +6 -32
  171. package/views/partials/ui/model-picker.hbs +31 -0
  172. package/views/partials/ui/pagination.hbs +6 -1
  173. package/views/partials/ui/picker.hbs +47 -0
  174. package/views/unsubscribe.hbs +1 -1
  175. package/workers/api.js +20 -20
  176. package/workers/export.js +55 -60
  177. package/workers/imap.js +126 -46
  178. package/workers/submit.js +3 -1
  179. package/workers/webhooks.js +46 -27
  180. package/.githooks/pre-commit +0 -80
  181. package/.github/CODE_OF_CONDUCT.md +0 -76
  182. package/.github/contributing.md +0 -17
  183. package/.github/dependabot.yml +0 -22
  184. package/.github/docker-smoke-test.sh +0 -61
  185. package/.github/workflows/deploy.yml +0 -215
  186. package/.github/workflows/e2e.yml +0 -55
  187. package/.github/workflows/release.yaml +0 -217
  188. package/.github/workflows/test.yml +0 -307
  189. package/lib/api-routes/chat-routes.js +0 -535
  190. package/lib/document-store.js +0 -75
  191. package/lib/es.js +0 -757
  192. package/lib/generate-text-preview.js +0 -61
  193. package/lib/imapproxy/imap-core/memory-notifier.js +0 -129
  194. package/lib/pre-process.js +0 -196
  195. package/lib/threads.js +0 -155
  196. package/lib/ui-routes/document-store-routes.js +0 -806
  197. package/playwright.config.js +0 -47
  198. package/views/config/document-store/chat.hbs +0 -286
  199. package/views/config/document-store/index.hbs +0 -146
  200. package/views/config/document-store/mappings/index.hbs +0 -108
  201. package/views/config/document-store/mappings/new.hbs +0 -68
  202. package/views/config/document-store/pre-processing/index.hbs +0 -103
  203. package/views/partials/document_store_header.hbs +0 -30
  204. package/workers/documents.js +0 -1128
@@ -1,7 +1,7 @@
1
1
  msgid ""
2
2
  msgstr ""
3
3
  "Content-Type: text/plain; charset=ascii\n"
4
- "POT-Creation-Date: 2026-09-27 19:09+0000\n"
4
+ "POT-Creation-Date: 2026-10-01 10:42+0000\n"
5
5
 
6
6
  #: views/error.hbs:6
7
7
  #: workers/api.js:3140
@@ -21,7 +21,7 @@ msgid "Dashboard"
21
21
  msgstr ""
22
22
 
23
23
  #: views/config/license.hbs:20
24
- #: lib/ui-routes/oauth-config-routes.js:217
24
+ #: lib/ui-routes/oauth-config-routes.js:282
25
25
  msgid "%d day"
26
26
  msgid_plural "%d days"
27
27
  msgstr[0] ""
@@ -33,10 +33,6 @@ msgid_plural "%d certificates"
33
33
  msgstr[0] ""
34
34
  msgstr[1] ""
35
35
 
36
- #: views/redirect.hbs:1
37
- msgid "Click <a href=\"%s\">here</a> to continue&mldr;"
38
- msgstr ""
39
-
40
36
  #: views/oauth-scope-error.hbs:5
41
37
  msgid "Insufficient Permissions"
42
38
  msgstr ""
@@ -62,6 +58,10 @@ msgstr ""
62
58
  msgid "Try Again"
63
59
  msgstr ""
64
60
 
61
+ #: views/redirect.hbs:1
62
+ msgid "Click <a href=\"%s\">here</a> to continue&mldr;"
63
+ msgstr ""
64
+
65
65
  #: views/unsubscribe.hbs:7
66
66
  #: views/unsubscribe.hbs:60
67
67
  #: views/unsubscribe.hbs:76
@@ -145,36 +145,12 @@ msgstr ""
145
145
  msgid "Continue"
146
146
  msgstr ""
147
147
 
148
- #: views/accounts/register/validating.hbs:35
149
- msgid "Checking your mail server"
150
- msgstr ""
151
-
152
- #: views/accounts/register/validating.hbs:40
153
- msgid "Still checking. This can take up to a minute."
154
- msgstr ""
155
-
156
- #: views/accounts/register/validating.hbs:47
157
- msgid "Enter server settings manually"
158
- msgstr ""
159
-
160
- #: views/accounts/register/validating.hbs:53
161
- msgid "We couldn't sign in to your mail server"
162
- msgstr ""
163
-
164
- #: views/accounts/register/validating.hbs:54
165
- msgid "Check the settings on the next page and try again."
166
- msgstr ""
167
-
168
- #: views/accounts/register/validating.hbs:61
169
- msgid "Continue to server settings"
170
- msgstr ""
171
-
172
- #: views/accounts/register/validating.hbs:69
173
- msgid "Almost there"
148
+ #: views/accounts/register/index.hbs:6
149
+ msgid "Choose your email account provider"
174
150
  msgstr ""
175
151
 
176
- #: views/accounts/register/validating.hbs:70
177
- msgid "Continue to review your mail server settings."
152
+ #: views/accounts/register/index.hbs:19
153
+ msgid "Standard IMAP"
178
154
  msgstr ""
179
155
 
180
156
  #: views/accounts/register/imap-server.hbs:23
@@ -281,12 +257,36 @@ msgstr ""
281
257
  msgid "We couldn't connect with these settings. Check the errors below."
282
258
  msgstr ""
283
259
 
284
- #: views/accounts/register/index.hbs:6
285
- msgid "Choose your email account provider"
260
+ #: views/accounts/register/validating.hbs:35
261
+ msgid "Checking your mail server"
286
262
  msgstr ""
287
263
 
288
- #: views/accounts/register/index.hbs:19
289
- msgid "Standard IMAP"
264
+ #: views/accounts/register/validating.hbs:40
265
+ msgid "Still checking. This can take up to a minute."
266
+ msgstr ""
267
+
268
+ #: views/accounts/register/validating.hbs:47
269
+ msgid "Enter server settings manually"
270
+ msgstr ""
271
+
272
+ #: views/accounts/register/validating.hbs:53
273
+ msgid "We couldn't sign in to your mail server"
274
+ msgstr ""
275
+
276
+ #: views/accounts/register/validating.hbs:54
277
+ msgid "Check the settings on the next page and try again."
278
+ msgstr ""
279
+
280
+ #: views/accounts/register/validating.hbs:61
281
+ msgid "Continue to server settings"
282
+ msgstr ""
283
+
284
+ #: views/accounts/register/validating.hbs:69
285
+ msgid "Almost there"
286
+ msgstr ""
287
+
288
+ #: views/accounts/register/validating.hbs:70
289
+ msgid "Continue to review your mail server settings."
290
290
  msgstr ""
291
291
 
292
292
  #: views/partials/public_test_labels.hbs:9
@@ -337,7 +337,7 @@ msgid ""
337
337
  "contact the service that sent you this link."
338
338
  msgstr ""
339
339
 
340
- #: lib/autodetect-imap-settings.js:151
340
+ #: lib/autodetect-imap-settings.js:155
341
341
  msgid ""
342
342
  "Microsoft has disabled password-based sign-ins (including app passwords) "
343
343
  "for Outlook.com, Hotmail.com, and Microsoft 365 email accounts. To "
@@ -345,34 +345,34 @@ msgid ""
345
345
  "connect your account."
346
346
  msgstr ""
347
347
 
348
- #: lib/tools.js:1526
348
+ #: lib/tools.js:1609
349
349
  #: lib/ui-routes/unsubscribe-routes.js:31
350
350
  #: lib/ui-routes/unsubscribe-routes.js:99
351
351
  msgid "Invalid input"
352
352
  msgstr ""
353
353
 
354
- #: lib/tools.js:2392
354
+ #: lib/tools.js:2490
355
355
  msgid "Signature validation failed"
356
356
  msgstr ""
357
357
 
358
- #: lib/tools.js:2415
359
- #: lib/tools.js:2421
360
- #: lib/tools.js:2426
361
- #: lib/ui-routes/account-routes.js:1337
358
+ #: lib/tools.js:2513
359
+ #: lib/tools.js:2519
360
+ #: lib/tools.js:2524
361
+ #: lib/ui-routes/account-routes.js:1322
362
362
  msgid "Invalid or expired account setup URL"
363
363
  msgstr ""
364
364
 
365
365
  #: lib/ui-routes/account-routes.js:481
366
366
  #: lib/ui-routes/account-routes.js:525
367
- #: lib/ui-routes/account-routes.js:859
368
- #: lib/ui-routes/account-routes.js:936
369
- #: lib/ui-routes/account-routes.js:949
370
- #: lib/ui-routes/account-routes.js:996
371
- #: lib/ui-routes/account-routes.js:1212
372
- #: lib/ui-routes/account-routes.js:1404
373
- #: lib/ui-routes/route-helpers.js:403
374
- #: workers/api.js:2312
375
- #: workers/api.js:2382
367
+ #: lib/ui-routes/account-routes.js:845
368
+ #: lib/ui-routes/account-routes.js:922
369
+ #: lib/ui-routes/account-routes.js:935
370
+ #: lib/ui-routes/account-routes.js:982
371
+ #: lib/ui-routes/account-routes.js:1198
372
+ #: lib/ui-routes/account-routes.js:1389
373
+ #: lib/ui-routes/route-helpers.js:367
374
+ #: workers/api.js:2311
375
+ #: workers/api.js:2381
376
376
  msgid "Email Account Setup"
377
377
  msgstr ""
378
378
 
@@ -382,106 +382,106 @@ msgstr ""
382
382
  msgid "Invalid request. Check your input and try again."
383
383
  msgstr ""
384
384
 
385
- #: lib/ui-routes/account-routes.js:740
385
+ #: lib/ui-routes/account-routes.js:726
386
386
  msgid "Too many attempts for this setup link. Request a new setup link to continue."
387
387
  msgstr ""
388
388
 
389
- #: lib/ui-routes/account-routes.js:983
390
- #: lib/ui-routes/account-routes.js:1387
389
+ #: lib/ui-routes/account-routes.js:969
390
+ #: lib/ui-routes/account-routes.js:1372
391
391
  msgid "Couldn't set up account. Try again."
392
392
  msgstr ""
393
393
 
394
- #: lib/ui-routes/account-routes.js:1071
395
- #: lib/ui-routes/account-routes.js:1111
396
- #: lib/ui-routes/admin-entities-routes.js:2078
394
+ #: lib/ui-routes/account-routes.js:1057
395
+ #: lib/ui-routes/account-routes.js:1097
396
+ #: lib/ui-routes/admin-entities-routes.js:1941
397
397
  msgid "Server hostname was not found"
398
398
  msgstr ""
399
399
 
400
- #: lib/ui-routes/account-routes.js:1074
401
- #: lib/ui-routes/account-routes.js:1114
402
- #: lib/ui-routes/admin-entities-routes.js:2081
400
+ #: lib/ui-routes/account-routes.js:1060
401
+ #: lib/ui-routes/account-routes.js:1100
402
+ #: lib/ui-routes/admin-entities-routes.js:1944
403
403
  msgid "Invalid username or password"
404
404
  msgstr ""
405
405
 
406
- #: lib/ui-routes/account-routes.js:1079
407
- #: lib/ui-routes/account-routes.js:1131
408
- #: lib/ui-routes/admin-entities-routes.js:2098
406
+ #: lib/ui-routes/account-routes.js:1065
407
+ #: lib/ui-routes/account-routes.js:1117
408
+ #: lib/ui-routes/admin-entities-routes.js:1961
409
409
  msgid "Connection timed out"
410
410
  msgstr ""
411
411
 
412
- #: lib/ui-routes/account-routes.js:1085
413
- #: lib/ui-routes/account-routes.js:1134
414
- #: lib/ui-routes/admin-entities-routes.js:2101
412
+ #: lib/ui-routes/account-routes.js:1071
413
+ #: lib/ui-routes/account-routes.js:1120
414
+ #: lib/ui-routes/admin-entities-routes.js:1964
415
415
  msgid "Could not connect to server"
416
416
  msgstr ""
417
417
 
418
- #: lib/ui-routes/account-routes.js:1098
419
- #: lib/ui-routes/account-routes.js:1102
420
- #: lib/ui-routes/account-routes.js:1123
421
- #: lib/ui-routes/account-routes.js:1127
422
- #: lib/ui-routes/admin-entities-routes.js:2090
423
- #: lib/ui-routes/admin-entities-routes.js:2094
418
+ #: lib/ui-routes/account-routes.js:1084
419
+ #: lib/ui-routes/account-routes.js:1088
420
+ #: lib/ui-routes/account-routes.js:1109
421
+ #: lib/ui-routes/account-routes.js:1113
422
+ #: lib/ui-routes/admin-entities-routes.js:1953
423
+ #: lib/ui-routes/admin-entities-routes.js:1957
424
424
  msgid "TLS protocol error"
425
425
  msgstr ""
426
426
 
427
- #: lib/ui-routes/account-routes.js:1117
428
- #: lib/ui-routes/admin-entities-routes.js:2084
427
+ #: lib/ui-routes/account-routes.js:1103
428
+ #: lib/ui-routes/admin-entities-routes.js:1947
429
429
  msgid "Authentication credentials were not provided"
430
430
  msgstr ""
431
431
 
432
- #: lib/ui-routes/account-routes.js:1120
433
- #: lib/ui-routes/admin-entities-routes.js:2087
432
+ #: lib/ui-routes/account-routes.js:1106
433
+ #: lib/ui-routes/admin-entities-routes.js:1950
434
434
  msgid "OAuth2 authentication failed"
435
435
  msgstr ""
436
436
 
437
- #: lib/ui-routes/account-routes.js:1137
438
- #: lib/ui-routes/admin-entities-routes.js:2104
437
+ #: lib/ui-routes/account-routes.js:1123
438
+ #: lib/ui-routes/admin-entities-routes.js:1967
439
439
  msgid "Unexpected server response"
440
440
  msgstr ""
441
441
 
442
- #: lib/ui-routes/account-routes.js:1325
442
+ #: lib/ui-routes/account-routes.js:1310
443
443
  msgid "Temporary error, please try again"
444
444
  msgstr ""
445
445
 
446
- #: lib/ui-routes/admin-config-routes.js:193
446
+ #: lib/ui-routes/admin-config-routes.js:195
447
447
  msgid "Invalid API key for OpenAI"
448
448
  msgstr ""
449
449
 
450
- #: lib/ui-routes/oauth-config-routes.js:210
450
+ #: lib/ui-routes/oauth-config-routes.js:275
451
451
  msgid "Unknown"
452
452
  msgstr ""
453
453
 
454
- #: lib/ui-routes/oauth-config-routes.js:219
454
+ #: lib/ui-routes/oauth-config-routes.js:284
455
455
  msgid "Indefinite"
456
456
  msgstr ""
457
457
 
458
- #: lib/ui-routes/route-helpers.js:105
458
+ #: lib/ui-routes/route-helpers.js:68
459
459
  msgid "The server unexpectedly closed the connection."
460
460
  msgstr ""
461
461
 
462
- #: lib/ui-routes/route-helpers.js:107
462
+ #: lib/ui-routes/route-helpers.js:70
463
463
  msgid ""
464
464
  "The server unexpectedly closed the connection. This usually happens when "
465
465
  "attempting to connect to a TLS port without TLS enabled."
466
466
  msgstr ""
467
467
 
468
- #: lib/ui-routes/route-helpers.js:162
468
+ #: lib/ui-routes/route-helpers.js:125
469
469
  msgid ""
470
470
  "Connection timed out. This usually occurs if you are behind a firewall or "
471
471
  "connecting to the wrong port."
472
472
  msgstr ""
473
473
 
474
- #: lib/ui-routes/route-helpers.js:169
474
+ #: lib/ui-routes/route-helpers.js:132
475
475
  msgid ""
476
476
  "The server refused the connection. This typically occurs if the server is "
477
477
  "not running, is overloaded, or you are connecting to the wrong host or port."
478
478
  msgstr ""
479
479
 
480
- #: lib/ui-routes/route-helpers.js:223
480
+ #: lib/ui-routes/route-helpers.js:186
481
481
  msgid "Delegated"
482
482
  msgstr ""
483
483
 
484
- #: lib/ui-routes/route-helpers.js:224
484
+ #: lib/ui-routes/route-helpers.js:187
485
485
  msgid "Using credentials from \"%s\""
486
486
  msgstr ""
487
487
 
@@ -497,31 +497,31 @@ msgstr ""
497
497
  msgid "Couldn't process request. Try again."
498
498
  msgstr ""
499
499
 
500
- #: workers/api.js:2241
500
+ #: workers/api.js:2240
501
501
  msgid ""
502
502
  "The sign-in was cancelled or the requested access was not granted. Open the "
503
503
  "account setup link again to retry."
504
504
  msgstr ""
505
505
 
506
- #: workers/api.js:2250
506
+ #: workers/api.js:2249
507
507
  msgid "Sign-in with the email provider failed: %s"
508
508
  msgstr ""
509
509
 
510
- #: workers/api.js:2254
510
+ #: workers/api.js:2253
511
511
  msgid "Sign-in with the email provider failed: no authorization code was received"
512
512
  msgstr ""
513
513
 
514
- #: workers/api.js:2260
514
+ #: workers/api.js:2259
515
515
  msgid "Sign-in with the email provider failed: the request state is not valid"
516
516
  msgstr ""
517
517
 
518
- #: workers/api.js:2266
518
+ #: workers/api.js:2265
519
519
  msgid ""
520
520
  "The account setup session has expired or was already used. Open the account "
521
521
  "setup link again to retry."
522
522
  msgstr ""
523
523
 
524
- #: workers/api.js:2273
524
+ #: workers/api.js:2272
525
525
  msgid ""
526
526
  "Sign-in with the email provider failed: the stored setup session is not "
527
527
  "valid"
@@ -26,6 +26,11 @@
26
26
  </div>
27
27
  {{/ui/modal}}
28
28
 
29
+ {{!-- Handed over as form values rather than JS string literals: HTML escaping is not JS
30
+ escaping, and an account ID is free text (a quote, a backslash or an entity broke the page) --}}
31
+ <input type="hidden" id="browse-account" value="{{account}}">
32
+ <input type="hidden" id="browse-session-token" value="{{sessionToken}}">
33
+
29
34
  <script data-cfasync="false" type="module" nonce="{{cspNonce}}">
30
35
  import { EmailEngineClient } from '/static/js/ee-client.js';
31
36
 
@@ -34,10 +39,11 @@
34
39
  // theme switch (data-theme on the root element) and the system scheme.
35
40
  const client = new EmailEngineClient({
36
41
  apiUrl: window.location.origin,
37
- account: '{{account}}',
38
- accessToken: '{{sessionToken}}',
39
- // the widget appends its own stylesheet element; the admin policy accepts it with this nonce
40
- styleNonce: '{{cspNonce}}',
42
+ account: document.getElementById('browse-account').value,
43
+ accessToken: document.getElementById('browse-session-token').value,
44
+ // the widget appends its own stylesheet element; the admin policy accepts it with this
45
+ // nonce, read off a nonced script (the nonce property survives the attribute being hidden)
46
+ styleNonce: document.querySelector('script[nonce]').nonce,
41
47
  container: document.getElementById('email-client'),
42
48
  darkMode: uiEffectiveTheme() === 'dark',
43
49
  showDarkModeToggle: false,
@@ -1,7 +1,7 @@
1
1
  {{> ui/page-header title="AI Processing" icon="icon-[tabler--robot]" class="mb-1"}}
2
2
 
3
- <p class="mb-6">Analyze new Inbox emails with AI and include the results in <code>messageNew</code> webhooks.
4
- EmailEngine sends email content to the AI provider configured below.
3
+ <p class="mb-6">Analyze new Inbox emails with AI and include the model's answer as <code>summary</code> in
4
+ <code>messageNew</code> webhooks. EmailEngine sends email content to the AI provider configured below.
5
5
  </p>
6
6
 
7
7
  {{> ui/env-managed-alert}}
@@ -39,8 +39,8 @@
39
39
  before enabling processing.
40
40
  {{/ui/tooltip-rich}}
41
41
  {{/ui/checkbox}}
42
- <span class="helper-text">Process new emails with AI and include the results in
43
- <code>messageNew</code> webhooks.</span>
42
+ <span class="helper-text">Process new emails with AI and include the results as
43
+ <code>summary</code> in <code>messageNew</code> webhooks.</span>
44
44
  </div>
45
45
 
46
46
  <div class="text-end space-y-1">
@@ -68,23 +68,14 @@
68
68
  {{> ui/setting-ref name="openAiModel"}}
69
69
 
70
70
  <div class="flex items-center gap-2">
71
- <label class="label-text" for="settingsServiceOpenAiModel">AI Model</label>
71
+ <label class="label-text" for="openAiModel-search">AI Model</label>
72
72
 
73
73
  {{> ui/btn label="Refresh models" style="text" size="sm" id="reload-models-btn"
74
74
  icon="icon-[tabler--refresh] reload-icon"}}
75
75
  </div>
76
76
 
77
- <select id="settingsServiceOpenAiModel" class="select max-w-md{{#if errors.openAiModel}} is-invalid{{/if}}"
78
- name="openAiModel">
79
- {{#each openAiModels}}
80
- <option value="{{id}}" {{#if selected}}selected{{/if}}>{{name}}</option>
81
- {{/each}}
82
- </select>
83
- {{#if errors.openAiModel}}
84
- <span class="helper-text text-error">{{errors.openAiModel}}</span>
85
- {{/if}}
86
- <span class="helper-text">Choose the AI model for processing. Ensure your API key has access to the
87
- selected model.</span>
77
+ {{> ui/model-picker id="openAiModel" models=openAiModels value=values.openAiModel error=errors.openAiModel
78
+ hint="Type to search. Refresh models lists what your API key can use; the recommended entries suit reading mail, and Default follows the built-in model across upgrades."}}
88
79
  </div>
89
80
 
90
81
  <div>
@@ -215,7 +206,7 @@
215
206
  <input type="hidden" class="{{#if errors.openAiPromptElement}}is-invalid{{/if}}"
216
207
  id="openAiPromptElement" name="openAiPrompt" value="{{values.openAiPrompt}}">
217
208
 
218
- {{#> ui/code-editor id="editor-prompt" title="System prompt"}}
209
+ {{#> ui/code-editor id="editor-prompt" title="AI instructions"}}
219
210
  <div class="editor-embed-content editor-embed-content-right">
220
211
  <a href="#" id="prompt-try-btn">Test with email file</a>
221
212
  </div>
@@ -226,8 +217,10 @@
226
217
  <span class="helper-text text-error">{{errors.openAiPrompt}}</span>
227
218
  {{/if}}
228
219
 
229
- <span class="helper-text">Instructions for the AI. Must specify which JSON properties to return in the
230
- response.</span>
220
+ <span class="helper-text">Instructions for the AI, sent as the system message ahead of the email. They must
221
+ say which JSON properties to return; the webhook carries the model's answer as it came. The built-in
222
+ instructions ask for a summary, the sentiment, whether a reply is expected, a risk score, and the
223
+ events and actions the email mentions.</span>
231
224
  </div>
232
225
 
233
226
  <div>
@@ -236,7 +229,8 @@
236
229
  <input type="number" class="input text-list{{#if errors.openAiTemperature}} is-invalid{{/if}}"
237
230
  id="settingsOpenAiTemperature" step="0.001" min="0" max="2" name="openAiTemperature"
238
231
  value="{{values.openAiTemperature}}" />
239
- <span class="helper-text">Controls randomness (0-2). Lower = more focused, higher = more creative. <a
232
+ <span class="helper-text">Controls randomness (0-2). Lower = more focused, higher = more creative. Not
233
+ sent to a reasoning model while it reasons. <a
240
234
  href="https://platform.openai.com/docs/api-reference/chat/create#temperature" target="_blank"
241
235
  rel="noopener noreferrer" referrerpolicy="no-referrer" class="link link-animated">Learn
242
236
  more</a></span>
@@ -249,22 +243,43 @@
249
243
  <input type="number" class="input text-list{{#if errors.openAiTopP}} is-invalid{{/if}}"
250
244
  id="settingsOpenAiTopP" step="0.001" min="0" max="1" name="openAiTopP"
251
245
  value="{{values.openAiTopP}}" />
252
- <span class="helper-text">Alternative to temperature (0-1). Controls diversity of word choices. <a
246
+ <span class="helper-text">Alternative to temperature (0-1). Controls diversity of word choices. Not sent
247
+ to a reasoning model while it reasons. <a
253
248
  href="https://platform.openai.com/docs/api-reference/chat/create#top_p" target="_blank"
254
249
  rel="noopener noreferrer" referrerpolicy="no-referrer" class="link link-animated">Learn
255
250
  more</a></span>
256
251
  {{/ui/form-field}}
257
252
  </div>
258
253
 
254
+ <div>
255
+ {{> ui/setting-ref name="openAiReasoningEffort"}}
256
+
257
+ <label class="label-text" for="settingsOpenAiReasoningEffort">Reasoning effort</label>
258
+
259
+ <select id="settingsOpenAiReasoningEffort"
260
+ class="select max-w-md{{#if errors.openAiReasoningEffort}} is-invalid{{/if}}"
261
+ name="openAiReasoningEffort">
262
+ {{#each reasoningEffortOptions}}
263
+ <option value="{{value}}" {{#if selected}}selected{{/if}}>{{label}}</option>
264
+ {{/each}}
265
+ </select>
266
+ {{#if errors.openAiReasoningEffort}}
267
+ <span class="helper-text text-error">{{errors.openAiReasoningEffort}}</span>
268
+ {{/if}}
269
+ <span class="helper-text">How much a reasoning model, GPT-5 and later, thinks before answering. Default
270
+ sends "low" to such a model and nothing to any other. A value the model does not support is
271
+ dropped.</span>
272
+ </div>
273
+
259
274
  <div>
260
275
  {{> ui/setting-ref name="openAiMaxTokens"}}
261
276
  {{#> ui/form-field id="settingsOpenAiMaxTokens" label="Input token limit" error=errors.openAiMaxTokens}}
262
277
  <input type="number" class="input text-list{{#if errors.openAiMaxTokens}} is-invalid{{/if}}"
263
278
  id="settingsOpenAiMaxTokens" step="1" min="0" name="openAiMaxTokens"
264
279
  value="{{values.openAiMaxTokens}}" />
265
- <span class="helper-text">Maximum tokens in the input prompt, including your instructions, the system prompt, the JSON schema,
266
- and email data. EmailEngine shortens the email content to fit this limit. Leave blank for
267
- EmailEngine's model-based default.</span>
280
+ <span class="helper-text">Maximum tokens in the input prompt: the instructions and the email together.
281
+ EmailEngine shortens the email text to fit this limit. Leave blank for the default of
282
+ {{aiDefaults.maxTokens}}.</span>
268
283
  {{/ui/form-field}}
269
284
  </div>
270
285
 
@@ -367,11 +382,13 @@ defaultTestPayload='{"account":"test","path":"INBOX","subject":"test email"}'}}
367
382
  let payload = {
368
383
  emailFile,
369
384
  openAiPrompt: editorPrompt.getValue(),
370
- openAiModel: document.getElementById('settingsServiceOpenAiModel').value,
385
+ openAiModel: document.getElementById('openAiModel').value,
371
386
  openAiAPIUrl: document.getElementById('openAiAPIUrl').value,
372
387
  openAiAPIKey: document.getElementById('openAiAPIKey').value,
373
388
  openAiTemperature: document.getElementById('settingsOpenAiTemperature').value,
374
- openAiTopP: document.getElementById('settingsOpenAiTopP').value
389
+ openAiTopP: document.getElementById('settingsOpenAiTopP').value,
390
+ openAiReasoningEffort: document.getElementById('settingsOpenAiReasoningEffort').value,
391
+ openAiMaxTokens: document.getElementById('settingsOpenAiMaxTokens').value
375
392
  };
376
393
 
377
394
  let data;
@@ -405,21 +422,11 @@ defaultTestPayload='{"account":"test","path":"INBOX","subject":"test email"}'}}
405
422
  runFileTest();
406
423
  });
407
424
 
408
- function redrawModelList(models) {
409
- let selectElm = document.getElementById('settingsServiceOpenAiModel');
410
- let selected = selectElm.value;
411
-
412
- selectElm.innerHTML = '';
425
+ const modelInput = document.getElementById('openAiModel');
413
426
 
414
- for (let model of models) {
415
- let elm = document.createElement('option');
416
- elm.setAttribute('value', model.id);
417
- elm.textContent = model.name;
418
- if (model.id === selected) {
419
- elm.selected = true
420
- }
421
- selectElm.appendChild(elm);
422
- }
427
+ // the server answers with the list in the shape the page first got it
428
+ function redrawModelList(models) {
429
+ uiModelPickerSetModels(modelInput, models);
423
430
  }
424
431
 
425
432
  let reloadBtn = document.getElementById('reload-models-btn');
@@ -427,7 +434,8 @@ defaultTestPayload='{"account":"test","path":"INBOX","subject":"test email"}'}}
427
434
  const requestReload = async () => {
428
435
  const data = await uiPostJson('/admin/config/ai/reload-models', {
429
436
  openAiAPIUrl: document.getElementById('openAiAPIUrl').value,
430
- openAiAPIKey: document.getElementById('openAiAPIKey').value
437
+ openAiAPIKey: document.getElementById('openAiAPIKey').value,
438
+ openAiModel: modelInput.value
431
439
  });
432
440
 
433
441
  return data;
@@ -364,9 +364,10 @@ fieldName="app" fieldValue=app.id submitLabel="Delete app" submitIcon="icon-[tab
364
364
  </script>
365
365
  {{/if}}
366
366
 
367
+ <input type="hidden" id="verify-app-id" value="{{app.id}}">
367
368
  <script data-cfasync="false" nonce="{{cspNonce}}">
368
369
  document.addEventListener('DOMContentLoaded', () => {
369
- const appId = "{{app.id}}";
370
+ const appId = document.getElementById('verify-app-id').value;
370
371
  const stepsElm = document.getElementById('verify-steps');
371
372
  const pendingElm = document.getElementById('verify-pending');
372
373
  const errorElm = document.getElementById('verify-error');
@@ -54,16 +54,22 @@
54
54
  {{/ui/stat-card}}
55
55
  {{/each}}
56
56
 
57
- {{#if documentStoreUnavailable}}
58
- {{#> ui/stat-card variant="error" title="Document Store unavailable" icon="icon-[tabler--database]" class="mt-6"}}
59
- <p class="mb-0">The Document Store is enabled in the EmailEngine settings, but the feature is not
60
- available because EmailEngine was not started with the Document Store enabled. The deprecated
61
- Document Store only runs when started with the <code>--documentStore.enabled</code> command line
62
- flag or the <code>EENGINE_DOCUMENT_STORE_ENABLED=true</code> environment variable. Until then the
63
- document store worker is not running and all Document Store API and configuration endpoints
64
- return 404. Either restart EmailEngine with the flag, or disable the <code>documentStoreEnabled</code>
65
- setting to clear this warning.</p>
66
- {{/ui/stat-card}}
57
+ {{!-- Shown while the removed Document Store is still switched on in the stored settings.
58
+ The close button clears that setting through /admin/config/clear-error. --}}
59
+ {{#if documentStoreRemoved}}
60
+ {{#> ui/clear-alert alert="document-store" class="mt-6"}}
61
+ <h4 class="text-lg font-bold mb-2">The Document Store is no longer available</h4>
62
+ <p class="mb-2">This instance still has the <strong>Document Store</strong> enabled in its settings, but the
63
+ feature has been removed from EmailEngine. Emails are no longer indexed into Elasticsearch, and the
64
+ endpoints that depended on it (chat with emails, unified search, the <code>documentStore</code>
65
+ request options) are gone.</p>
66
+ <p class="mb-2">If you still need the Document Store, downgrade this instance to
67
+ <strong>v{{lastDocumentStoreVersion}}</strong>, the last release that includes it. Be aware that a
68
+ frozen version does <strong>not receive security updates</strong>, so continuing to run it is entirely
69
+ at your own risk.</p>
70
+ <p class="mb-0">Otherwise close this notice to clear the setting and drop the indexing jobs still queued in
71
+ Redis. The rest of the stored Document Store configuration is left untouched.</p>
72
+ {{/ui/clear-alert}}
67
73
  {{/if}}
68
74
 
69
75
  {{#unless hasAccounts}}
@@ -149,18 +155,14 @@
149
155
 
150
156
  {{> ui/section-title label="System" class="mt-8 mb-3"}}
151
157
 
152
- {{!-- auto-fit, so the tiles fill the row whether or not the Document Store adds a third
153
- queue - a fixed four-column track left a quarter-width hole at the end without it --}}
158
+ {{!-- auto-fit, so the tiles fill the row however many there are - a fixed four-column track
159
+ left a quarter-width hole at the end --}}
154
160
  <div class="grid grid-cols-2 gap-4 xl:grid-cols-[repeat(auto-fit,minmax(15rem,1fr))]">
155
161
 
156
162
  {{> queueCard queue=stats.queues.notify href="/admin/bull-board/queue/Webhooks%20Queue%20-%20notify" label="Webhooks queue" tooltip="This queue processes webhook notifications" delayedTooltip="Delayed queue entries"}}
157
163
 
158
164
  {{> queueCard queue=stats.queues.submit href="/admin/bull-board/queue/Submission%20Queue%20-%20submit" label="Submission queue" tooltip="This queue processes outgoing emails" delayedTooltip="Delayed queue entries, including emails scheduled to be sent later"}}
159
165
 
160
- {{#if showDocumentStore}}
161
- {{> queueCard queue=stats.queues.documents href="/admin/bull-board/queue/Document%20Queue%20-%20documents" label="Documents queue" tooltip="This queue indexes mailbox changes to Elasticsearch" delayedTooltip="Delayed queue entries"}}
162
- {{/if}}
163
-
164
166
  {{#> ui/stat-card variant=(eeColor redisPing.color) icon=redisPing.icon}}
165
167
  <div class="text-sm font-medium text-base-content/60 mb-1">
166
168
  {{#if redisPing.comment}}