emailengine-app 2.81.2 → 2.82.1

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 (226) hide show
  1. package/.ncurc.js +33 -10
  2. package/.release-please-manifest.json +1 -1
  3. package/CHANGELOG.md +71 -0
  4. package/DOCKER_DEPLOYMENT.md +13 -12
  5. package/Dockerfile +2 -0
  6. package/bin/emailengine.js +105 -25
  7. package/config/default.toml +0 -5
  8. package/config/test.toml +0 -5
  9. package/data/google-crawlers.json +1 -1
  10. package/encrypt.js +70 -42
  11. package/getswagger.sh +0 -4
  12. package/lib/account/account-state.js +2 -110
  13. package/lib/account/expected-identity.js +1 -1
  14. package/lib/account-assignment.js +138 -1
  15. package/lib/account.js +289 -869
  16. package/lib/api-reference/index.js +2 -3
  17. package/lib/api-reference/schema-tree.js +53 -3
  18. package/lib/api-routes/account-binding.js +58 -0
  19. package/lib/api-routes/account-routes.js +65 -37
  20. package/lib/api-routes/behavior-notes.js +4 -0
  21. package/lib/api-routes/blocklist-routes.js +2 -2
  22. package/lib/api-routes/bull-board-routes.js +1 -6
  23. package/lib/api-routes/export-routes.js +2 -22
  24. package/lib/api-routes/gateway-routes.js +15 -16
  25. package/lib/api-routes/index.js +1 -13
  26. package/lib/api-routes/mailbox-routes.js +2 -7
  27. package/lib/api-routes/mcp-oauth-routes.js +2 -1
  28. package/lib/api-routes/mcp-routes.js +7 -7
  29. package/lib/api-routes/message-routes.js +50 -238
  30. package/lib/api-routes/mint-bounds.js +110 -0
  31. package/lib/api-routes/oauth2-app-routes.js +23 -32
  32. package/lib/api-routes/operation-impact.js +1 -1
  33. package/lib/api-routes/outbox-routes.js +3 -3
  34. package/lib/api-routes/permission-map.js +1 -7
  35. package/lib/api-routes/route-helpers.js +11 -5
  36. package/lib/api-routes/settings-routes.js +20 -21
  37. package/lib/api-routes/stats-routes.js +1 -1
  38. package/lib/api-routes/submit-routes.js +17 -18
  39. package/lib/api-routes/template-routes.js +4 -9
  40. package/lib/api-routes/token-routes.js +28 -6
  41. package/lib/api-token-scheme.js +71 -0
  42. package/lib/arf-detect.js +33 -6
  43. package/lib/auth-token.js +44 -24
  44. package/lib/autodetect-imap-settings.js +305 -123
  45. package/lib/bounce-detect.js +25 -16
  46. package/lib/calendar-event.js +78 -0
  47. package/lib/consts.js +54 -5
  48. package/lib/create-imap-client.js +24 -0
  49. package/lib/db.js +77 -30
  50. package/lib/delivery-error.js +70 -2
  51. package/lib/egress-fetch.js +54 -3
  52. package/lib/egress-filter.js +11 -0
  53. package/lib/email-client/api-retry.js +147 -0
  54. package/lib/email-client/base-client.js +383 -536
  55. package/lib/email-client/credential-errors.js +21 -5
  56. package/lib/email-client/gmail/gmail-api.js +38 -125
  57. package/lib/email-client/gmail/send-request.js +1 -1
  58. package/lib/email-client/gmail-client.js +77 -51
  59. package/lib/email-client/imap/mailbox.js +158 -324
  60. package/lib/email-client/imap/stale-view.js +109 -0
  61. package/lib/email-client/imap/subconnection.js +46 -9
  62. package/lib/email-client/imap/sync-operations.js +5 -37
  63. package/lib/email-client/imap-client.js +190 -65
  64. package/lib/email-client/message-builder.js +50 -25
  65. package/lib/email-client/notification-handler.js +5 -219
  66. package/lib/email-client/outlook/graph-api.js +147 -126
  67. package/lib/email-client/outlook/send-request.js +10 -4
  68. package/lib/email-client/outlook-client.js +389 -463
  69. package/lib/email-client/smtp-pool-manager.js +3 -2
  70. package/lib/encrypt.js +184 -19
  71. package/lib/enum-descriptions.js +6 -3
  72. package/lib/export.js +141 -41
  73. package/lib/gateway.js +25 -6
  74. package/lib/get-raw-email.js +26 -44
  75. package/lib/get-secret.js +1 -21
  76. package/lib/handlebars-helpers.js +31 -10
  77. package/lib/imap-proxy-auth.js +13 -29
  78. package/lib/imapproxy/imap-core/README.md +1 -0
  79. package/lib/imapproxy/imap-core/lib/handler/imap-parser.js +12 -0
  80. package/lib/imapproxy/imap-core/lib/imap-command.js +74 -10
  81. package/lib/imapproxy/imap-core/lib/imap-connection.js +9 -1
  82. package/lib/imapproxy/imap-core/lib/imap-server.js +112 -26
  83. package/lib/imapproxy/imap-core/lib/imap-stream.js +41 -1
  84. package/lib/imapproxy/imap-core/lib/imap-tools.js +10 -2
  85. package/lib/imapproxy/imap-core/lib/indexer/indexer.js +4 -2
  86. package/lib/imapproxy/imap-server.js +17 -177
  87. package/lib/imapproxy/proxy-handoff.js +235 -0
  88. package/lib/imapproxy/response-error.js +33 -0
  89. package/lib/imapproxy/upstream-client.js +2 -2
  90. package/lib/license-beacon.js +3 -9
  91. package/lib/llm-pre-process.js +182 -43
  92. package/lib/logger.js +1 -1
  93. package/lib/lua/ee-export-queue-add.lua +39 -0
  94. package/lib/lua/ee-get-idempotency.lua +15 -3
  95. package/lib/lua/ee-release-attempts.lua +23 -0
  96. package/lib/lua/ee-reserve-attempts.lua +42 -0
  97. package/lib/lua/h-set-bigger.lua +12 -2
  98. package/lib/lua/s-list-accounts.lua +6 -3
  99. package/lib/mcp/index.js +1 -2
  100. package/lib/mcp/listen.js +221 -18
  101. package/lib/mcp/oauth.js +44 -5
  102. package/lib/mcp/resources.js +8 -2
  103. package/lib/mcp/tools.js +108 -36
  104. package/lib/message-port-stream.js +64 -6
  105. package/lib/oauth/external-account-signer.js +16 -13
  106. package/lib/oauth/gmail.js +64 -32
  107. package/lib/oauth/mail-ru.js +24 -17
  108. package/lib/oauth/outlook.js +53 -40
  109. package/lib/oauth/pubsub/google.js +38 -2
  110. package/lib/oauth/scope-checker.js +39 -8
  111. package/lib/oauth/scope-list.js +55 -0
  112. package/lib/oauth/token-fetch.js +47 -0
  113. package/lib/oauth/verify-app.js +2 -2
  114. package/lib/oauth2-apps.js +154 -90
  115. package/lib/openapi/build-document.js +1 -1
  116. package/lib/openapi/joi-schema.js +78 -9
  117. package/lib/outbox.js +2 -7
  118. package/lib/parse-message.js +21 -0
  119. package/lib/payload-examples-webhooks.json +4 -7
  120. package/lib/pbkdf2-phc.js +101 -0
  121. package/lib/privileged-settings.js +0 -14
  122. package/lib/queue-retention.js +4 -2
  123. package/lib/rate-limit.js +54 -15
  124. package/lib/read-env-value.js +33 -2
  125. package/lib/redis-scan-delete.js +56 -29
  126. package/lib/redis-url.js +3 -1
  127. package/lib/respawn-backoff.js +5 -4
  128. package/lib/response-stream.js +25 -4
  129. package/lib/rewrite-text-nodes.js +27 -40
  130. package/lib/routes-ui.js +0 -5
  131. package/lib/schemas.js +180 -253
  132. package/lib/sentry.js +21 -5
  133. package/lib/settings.js +58 -59
  134. package/lib/smtp-auth.js +6 -2
  135. package/lib/smtp-message-processor.js +28 -7
  136. package/lib/sso.js +7 -3
  137. package/lib/stream-encrypt.js +14 -13
  138. package/lib/swagger-options.js +3 -1
  139. package/lib/tls/provision.js +69 -3
  140. package/lib/tls/store.js +14 -1
  141. package/lib/token-audit-log.js +3 -2
  142. package/lib/tools.js +114 -53
  143. package/lib/totp.js +16 -1
  144. package/lib/ui-routes/account-routes.js +67 -70
  145. package/lib/ui-routes/admin-config-routes.js +111 -134
  146. package/lib/ui-routes/admin-entities-routes.js +101 -191
  147. package/lib/ui-routes/ai-options.js +104 -0
  148. package/lib/ui-routes/auth-routes.js +98 -18
  149. package/lib/ui-routes/export-routes.js +3 -23
  150. package/lib/ui-routes/internals-routes.js +12 -9
  151. package/lib/ui-routes/network-config-routes.js +8 -18
  152. package/lib/ui-routes/oauth-config-routes.js +83 -228
  153. package/lib/ui-routes/route-helpers.js +63 -67
  154. package/lib/ui-routes/special-use-paths.js +33 -0
  155. package/lib/ui-routes/unsubscribe-routes.js +2 -2
  156. package/lib/utils/decode-headers.js +32 -5
  157. package/lib/utils/header-map.js +62 -1
  158. package/lib/utils/network.js +11 -17
  159. package/lib/web-safe-html.js +77 -4
  160. package/lib/webhook-request.js +9 -1
  161. package/lib/webhook-routing.js +27 -1
  162. package/lib/webhooks.js +120 -43
  163. package/lib/worker-rpc-error.js +43 -2
  164. package/list-generate.js +13 -2
  165. package/package.json +38 -46
  166. package/sbom.json +1 -1
  167. package/scripts/refresh-test-tokens.js +42 -14
  168. package/server.js +338 -292
  169. package/setup-production.sh +16 -7
  170. package/static/css/flyonui.css +1 -1
  171. package/static/css/src/app.tailwind.css +7 -8
  172. package/static/js/ee-client.js +145 -70
  173. package/static/js/ui.js +350 -154
  174. package/static/licenses.html +349 -1740
  175. package/translations/messages.pot +129 -111
  176. package/views/account-workspace-error.hbs +30 -0
  177. package/views/accounts/account.hbs +9 -4
  178. package/views/accounts/browse.hbs +10 -4
  179. package/views/accounts/edit.hbs +11 -2
  180. package/views/config/ai.hbs +49 -41
  181. package/views/config/oauth/app.hbs +2 -1
  182. package/views/dashboard.hbs +18 -16
  183. package/views/internals/index.hbs +1 -1
  184. package/views/layout/app.hbs +0 -22
  185. package/views/layout/login.hbs +2 -1
  186. package/views/partials/filter_editor_js.hbs +4 -3
  187. package/views/partials/gmail_api_scopes.hbs +16 -0
  188. package/views/partials/oauth_form.hbs +67 -94
  189. package/views/partials/oauth_pubsub_app_select.hbs +43 -0
  190. package/views/partials/scope_info.hbs +14 -23
  191. package/views/partials/side_menu.hbs +0 -4
  192. package/views/partials/ui/account-picker.hbs +6 -32
  193. package/views/partials/ui/model-picker.hbs +31 -0
  194. package/views/partials/ui/pagination.hbs +6 -1
  195. package/views/partials/ui/picker.hbs +47 -0
  196. package/views/unsubscribe.hbs +1 -1
  197. package/workers/api.js +82 -47
  198. package/workers/export.js +55 -60
  199. package/workers/imap.js +132 -49
  200. package/workers/submit.js +5 -6
  201. package/workers/webhooks.js +46 -27
  202. package/.githooks/pre-commit +0 -80
  203. package/.github/CODE_OF_CONDUCT.md +0 -76
  204. package/.github/contributing.md +0 -17
  205. package/.github/dependabot.yml +0 -22
  206. package/.github/docker-smoke-test.sh +0 -61
  207. package/.github/workflows/deploy.yml +0 -215
  208. package/.github/workflows/e2e.yml +0 -55
  209. package/.github/workflows/release.yaml +0 -217
  210. package/.github/workflows/test.yml +0 -307
  211. package/lib/api-routes/chat-routes.js +0 -535
  212. package/lib/document-store.js +0 -75
  213. package/lib/es.js +0 -757
  214. package/lib/generate-text-preview.js +0 -61
  215. package/lib/imapproxy/imap-core/memory-notifier.js +0 -129
  216. package/lib/pre-process.js +0 -196
  217. package/lib/threads.js +0 -155
  218. package/lib/ui-routes/document-store-routes.js +0 -806
  219. package/playwright.config.js +0 -47
  220. package/views/config/document-store/chat.hbs +0 -286
  221. package/views/config/document-store/index.hbs +0 -146
  222. package/views/config/document-store/mappings/index.hbs +0 -108
  223. package/views/config/document-store/mappings/new.hbs +0 -68
  224. package/views/config/document-store/pre-processing/index.hbs +0 -103
  225. package/views/partials/document_store_header.hbs +0 -30
  226. package/workers/documents.js +0 -1128
