emailengine-app 2.89.0 → 2.90.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 (72) hide show
  1. package/.ncurc.js +19 -8
  2. package/.release-please-manifest.json +1 -1
  3. package/CHANGELOG.md +44 -0
  4. package/Dockerfile +5 -1
  5. package/bin/healthcheck.js +1 -1
  6. package/copy-static-files.sh +0 -8
  7. package/data/google-crawlers.json +1 -1
  8. package/encrypt.js +1 -4
  9. package/lib/account/field-codec.js +396 -0
  10. package/lib/account.js +158 -453
  11. package/lib/api-routes/account-routes.js +42 -6
  12. package/lib/api-routes/route-metadata.js +5 -2
  13. package/lib/api-routes/submit-routes.js +15 -2
  14. package/lib/api-token-auth.js +342 -274
  15. package/lib/arf-detect.js +174 -149
  16. package/lib/attachment-size.js +29 -0
  17. package/lib/autodetect-imap-settings.js +83 -234
  18. package/lib/consts.js +1 -5
  19. package/lib/db.js +1 -4
  20. package/lib/email-client/base-client.js +907 -780
  21. package/lib/email-client/gmail-client.js +557 -450
  22. package/lib/email-client/imap/cid-parts.js +61 -0
  23. package/lib/email-client/imap/mailbox.js +376 -422
  24. package/lib/email-client/imap/sync-operations.js +239 -178
  25. package/lib/email-client/new-message-steps.js +168 -2
  26. package/lib/email-client/outlook/graph-message.js +266 -0
  27. package/lib/email-client/outlook/subscription-expiry.js +30 -0
  28. package/lib/email-client/outlook-client.js +652 -808
  29. package/lib/get-raw-email.js +338 -232
  30. package/lib/get-secret.js +1 -4
  31. package/lib/license-subscription.js +60 -0
  32. package/lib/load-env.js +48 -0
  33. package/lib/logger.js +1 -4
  34. package/lib/mcp/tools.js +244 -207
  35. package/lib/metric-values.js +76 -0
  36. package/lib/metrics.js +320 -0
  37. package/lib/oauth/gmail.js +39 -120
  38. package/lib/oauth/http-request.js +195 -0
  39. package/lib/oauth/mail-ru.js +24 -58
  40. package/lib/oauth/outlook.js +37 -137
  41. package/lib/oauth/pubsub/google.js +176 -117
  42. package/lib/oauth2-apps.js +440 -463
  43. package/lib/openapi/build-document.js +10 -10
  44. package/lib/read-env-value.js +1 -1
  45. package/lib/route-descriptors.js +78 -0
  46. package/lib/schemas.js +10 -1
  47. package/lib/sentry-integrations.js +299 -0
  48. package/lib/sentry.js +75 -27
  49. package/lib/sso-routes.js +249 -0
  50. package/lib/sso.js +29 -6
  51. package/lib/ui-routes/account-edit-form.js +198 -0
  52. package/lib/ui-routes/account-page.js +241 -0
  53. package/lib/ui-routes/account-routes.js +12 -318
  54. package/lib/ui-routes/auth-routes.js +10 -10
  55. package/lib/ui-view-context.js +328 -0
  56. package/lib/utils/public-suffix.js +22 -101
  57. package/lib/web-safe-html.js +20 -7
  58. package/lib/worker-metrics.js +82 -0
  59. package/list-generate.js +2 -5
  60. package/package.json +23 -19
  61. package/sbom.json +267 -908
  62. package/scripts/refresh-test-tokens.js +1 -1
  63. package/server.js +320 -676
  64. package/static/css/flyonui.css +1 -1
  65. package/static/css/src/app.tailwind.css +18 -0
  66. package/static/js/ee-client.js +2619 -645
  67. package/static/js/ui.js +12 -2
  68. package/static/licenses.html +219 -737
  69. package/translations/messages.pot +64 -53
  70. package/views/accounts/browse.hbs +19 -1
  71. package/workers/api.js +20 -451
  72. package/data/public_suffix_list.dat +0 -16698
