emailengine-app 2.76.0 → 2.78.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 (165) hide show
  1. package/.github/workflows/release.yaml +24 -19
  2. package/.github/workflows/test.yml +80 -0
  3. package/.ncurc.js +14 -2
  4. package/.release-please-manifest.json +3 -0
  5. package/CHANGELOG.md +54 -0
  6. package/README.md +1 -1
  7. package/bin/emailengine.js +1 -1
  8. package/data/google-crawlers.json +1 -1
  9. package/encrypt.js +72 -5
  10. package/lib/account/expected-identity.js +88 -0
  11. package/lib/account.js +75 -26
  12. package/lib/address-strategies.js +18 -0
  13. package/lib/api-reference/code-samples.js +194 -0
  14. package/lib/api-reference/format.js +193 -0
  15. package/lib/api-reference/index.js +222 -0
  16. package/lib/api-reference/model.js +338 -0
  17. package/lib/api-reference/schema-tree.js +366 -0
  18. package/lib/api-routes/account-routes.js +136 -39
  19. package/lib/api-routes/behavior-notes.js +57 -0
  20. package/lib/api-routes/blocklist-routes.js +9 -9
  21. package/lib/api-routes/changes-routes.js +6 -4
  22. package/lib/api-routes/chat-routes.js +3 -3
  23. package/lib/api-routes/delivery-test-routes.js +24 -6
  24. package/lib/api-routes/export-routes.js +14 -12
  25. package/lib/api-routes/gateway-routes.js +11 -11
  26. package/lib/api-routes/license-routes.js +7 -7
  27. package/lib/api-routes/mailbox-routes.js +18 -9
  28. package/lib/api-routes/message-routes.js +55 -35
  29. package/lib/api-routes/oauth2-app-routes.js +22 -16
  30. package/lib/api-routes/outbox-routes.js +7 -7
  31. package/lib/api-routes/pubsub-routes.js +3 -3
  32. package/lib/api-routes/settings-routes.js +10 -9
  33. package/lib/api-routes/stats-routes.js +3 -3
  34. package/lib/api-routes/submit-routes.js +58 -8
  35. package/lib/api-routes/template-routes.js +13 -13
  36. package/lib/api-routes/token-routes.js +15 -10
  37. package/lib/api-routes/webhook-route-routes.js +5 -5
  38. package/lib/append-list.js +3 -14
  39. package/lib/arf-detect.js +23 -1
  40. package/lib/autodetect-imap-settings.js +40 -16
  41. package/lib/base32.js +30 -0
  42. package/lib/bounce-detect.js +182 -62
  43. package/lib/consts.js +7 -0
  44. package/lib/egress-filter.js +89 -8
  45. package/lib/email-client/base-client.js +72 -82
  46. package/lib/email-client/gmail-client.js +3 -3
  47. package/lib/email-client/imap/listing-diff.js +3 -3
  48. package/lib/email-client/imap/mailbox.js +5 -69
  49. package/lib/email-client/imap-client.js +3 -2
  50. package/lib/email-client/message-builder.js +13 -13
  51. package/lib/email-client/outlook-client.js +1 -1
  52. package/lib/enum-descriptions.js +130 -0
  53. package/lib/export.js +1 -1
  54. package/lib/gateway.js +1 -1
  55. package/lib/get-raw-email.js +1 -1
  56. package/lib/imapproxy/imap-core/lib/imap-connection.js +2 -2
  57. package/lib/imapproxy/imap-core/lib/imap-server.js +2 -2
  58. package/lib/imapproxy/imap-server.js +42 -28
  59. package/lib/imapproxy/upstream-client.js +38 -0
  60. package/lib/license-beacon.js +1 -1
  61. package/lib/llm-pre-process.js +1 -1
  62. package/lib/msgpack.js +62 -0
  63. package/lib/oauth/decode-jwt-payload.js +39 -0
  64. package/lib/oauth/outlook-identity.js +61 -0
  65. package/lib/oauth/retry-setup.js +38 -0
  66. package/lib/oauth2-apps.js +10 -4
  67. package/lib/openapi/build-document.js +318 -0
  68. package/lib/openapi/index.js +95 -0
  69. package/lib/openapi/joi-schema.js +523 -0
  70. package/lib/outbox.js +66 -3
  71. package/lib/pre-process.js +1 -1
  72. package/lib/read-env-value.js +37 -0
  73. package/lib/routes-ui.js +5 -1
  74. package/lib/schemas.js +88 -17
  75. package/lib/swagger-options.js +173 -0
  76. package/lib/templates.js +1 -1
  77. package/lib/tokens.js +70 -6
  78. package/lib/tools.js +117 -48
  79. package/lib/totp.js +67 -0
  80. package/lib/ui-routes/account-routes.js +91 -15
  81. package/lib/ui-routes/admin-config-routes.js +2 -7
  82. package/lib/ui-routes/admin-entities-routes.js +3 -0
  83. package/lib/ui-routes/auth-routes.js +6 -24
  84. package/lib/ui-routes/dashboard-routes.js +2 -26
  85. package/lib/ui-routes/reference-routes.js +198 -0
  86. package/lib/ui-routes/route-helpers.js +39 -0
  87. package/lib/utils/is-email.js +34 -0
  88. package/lib/utils/to-camel-case.js +17 -0
  89. package/lib/webhook-egress.js +37 -0
  90. package/lib/webhooks.js +1 -1
  91. package/package.json +27 -31
  92. package/prepare-bundle-deps.sh +28 -0
  93. package/release-please-config.json +11 -0
  94. package/sbom.json +1 -1
  95. package/server.js +11 -3
  96. package/static/css/flyonui.css +1 -1
  97. package/static/css/public.css +3 -0
  98. package/static/css/src/app.tailwind.css +113 -0
  99. package/static/js/app.js +69 -0
  100. package/static/js/ee-client.js +238 -8
  101. package/static/js/reference.js +1021 -0
  102. package/static/js/ui.js +61 -33
  103. package/static/licenses.html +658 -1560
  104. package/translations/README.md +64 -0
  105. package/translations/de.mo +0 -0
  106. package/translations/de.po +164 -120
  107. package/translations/en.po +200 -161
  108. package/translations/et.mo +0 -0
  109. package/translations/et.po +163 -120
  110. package/translations/fr.mo +0 -0
  111. package/translations/fr.po +163 -120
  112. package/translations/ja.mo +0 -0
  113. package/translations/ja.po +163 -120
  114. package/translations/messages.pot +84 -54
  115. package/translations/nl.mo +0 -0
  116. package/translations/nl.po +164 -120
  117. package/translations/pl.mo +0 -0
  118. package/translations/pl.po +163 -120
  119. package/views/account-identity-error.hbs +34 -0
  120. package/views/accounts/edit.hbs +1 -0
  121. package/views/accounts/register/imap.hbs +12 -2
  122. package/views/config/ai.hbs +1 -1
  123. package/views/config/document-store/chat.hbs +5 -5
  124. package/views/config/document-store/index.hbs +2 -2
  125. package/views/config/document-store/pre-processing/index.hbs +1 -1
  126. package/views/config/email-processing.hbs +1 -1
  127. package/views/config/imap-proxy.hbs +1 -1
  128. package/views/config/license.hbs +1 -1
  129. package/views/config/oauth/index.hbs +3 -3
  130. package/views/config/security.hbs +1 -1
  131. package/views/config/smtp.hbs +2 -2
  132. package/views/dashboard.hbs +1 -1
  133. package/views/layout/app.hbs +43 -8
  134. package/views/oauth-scope-error.hbs +1 -1
  135. package/views/partials/oauth_form.hbs +4 -4
  136. package/views/partials/reference/anchor-link.hbs +20 -0
  137. package/views/partials/reference/disclosure.hbs +37 -0
  138. package/views/partials/reference/nav.hbs +120 -0
  139. package/views/partials/reference/operation.hbs +127 -0
  140. package/views/partials/reference/params.hbs +20 -0
  141. package/views/partials/reference/schema-node.hbs +99 -0
  142. package/views/partials/reference/schema.hbs +19 -0
  143. package/views/partials/reference/section-heading.hbs +16 -0
  144. package/views/partials/reference/token-alert.hbs +49 -0
  145. package/views/partials/reference/try-field.hbs +31 -0
  146. package/views/partials/reference/try-it.hbs +78 -0
  147. package/views/partials/side_menu.hbs +1 -1
  148. package/views/partials/ui/badge.hbs +4 -2
  149. package/views/partials/ui/page-header.hbs +1 -1
  150. package/views/partials/ui/search-input.hbs +31 -0
  151. package/views/partials/ui/setting-ref.hbs +1 -1
  152. package/views/partials/ui/stat-card.hbs +4 -2
  153. package/views/partials/ui/tab.hbs +6 -1
  154. package/views/partials/ui/tabs.hbs +2 -2
  155. package/views/reference/index.hbs +76 -0
  156. package/views/reference/redirect.hbs +49 -0
  157. package/views/reference/tag.hbs +28 -0
  158. package/views/reference/token.hbs +49 -0
  159. package/views/tokens/index.hbs +9 -1
  160. package/views/webhooks/index.hbs +3 -3
  161. package/workers/api.js +194 -302
  162. package/workers/imap.js +1 -1
  163. package/workers/submit.js +1 -1
  164. package/workers/webhooks.js +2 -13
  165. package/views/swagger/index.hbs +0 -82