@@ -1,10 +1,37 @@
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-05 12:02+0000\n"
5
+
6
+ #: views/account-workspace-error.hbs:7
7
+ msgid "Work Account Required"
8
+ msgstr ""
9
+
10
+ #: views/account-workspace-error.hbs:12
11
+ msgid ""
12
+ "This setup accepts only a Google Workspace account, and a personal Google "
13
+ "account was used."
14
+ msgstr ""
15
+
16
+ #: views/account-workspace-error.hbs:17
17
+ #: views/account-identity-error.hbs:21
18
+ msgid "Account used"
19
+ msgstr ""
20
+
21
+ #: views/account-workspace-error.hbs:23
22
+ msgid ""
23
+ "Try again and sign in with your work or school account. If you believe this "
24
+ "is a mistake, contact the service that sent you this link."
25
+ msgstr ""
26
+
27
+ #: views/account-workspace-error.hbs:28
28
+ #: views/oauth-scope-error.hbs:28
29
+ #: views/account-identity-error.hbs:32
30
+ msgid "Try Again"
31
+ msgstr ""
5
32
 
6
33
  #: views/error.hbs:6
7
- #: workers/api.js:3140
34
+ #: workers/api.js:3175
8
35
  msgid "Something went wrong"
9
36
  msgstr ""