@@ -1,7 +1,7 @@
1
1
  msgid ""
2
2
  msgstr ""
3
3
  "Content-Type: text/plain; charset=ascii\n"
4
- "POT-Creation-Date: 2026-11-15 21:46+0000\n"
4
+ "POT-Creation-Date: 2026-11-16 14:15+0000\n"
5
5
 
6
6
  #: lib/autodetect-imap-settings.js:160
7
7
  msgid ""
@@ -28,82 +28,93 @@ msgstr ""
28
28
  msgid "Invalid or expired account setup URL"
29
29
  msgstr ""
30
30
 
31
- #: lib/ui-routes/account-routes.js:229
32
- #: lib/ui-routes/account-routes.js:787
33
- #: lib/ui-routes/account-routes.js:939
34
- #: lib/ui-routes/account-routes.js:952
35
- #: lib/ui-routes/account-routes.js:999
36
- #: lib/ui-routes/account-routes.js:1208
37
- #: lib/ui-routes/account-routes.js:1360
38
- #: lib/ui-routes/route-helpers.js:350
39
- #: lib/ui-routes/route-helpers.js:373
40
- #: workers/api.js:2050
41
- msgid "Email Account Setup"
42
- msgstr ""
43
-
44
- #: lib/ui-routes/account-routes.js:369
45
- msgid "Too many attempts for this setup link. Request a new setup link to continue."
46
- msgstr ""
47
-
48
- #: lib/ui-routes/account-routes.js:812
49
- #: lib/ui-routes/account-routes.js:846
50
- #: lib/ui-routes/unsubscribe-routes.js:74
51
- msgid "Invalid request. Check your input and try again."
52
- msgstr ""
53
-
54
- #: lib/ui-routes/account-routes.js:986
55
- #: lib/ui-routes/account-routes.js:1343
56
- msgid "Couldn't set up account. Try again."
57
- msgstr ""
58
-
59
- #: lib/ui-routes/account-routes.js:1076
60
- #: lib/ui-routes/account-routes.js:1116
31
+ #: lib/ui-routes/account-page.js:170
32
+ #: lib/ui-routes/account-page.js:171
33
+ #: lib/ui-routes/account-page.js:193
61
34
  #: lib/ui-routes/admin-entities-routes.js:1984
62
35
  msgid "Server hostname was not found"
63
36
  msgstr ""
64
37
 
65
- #: lib/ui-routes/account-routes.js:1079
66
- #: lib/ui-routes/account-routes.js:1119
38
+ #: lib/ui-routes/account-page.js:172
39
+ #: lib/ui-routes/account-page.js:194
67
40
  #: lib/ui-routes/admin-entities-routes.js:1987
68
41
  msgid "Invalid username or password"
69
42
  msgstr ""
70
43
 
71
- #: lib/ui-routes/account-routes.js:1084
72
- #: lib/ui-routes/account-routes.js:1136
44
+ #: lib/ui-routes/account-page.js:173
45
+ #: lib/ui-routes/account-page.js:174
46
+ #: lib/ui-routes/account-page.js:175
47
+ #: lib/ui-routes/account-page.js:198
73
48
  #: lib/ui-routes/admin-entities-routes.js:2004
74
49
  msgid "Connection timed out"
75
50
  msgstr ""
76
51
 
77
- #: lib/ui-routes/account-routes.js:1090
78
- #: lib/ui-routes/account-routes.js:1139
52
+ #: lib/ui-routes/account-page.js:176
53
+ #: lib/ui-routes/account-page.js:177
54
+ #: lib/ui-routes/account-page.js:178
55
+ #: lib/ui-routes/account-page.js:179
56
+ #: lib/ui-routes/account-page.js:199
79
57
  #: lib/ui-routes/admin-entities-routes.js:2007
80
58
  msgid "Could not connect to server"
81
59
  msgstr ""
82
60
 