package/static/js/ui.js CHANGED
@@ -250,41 +250,34 @@ window.paintCertData = certData => {
250
250
  }
251
251
  };
252
252
 
253
- // Copy-to-clipboard buttons: a .copy-btn with data-copy-target="#selector"
254
- // copies the target's value (inputs), ACE editor content (a mounted
255
- // ui/code-editor div) or text content. Delegated, so buttons inside
256
- // dynamically injected markup work without re-binding. Uses the async
257
- // Clipboard API where available; self-hosted installs served over plain HTTP
258
- // are not a secure context, so those fall back to execCommand on a throwaway
259
- // textarea (a selection on the target itself would not work for password
260
- // inputs or ACE editors, which only render the visible lines).
261
- document.addEventListener('click', e => {
262
- let btn = e.target.closest('.copy-btn');
263
- if (!btn) {
253
+ // Keyboard hints that spell a modifier differently on macOS (ui/search-input
254
+ // renders `shortcut` with an optional `shortcutMac`). The server cannot know
255
+ // the platform, so it emits the Ctrl form and the Mac spelling rides along in
256
+ // data-mac; this swaps it in. Generic on purpose - the next page that binds a
257
+ // hotkey gets the right label without reaching into the partial's markup.
258
+ document.addEventListener('DOMContentLoaded', () => {
259
+ if (!/mac/i.test((navigator.userAgentData && navigator.userAgentData.platform) || navigator.platform || '')) {
264
260
  return;
265
261
  }
266
- // toolbar copy controls are <a href="#"> links
267
- e.preventDefault();
268
-
269
- let value;
270
- if ('copyValue' in btn.dataset) {
271
- // literal value carried on the button itself (e.g. the per-row ids in
272
- // ui/entity-id) - no target element needed
273
- value = btn.dataset.copyValue;
274
- } else {
275
- let target = btn.dataset.copyTarget ? document.querySelector(btn.dataset.copyTarget) : null;
276
- if (!target) {
277
- return;
278
- }
279
262
 
280
- let aceEntry = uiAceInstances.get(target);
281
- if (aceEntry) {
282
- value = aceEntry.editor.getValue();
283
- } else {
284
- value = 'value' in target ? target.value : target.textContent;
285
- }
263
+ for (let elm of document.querySelectorAll('kbd[data-mac]')) {
264
+ elm.textContent = elm.dataset.mac;
286
265
  }
266
+ });
287
267
 
268
+ // Writes a string to the clipboard and confirms it on the button that asked
269
+ // for it (the copy icon flips to a checkmark, a failure raises a toast).
270
+ // Uses the async Clipboard API where available; self-hosted installs served
271
+ // over plain HTTP are not a secure context, so those fall back to execCommand
272
+ // on a throwaway textarea (a selection on the source element itself would not
273
+ // work for password inputs or ACE editors, which only render the visible
274
+ // lines).
275
+ //
276
+ // Exposed rather than kept inside the delegated handler below because not
277
+ // every copyable value can be pointed at: the API reference's copy-as-curl
278
+ // serializes its try-it form at click time, so there is no element holding the
279
+ // text and no data attribute it could have been rendered into.
280
+ window.uiCopyText = (value, btn) => {
288
281
  let copied;
289
282
  if (navigator.clipboard && window.isSecureContext) {
290
283
  copied = navigator.clipboard.writeText(value).then(
@@ -309,16 +302,51 @@ document.addEventListener('click', e => {
309
302
  copied = Promise.resolve(ok);
310
303
  }
311
304
 
312
- copied.then(ok => {
305
+ return copied.then(ok => {
313
306
  if (!ok) {
314
307
  window.showToast('Failed to copy to clipboard', 'alert-triangle');
315
- return;
308
+ return false;
316
309
  }
317
- let icon = btn.querySelector('[class*="icon-"]');
310
+ let icon = btn && btn.querySelector('[class*="icon-"]');
318
311
  if (icon && icon.classList.replace('icon-[tabler--copy]', 'icon-[tabler--check]')) {
319
312
  window.setTimeout(() => icon.classList.replace('icon-[tabler--check]', 'icon-[tabler--copy]'), 1500);
320
313
  }
314
+ return true;
321
315
  });
316
+ };
317
+
318
+ // Copy-to-clipboard buttons: a .copy-btn with data-copy-target="#selector"
319
+ // copies the target's value (inputs), ACE editor content (a mounted
320
+ // ui/code-editor div) or text content. Delegated, so buttons inside
321
+ // dynamically injected markup work without re-binding.
322
+ document.addEventListener('click', e => {
323
+ let btn = e.target.closest('.copy-btn');
324
+ if (!btn) {
325
+ return;
326
+ }
327
+ // toolbar copy controls are <a href="#"> links
328
+ e.preventDefault();
329
+
330
+ let value;
331
+ if ('copyValue' in btn.dataset) {
332
+ // literal value carried on the button itself (e.g. the per-row ids in
333
+ // ui/entity-id) - no target element needed
334
+ value = btn.dataset.copyValue;
335
+ } else {
336
+ let target = btn.dataset.copyTarget ? document.querySelector(btn.dataset.copyTarget) : null;
337
+ if (!target) {
338
+ return;
339
+ }
340
+
341
+ let aceEntry = uiAceInstances.get(target);
342
+ if (aceEntry) {
343
+ value = aceEntry.editor.getValue();
344
+ } else {
345
+ value = 'value' in target ? target.value : target.textContent;
346
+ }
347
+ }
348
+
349
+ window.uiCopyText(value, btn);
322
350
  });
323
351
 
324
352
  // Resource-list row delete: a .list-delete-btn (rendered by ui/row-actions in