10
37
 
@@ -21,7 +48,7 @@ msgid "Dashboard"
21
48
  msgstr ""
22
49
 
23
50
  #: views/config/license.hbs:20
24
- #: lib/ui-routes/oauth-config-routes.js:217
51
+ #: lib/ui-routes/oauth-config-routes.js:283
25
52
  msgid "%d day"
26
53
  msgid_plural "%d days"
27
54
  msgstr[0] ""
@@ -33,10 +60,6 @@ msgid_plural "%d certificates"
33
60
  msgstr[0] ""
34
61
  msgstr[1] ""
35
62
 
36
- #: views/redirect.hbs:1
37
- msgid "Click <a href=\"%s\">here</a> to continue&mldr;"
38
- msgstr ""
39
-
40
63
  #: views/oauth-scope-error.hbs:5
41
64
  msgid "Insufficient Permissions"
42
65
  msgstr ""
@@ -57,9 +80,8 @@ msgid ""
57
80
  "the Google consent screen."
58
81
  msgstr ""
59
82
 
60
- #: views/oauth-scope-error.hbs:28
61
- #: views/account-identity-error.hbs:32
62
- msgid "Try Again"
83
+ #: views/redirect.hbs:1
84
+ msgid "Click <a href=\"%s\">here</a> to continue&mldr;"
63
85
  msgstr ""