83
- #: lib/ui-routes/account-routes.js:1103
84
- #: lib/ui-routes/account-routes.js:1107
85
- #: lib/ui-routes/account-routes.js:1128
86
- #: lib/ui-routes/account-routes.js:1132
61
+ #: lib/ui-routes/account-page.js:182
62
+ #: lib/ui-routes/account-page.js:183
63
+ #: lib/ui-routes/account-page.js:184
64
+ #: lib/ui-routes/account-page.js:185
65
+ #: lib/ui-routes/account-page.js:186
66
+ #: lib/ui-routes/account-page.js:187
67
+ #: lib/ui-routes/account-page.js:188
68
+ #: lib/ui-routes/account-page.js:197
69
+ #: lib/ui-routes/account-page.js:209
87
70
  #: lib/ui-routes/admin-entities-routes.js:1996
88
71
  #: lib/ui-routes/admin-entities-routes.js:2000
89
72
  msgid "TLS protocol error"
90
73
  msgstr ""
91
74
 
92
- #: lib/ui-routes/account-routes.js:1122
75
+ #: lib/ui-routes/account-page.js:195
93
76
  #: lib/ui-routes/admin-entities-routes.js:1990
94
77
  msgid "Authentication credentials were not provided"
95
78
  msgstr ""
96
79
 
97
- #: lib/ui-routes/account-routes.js:1125
80
+ #: lib/ui-routes/account-page.js:196
98
81
  #: lib/ui-routes/admin-entities-routes.js:1993
99
82
  msgid "OAuth2 authentication failed"
100
83
  msgstr ""
101
84
 
102
- #: lib/ui-routes/account-routes.js:1142
85
+ #: lib/ui-routes/account-page.js:200
103
86
  #: lib/ui-routes/admin-entities-routes.js:2010
104
87
  msgid "Unexpected server response"
105
88
  msgstr ""
106
89
 
90
+ #: lib/ui-routes/account-routes.js:226
91
+ #: lib/ui-routes/account-routes.js:784
92
+ #: lib/ui-routes/account-routes.js:936
93
+ #: lib/ui-routes/account-routes.js:949
94
+ #: lib/ui-routes/account-routes.js:996
95
+ #: lib/ui-routes/account-routes.js:1126
96
+ #: lib/ui-routes/account-routes.js:1278
97
+ #: lib/ui-routes/route-helpers.js:350
98
+ #: lib/ui-routes/route-helpers.js:373
99
+ #: workers/api.js:1861
100
+ msgid "Email Account Setup"
101
+ msgstr ""
102
+
103
+ #: lib/ui-routes/account-routes.js:366
104
+ msgid "Too many attempts for this setup link. Request a new setup link to continue."
105
+ msgstr ""
106
+
107
+ #: lib/ui-routes/account-routes.js:809
108
+ #: lib/ui-routes/account-routes.js:843
109
+ #: lib/ui-routes/unsubscribe-routes.js:74
110
+ msgid "Invalid request. Check your input and try again."
111
+ msgstr ""
112
+
113
+ #: lib/ui-routes/account-routes.js:983
114
+ #: lib/ui-routes/account-routes.js:1261
115
+ msgid "Couldn't set up account. Try again."
116
+ msgstr ""
117
+
107
118
  #: lib/ui-routes/account-setup.js:68
108
119
  msgid "Temporary error, please try again"
109
120
  msgstr ""
@@ -413,7 +424,7 @@ msgstr[0] ""
413
424
  msgstr[1] ""
414
425
 
415
426
  #: views/error.hbs:6
416
- #: workers/api.js:2930
427
+ #: workers/api.js:2500
417
428
  msgid "Something went wrong"
418
429
  msgstr ""
419
430
 
@@ -529,37 +540,37 @@ msgid ""
529
540
  "received."
530
541
  msgstr ""
531
542
 
532
- #: workers/api.js:1962
543
+ #: workers/api.js:1773
533
544
  msgid ""
534
545
  "The sign-in was cancelled or the requested access was not granted. Open the "