64
86
 
65
87
  #: views/unsubscribe.hbs:7
@@ -145,36 +167,12 @@ msgstr ""
145
167
  msgid "Continue"
146
168
  msgstr ""
147
169
 
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"
170
+ #: views/accounts/register/index.hbs:6
171
+ msgid "Choose your email account provider"
174
172
  msgstr ""
175
173
 
176
- #: views/accounts/register/validating.hbs:70
177
- msgid "Continue to review your mail server settings."
174
+ #: views/accounts/register/index.hbs:19
175
+ msgid "Standard IMAP"
178
176
  msgstr ""
179
177
 
180
178
  #: views/accounts/register/imap-server.hbs:23
@@ -281,12 +279,36 @@ msgstr ""
281
279
  msgid "We couldn't connect with these settings. Check the errors below."
282
280
  msgstr ""
283
281
 
284
- #: views/accounts/register/index.hbs:6
285
- msgid "Choose your email account provider"
282
+ #: views/accounts/register/validating.hbs:35
283
+ msgid "Checking your mail server"
286
284
  msgstr ""
287
285
 
288
- #: views/accounts/register/index.hbs:19
289
- msgid "Standard IMAP"
286
+ #: views/accounts/register/validating.hbs:40
287
+ msgid "Still checking. This can take up to a minute."
288
+ msgstr ""
289
+
290
+ #: views/accounts/register/validating.hbs:47
291
+ msgid "Enter server settings manually"
292
+ msgstr ""
293
+
294
+ #: views/accounts/register/validating.hbs:53
295
+ msgid "We couldn't sign in to your mail server"
296
+ msgstr ""
297
+
298
+ #: views/accounts/register/validating.hbs:54
299
+ msgid "Check the settings on the next page and try again."
300
+ msgstr ""
301
+
302
+ #: views/accounts/register/validating.hbs:61
303
+ msgid "Continue to server settings"
304
+ msgstr ""
305
+
306
+ #: views/accounts/register/validating.hbs:69
307
+ msgid "Almost there"
308
+ msgstr ""
309
+
310
+ #: views/accounts/register/validating.hbs:70
311
+ msgid "Continue to review your mail server settings."
290
312
  msgstr ""
291
313
 
292
314
  #: views/partials/public_test_labels.hbs:9
@@ -327,17 +349,13 @@ msgstr ""
327
349
  msgid "Expected account"
328
350
  msgstr ""
329
351
 
330
- #: views/account-identity-error.hbs:21
331
- msgid "Account used"
332
- msgstr ""
333
-
334
352
  #: views/account-identity-error.hbs:27
335
353
  msgid ""
336
354
  "Try again and use the expected account. If you believe this is a mistake, "
337
355
  "contact the service that sent you this link."
338
356
  msgstr ""
339
357
 
340
- #: lib/autodetect-imap-settings.js:151
358
+ #: lib/autodetect-imap-settings.js:160
341
359
  msgid ""
342
360
  "Microsoft has disabled password-based sign-ins (including app passwords) "
343
361
  "for Outlook.com, Hotmail.com, and Microsoft 365 email accounts. To "
@@ -345,143 +363,143 @@ msgid ""
345
363
  "connect your account."
346
364
  msgstr ""
347
365
 
348
- #: lib/tools.js:1526
366
+ #: lib/tools.js:1609
349
367
  #: lib/ui-routes/unsubscribe-routes.js:31
350
368
  #: lib/ui-routes/unsubscribe-routes.js:99
351
369
  msgid "Invalid input"
352
370
  msgstr ""
353
371
 
354
- #: lib/tools.js:2392
372
+ #: lib/tools.js:2490
355
373
  msgid "Signature validation failed"
356
374
  msgstr ""
357
375
 
358
- #: lib/tools.js:2415
359
- #: lib/tools.js:2421
360
- #: lib/tools.js:2426
361
- #: lib/ui-routes/account-routes.js:1337
376
+ #: lib/tools.js:2513
377
+ #: lib/tools.js:2519
378
+ #: lib/tools.js:2524
379
+ #: lib/ui-routes/account-routes.js:1324
362
380
  msgid "Invalid or expired account setup URL"
363
381
  msgstr ""
364
382
 
365
- #: lib/ui-routes/account-routes.js:481
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
383
+ #: lib/ui-routes/account-routes.js:483
384
+ #: lib/ui-routes/account-routes.js:527
385
+ #: lib/ui-routes/account-routes.js:847
386
+ #: lib/ui-routes/account-routes.js:924
387
+ #: lib/ui-routes/account-routes.js:937
388
+ #: lib/ui-routes/account-routes.js:984
389
+ #: lib/ui-routes/account-routes.js:1200
390
+ #: lib/ui-routes/account-routes.js:1391
391
+ #: lib/ui-routes/route-helpers.js:362
392
+ #: workers/api.js:2305
393
+ #: workers/api.js:2380
376
394
  msgid "Email Account Setup"
377
395
  msgstr ""
378
396
 