535
546
  "account setup link again to retry."
536
547
  msgstr ""
537
548
 
538
- #: workers/api.js:1971
549
+ #: workers/api.js:1782
539
550
  msgid "Sign-in with the email provider failed: %s"
540
551
  msgstr ""
541
552
 
542
- #: workers/api.js:1975
553
+ #: workers/api.js:1786
543
554
  msgid "Sign-in with the email provider failed: no authorization code was received"
544
555
  msgstr ""
545
556
 
546
- #: workers/api.js:1979
557
+ #: workers/api.js:1790
547
558
  msgid "Sign-in with the email provider failed: the request state is not valid"
548
559
  msgstr ""
549
560
 
550
- #: workers/api.js:1988
561
+ #: workers/api.js:1799
551
562
  msgid ""
552
563
  "The account setup session has expired or was already used. Open the account "
553
564
  "setup link again to retry."
554
565
  msgstr ""
555
566
 
556
- #: workers/api.js:1994
567
+ #: workers/api.js:1805
557
568
  msgid ""
558
569
  "Sign-in with the email provider failed: the stored setup session is not "
559
570
  "valid"
560
571
  msgstr ""
561
572
 
562
- #: workers/api.js:2929
563
- #: workers/api.js:3052
573
+ #: workers/api.js:2499
574
+ #: workers/api.js:2622
564
575
  msgid "Requested page not found"
565
576
  msgstr ""
@@ -2,6 +2,7 @@
2
2
 
3
3
  {{> ui/breadcrumb parentHref="/admin/accounts" parentLabel="Accounts" midHref=(concat "/admin/accounts/" (urlpart account)) midLabel=account current="Browse" class="mt-6 mb-6"}}
4
4
 
5
+ {{!-- The widget's accent colours are set for #email-client in static/css/src/app.tailwind.css --}}
5
6
  <div id="email-client"></div>
6
7
 
7
8
  {{#> ui/modal id="confirmModal" title="Confirm" titleId="confirmModalLabel"}}
@@ -41,6 +42,21 @@ escaping, and an account ID is free text (a quote, a backslash or an entity brok
41
42
  apiUrl: window.location.origin,
42
43
  account: document.getElementById('browse-account').value,
43
44
  accessToken: document.getElementById('browse-session-token').value,
45
+ // ?message= deep link (/admin/accounts/{account}/browse?message={message ID}, e.g. from
46
+ // an operator's own back office): open that message and its folder instead of the inbox
47
+ message: new URL(window.location.href).searchParams.get('message') || '',
48
+ // ...and the address bar follows whatever is open, so it can be copied or reloaded
49
+ onNavigate: ({ messageId }) => {
50
+ const url = new URL(window.location.href);
51
+ if (messageId) {
52
+ url.searchParams.set('message', messageId);
53
+ } else {
54
+ url.searchParams.delete('message');
55
+ }
56
+ if (url.href !== window.location.href) {
57
+ window.history.replaceState(window.history.state, '', url);
58
+ }
59
+ },
44
60
  // the widget appends its own stylesheet element; the admin policy accepts it with this
45
61
  // nonce, read off a nonced script (the nonce property survives the attribute being hidden)
46
62
  styleNonce: document.querySelector('script[nonce]').nonce,
@@ -54,7 +70,9 @@ escaping, and an account ID is free text (a quote, a backslash or an entity brok
54
70
  document.getElementById('confirm-cancel').textContent = cancelText;
55
71
  document.getElementById('confirm-ok').textContent = okText;
56
72
 
57
- return uiConfirmModal('#confirmModal', '#confirm-ok');
73
+ // the Cancel button answers false and a dialog closed any other way null, which the
74
+ // widget reads as no answer (an unsaved message then stays open rather than going)
75
+ return uiConfirmModal('#confirmModal', '#confirm-ok', '#confirm-cancel');
58
76
  },
59
77
 
60
78
  // An alert has nothing to answer, so callers just await it being dismissed. The