379
- #: lib/ui-routes/account-routes.js:550
380
- #: lib/ui-routes/account-routes.js:582
397
+ #: lib/ui-routes/account-routes.js:552
398
+ #: lib/ui-routes/account-routes.js:584
381
399
  #: lib/ui-routes/unsubscribe-routes.js:71
382
400
  msgid "Invalid request. Check your input and try again."
383
401
  msgstr ""
384
402
 
385
- #: lib/ui-routes/account-routes.js:740
403
+ #: lib/ui-routes/account-routes.js:728
386
404
  msgid "Too many attempts for this setup link. Request a new setup link to continue."
387
405
  msgstr ""
388
406
 
389
- #: lib/ui-routes/account-routes.js:983
390
- #: lib/ui-routes/account-routes.js:1387
407
+ #: lib/ui-routes/account-routes.js:971
408
+ #: lib/ui-routes/account-routes.js:1374
391
409
  msgid "Couldn't set up account. Try again."
392
410
  msgstr ""
393
411
 
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
412
+ #: lib/ui-routes/account-routes.js:1059
413
+ #: lib/ui-routes/account-routes.js:1099
414
+ #: lib/ui-routes/admin-entities-routes.js:1941
397
415
  msgid "Server hostname was not found"
398
416
  msgstr ""
399
417
 
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
418
+ #: lib/ui-routes/account-routes.js:1062
419
+ #: lib/ui-routes/account-routes.js:1102
420
+ #: lib/ui-routes/admin-entities-routes.js:1944
403
421
  msgid "Invalid username or password"
404
422
  msgstr ""
405
423
 
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
424
+ #: lib/ui-routes/account-routes.js:1067
425
+ #: lib/ui-routes/account-routes.js:1119
426
+ #: lib/ui-routes/admin-entities-routes.js:1961
409
427
  msgid "Connection timed out"
410
428
  msgstr ""
411
429
 
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
430
+ #: lib/ui-routes/account-routes.js:1073
431
+ #: lib/ui-routes/account-routes.js:1122
432
+ #: lib/ui-routes/admin-entities-routes.js:1964
415
433
  msgid "Could not connect to server"
416
434
  msgstr ""
417
435
 
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
436
+ #: lib/ui-routes/account-routes.js:1086
437
+ #: lib/ui-routes/account-routes.js:1090
438
+ #: lib/ui-routes/account-routes.js:1111
439
+ #: lib/ui-routes/account-routes.js:1115
440
+ #: lib/ui-routes/admin-entities-routes.js:1953
441
+ #: lib/ui-routes/admin-entities-routes.js:1957
424
442
  msgid "TLS protocol error"
425
443
  msgstr ""
426
444
 
427
- #: lib/ui-routes/account-routes.js:1117
428
- #: lib/ui-routes/admin-entities-routes.js:2084
445
+ #: lib/ui-routes/account-routes.js:1105
446
+ #: lib/ui-routes/admin-entities-routes.js:1947
429
447
  msgid "Authentication credentials were not provided"
430
448
  msgstr ""
431
449
 
432
- #: lib/ui-routes/account-routes.js:1120
433
- #: lib/ui-routes/admin-entities-routes.js:2087
450
+ #: lib/ui-routes/account-routes.js:1108
451
+ #: lib/ui-routes/admin-entities-routes.js:1950
434
452
  msgid "OAuth2 authentication failed"
435
453
  msgstr ""
436
454
 
437
- #: lib/ui-routes/account-routes.js:1137
438
- #: lib/ui-routes/admin-entities-routes.js:2104
455
+ #: lib/ui-routes/account-routes.js:1125
456
+ #: lib/ui-routes/admin-entities-routes.js:1967
439
457
  msgid "Unexpected server response"
440
458
  msgstr ""
441
459
 
442
- #: lib/ui-routes/account-routes.js:1325
460
+ #: lib/ui-routes/account-routes.js:1312
443
461
  msgid "Temporary error, please try again"
444
462
  msgstr ""
445
463
 
446
- #: lib/ui-routes/admin-config-routes.js:193
464
+ #: lib/ui-routes/admin-config-routes.js:195
447
465
  msgid "Invalid API key for OpenAI"
448
466
  msgstr ""
449
467
 
450
- #: lib/ui-routes/oauth-config-routes.js:210
468
+ #: lib/ui-routes/oauth-config-routes.js:276
451
469
  msgid "Unknown"
452
470
  msgstr ""
453
471
 
454
- #: lib/ui-routes/oauth-config-routes.js:219
472
+ #: lib/ui-routes/oauth-config-routes.js:285
455
473
  msgid "Indefinite"
456
474
  msgstr ""
457
475
 
458
- #: lib/ui-routes/route-helpers.js:105
476
+ #: lib/ui-routes/route-helpers.js:68
459
477
  msgid "The server unexpectedly closed the connection."
460
478
  msgstr ""
461
479
 
462
- #: lib/ui-routes/route-helpers.js:107
480
+ #: lib/ui-routes/route-helpers.js:70
463
481
  msgid ""
464
482
  "The server unexpectedly closed the connection. This usually happens when "
465
483
  "attempting to connect to a TLS port without TLS enabled."
466
484
  msgstr ""
467
485
 
468
- #: lib/ui-routes/route-helpers.js:162
486
+ #: lib/ui-routes/route-helpers.js:125
469
487
  msgid ""
470
488
  "Connection timed out. This usually occurs if you are behind a firewall or "
471
489
  "connecting to the wrong port."
472
490
  msgstr ""
473
491
 
474
- #: lib/ui-routes/route-helpers.js:169
492
+ #: lib/ui-routes/route-helpers.js:132
475
493
  msgid ""
476
494
  "The server refused the connection. This typically occurs if the server is "
477
495
  "not running, is overloaded, or you are connecting to the wrong host or port."
478
496
  msgstr ""
479
497
 
480
- #: lib/ui-routes/route-helpers.js:223
498
+ #: lib/ui-routes/route-helpers.js:186
481
499
  msgid "Delegated"
482
500
  msgstr ""
483
501
 
484
- #: lib/ui-routes/route-helpers.js:224
502
+ #: lib/ui-routes/route-helpers.js:187
485
503
  msgid "Using credentials from \"%s\""
486
504
  msgstr ""
487
505
 
@@ -497,37 +515,37 @@ msgstr ""
497
515
  msgid "Couldn't process request. Try again."
498
516
  msgstr ""
499
517
 
500
- #: workers/api.js:2241
518
+ #: workers/api.js:2234
501
519
  msgid ""
502
520
  "The sign-in was cancelled or the requested access was not granted. Open the "
503
521
  "account setup link again to retry."
504
522
  msgstr ""
505
523
 
506
- #: workers/api.js:2250
524
+ #: workers/api.js:2243
507
525
  msgid "Sign-in with the email provider failed: %s"
508
526
  msgstr ""
509
527
 
510
- #: workers/api.js:2254
528
+ #: workers/api.js:2247
511
529
  msgid "Sign-in with the email provider failed: no authorization code was received"
512
530
  msgstr ""
513
531
 
514
- #: workers/api.js:2260
532
+ #: workers/api.js:2253
515
533
  msgid "Sign-in with the email provider failed: the request state is not valid"
516
534
  msgstr ""
517
535
 
518
- #: workers/api.js:2266
536
+ #: workers/api.js:2259
519
537
  msgid ""
520
538
  "The account setup session has expired or was already used. Open the account "
521
539
  "setup link again to retry."
522
540
  msgstr ""
523
541
 
524
- #: workers/api.js:2273
542
+ #: workers/api.js:2266
525
543
  msgid ""
526
544
  "Sign-in with the email provider failed: the stored setup session is not "
527
545
  "valid"
528
546
  msgstr ""
529
547
 
530
- #: workers/api.js:3139
531
- #: workers/api.js:3254
548
+ #: workers/api.js:3174
549
+ #: workers/api.js:3289
532
550
  msgid "Requested page not found"
533
551
  msgstr ""
@@ -0,0 +1,30 @@
1
+ {{!-- Shown when the OAuth2 application is set to "Accept only Google Workspace accounts" and the account
2
+ that signed in is a personal one; offers a link to restart the setup. Sibling of
3
+ account-identity-error.hbs and oauth-scope-error.hbs - the user made a correctable choice, so the flow
4
+ stops here with a way back rather than bouncing them to the calling application. --}}
5
+
6
+ <div class="ee-center">
7
+ <h1>{{_ "Work Account Required" templateLocale}}</h1>
8
+ </div>
9
+
10
+ <div class="ee-alert ee-alert-error">
11
+ <span class="ee-icon ee-icon-alert-triangle ee-icon-lg"></span>
12
+ <span>{{_ "This setup accepts only a Google Workspace account, and a personal Google account was used." templateLocale}}</span>
13
+ </div>
14
+
15
+ {{#if actualEmail}}
16
+ <dl class="ee-dl">
17
+ <dt>{{_ "Account used" templateLocale}}</dt>
18
+ <dd>{{actualEmail}}</dd>
19
+ </dl>
20
+ {{/if}}
21
+
22
+ <p class="ee-muted">
23
+ {{_ "Try again and sign in with your work or school account. If you believe this is a mistake, contact the service that sent you this link." templateLocale}}
24
+ </p>
25
+
26
+ <div class="ee-form-actions">
27
+ <a href="{{retryUrl}}" class="ee-btn ee-btn-primary ee-btn-block">
28
+ <span class="ee-icon ee-icon-refresh"></span>{{_ "Try Again" templateLocale}}
29
+ </a>
30
+ </div>
@@ -484,10 +484,15 @@
484
484
  <dd>{{account.imap.resyncDelay}}</dd>
485
485
  {{/if}}
486
486
 
487
- {{#if account.imap.sentMailPath}}
488
- <dt>Sent Mail folder</dt>
489
- <dd>{{account.imap.sentMailPath}}</dd>
490
- {{/if}}
487
+ {{!-- The special-use folder overrides, from the same list the edit form renders, and each
488
+ shown only where one is set: EmailEngine detects these folders from the server's own flags,
489
+ so an absent row means it detected the folder rather than that there is none. --}}
490
+ {{#each specialUsePathFields}}
491
+ {{#with (lookup ../account.imap this.key)}}
492
+ <dt>{{../this.label}} folder</dt>
493
+ <dd>{{this}}</dd>
494
+ {{/with}}
495
+ {{/each}}
491
496
 
492
497
  {{#if account.path}}
493
498
  <dt>Syncing paths
@@ -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,
@@ -51,7 +51,16 @@
51
51
 
52
52
  {{/unless}}
53
53
 
54
- {{> ui/form-field id="imap_sentMailPath" label="Sent Mail folder" value=values.imap_sentMailPath error=errors.imap_sentMailPath lpignore=true placeholder='Folder path like "Sent Mail"' list="available-paths-list" hint='Store copies of sent emails in this folder. Leave blank to use the default "Sent Mail" folder for this account.'}}
54
+ {{!-- The special-use folder overrides, rendered from the one list that also drives their
55
+ schema and the update loop (SPECIAL_USE_PATH_FIELDS in lib/ui-routes/special-use-paths.js,
56
+ derived from SPECIAL_USE_PATH_TYPES in lib/consts.js). EmailEngine detects these folders
57
+ from the server's own flags; an override is for a server that flags none, or flags the
58
+ wrong one. Written out five times before, which is how four of them came to be missing. --}}
59
+ {{#each specialUsePathFields}}
60
+ {{> ui/form-field id=this.inputId label=(concat this.label " folder") value=(lookup ../values this.inputId)
61
+ error=(lookup ../errors this.inputId) lpignore=true placeholder=(concat "Folder path like \"" this.label "\"")
62
+ list="available-paths-list" hint=(concat this.description " Leave blank to use the folder EmailEngine detects for this account.")}}
63
+ {{/each}}
55
64
 
56
65
  {{> ui/form-field id="imap_resyncDelay" type="number" label="Resync interval (seconds)" value=values.imap_resyncDelay error=errors.imap_resyncDelay lpignore=true hint="Time between full mailbox syncs. Leave blank to keep the current interval."}}
57
66
 
@@ -143,7 +152,7 @@
143
152
  <script data-cfasync="false" nonce="{{cspNonce}}">
144
153
  document.addEventListener('DOMContentLoaded', () => {
145
154
  let availablePaths = JSON.parse(document.getElementById('availablePaths').value);
146
- // native datalist suggestions for the Sent Mail folder input (the
155
+ // native datalist suggestions for the special-use folder inputs (the
147
156
  // form-field markup references the list id directly)
148
157
  uiDatalist('available-paths-list', availablePaths);
149
158
  })