emailengine-app 2.79.6 → 2.79.8

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 (109) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +32 -0
  3. package/DOCKER_DEPLOYMENT.md +2 -0
  4. package/bin/emailengine.js +29 -13
  5. package/config/default.toml +13 -3
  6. package/data/google-crawlers.json +7 -1
  7. package/docker-compose.yml +12 -3
  8. package/install.sh +2 -0
  9. package/lib/api-routes/account-routes.js +14 -3
  10. package/lib/api-routes/mailbox-routes.js +4 -1
  11. package/lib/api-routes/message-routes.js +6 -5
  12. package/lib/api-routes/outbox-routes.js +7 -4
  13. package/lib/api-routes/settings-routes.js +34 -25
  14. package/lib/api-routes/stats-routes.js +8 -1
  15. package/lib/api-routes/submit-routes.js +2 -1
  16. package/lib/api-routes/template-routes.js +3 -2
  17. package/lib/bounce-detect.js +45 -0
  18. package/lib/consts.js +9 -3
  19. package/lib/egress-filter.js +39 -4
  20. package/lib/email-client/base-client.js +274 -24
  21. package/lib/email-client/gmail/gmail-api.js +15 -7
  22. package/lib/email-client/gmail-client.js +121 -64
  23. package/lib/email-client/imap/mailbox.js +18 -59
  24. package/lib/email-client/imap-client.js +53 -29
  25. package/lib/email-client/notification-handler.js +11 -2
  26. package/lib/email-client/outlook/graph-api.js +106 -90
  27. package/lib/email-client/outlook-client.js +222 -106
  28. package/lib/generate-text-preview.js +10 -5
  29. package/lib/headers-rewriter.js +1 -1
  30. package/lib/llm-pre-process.js +4 -1
  31. package/lib/mcp/json-schema.js +50 -2
  32. package/lib/outbox.js +22 -5
  33. package/lib/passkeys.js +39 -7
  34. package/lib/pre-process.js +4 -1
  35. package/lib/rewrite-text-nodes.js +12 -1
  36. package/lib/schemas.js +27 -5
  37. package/lib/settings.js +19 -1
  38. package/lib/sso.js +60 -7
  39. package/lib/submit-progress.js +29 -0
  40. package/lib/templates.js +11 -0
  41. package/lib/tools.js +115 -53
  42. package/lib/ui-routes/account-routes.js +79 -12
  43. package/lib/ui-routes/admin-config-routes.js +7 -21
  44. package/lib/ui-routes/admin-entities-routes.js +42 -12
  45. package/lib/ui-routes/auth-routes.js +242 -87
  46. package/lib/ui-routes/dashboard-routes.js +1 -1
  47. package/lib/ui-routes/internals-routes.js +2 -0
  48. package/lib/ui-routes/mcp-consent-routes.js +5 -2
  49. package/lib/ui-routes/network-config-routes.js +12 -3
  50. package/lib/ui-routes/oauth-config-routes.js +12 -1
  51. package/lib/ui-routes/route-helpers.js +41 -6
  52. package/lib/ui-routes/settings-page.js +10 -0
  53. package/lib/ui-routes/suppression-list-routes.js +16 -5
  54. package/lib/ui-routes/unsubscribe-routes.js +22 -3
  55. package/lib/webhooks.js +14 -2
  56. package/package.json +17 -17
  57. package/sbom.json +1 -1
  58. package/server.js +63 -35
  59. package/static/css/flyonui.css +1 -1
  60. package/static/css/src/app.tailwind.css +55 -0
  61. package/static/js/app.js +4 -35
  62. package/static/js/passkey-register.js +50 -1
  63. package/static/js/public.js +128 -0
  64. package/static/js/ui.js +183 -6
  65. package/static/licenses.html +371 -770
  66. package/translations/messages.pot +66 -66
  67. package/views/account/passkeys.hbs +141 -0
  68. package/views/account/password.hbs +11 -0
  69. package/views/account/security.hbs +318 -326
  70. package/views/accounts/account.hbs +90 -115
  71. package/views/accounts/register/imap-server.hbs +18 -12
  72. package/views/config/ai.hbs +2 -0
  73. package/views/config/branding.hbs +2 -0
  74. package/views/config/document-store/index.hbs +6 -6
  75. package/views/config/email-processing.hbs +2 -0
  76. package/views/config/imap-proxy.hbs +2 -0
  77. package/views/config/license.hbs +4 -1
  78. package/views/config/logging.hbs +3 -1
  79. package/views/config/mcp.hbs +2 -0
  80. package/views/config/network.hbs +2 -0
  81. package/views/config/oauth/app.hbs +3 -3
  82. package/views/config/oauth/edit.hbs +1 -1
  83. package/views/config/oauth/new.hbs +1 -1
  84. package/views/config/security.hbs +2 -0
  85. package/views/config/service.hbs +2 -0
  86. package/views/config/smtp.hbs +2 -0
  87. package/views/config/webhooks.hbs +9 -6
  88. package/views/error.hbs +6 -0
  89. package/views/layout/app.hbs +6 -3
  90. package/views/layout/login.hbs +1 -1
  91. package/views/layout/prompt.hbs +1 -1
  92. package/views/layout/public.hbs +1 -1
  93. package/views/legal.hbs +1 -1
  94. package/views/partials/filter_editor_js.hbs +1 -1
  95. package/views/partials/gateway_js.hbs +7 -6
  96. package/views/partials/oauth_form.hbs +5 -5
  97. package/views/partials/ui/btn.hbs +8 -2
  98. package/views/partials/ui/confirm-modal.hbs +2 -3
  99. package/views/partials/ui/empty-state.hbs +25 -0
  100. package/views/partials/ui/env-managed-alert.hbs +19 -0
  101. package/views/partials/webhook_form.hbs +1 -1
  102. package/views/partials/webhooks_editor_functions.hbs +5 -5
  103. package/views/unsubscribe.hbs +6 -0
  104. package/workers/api.js +193 -81
  105. package/workers/imap.js +32 -3
  106. package/workers/smtp.js +7 -0
  107. package/workers/submit.js +25 -1
  108. package/workers/webhooks.js +13 -17
  109. package/lib/reconnection-manager.js +0 -106
@@ -36,16 +36,13 @@
36
36
  but init() checks the disable flag before it dials out and returns without
37
37
  connecting, so the click would report success and do nothing. --}}
38
38
  {{#> ui/tooltip text=(when accountParked "Syncing is switched off - use Resume syncing instead" "Close and re-open the connection")}}
39
- {{!-- pointer-events-none so the tooltip above still explains why: browsers dispatch no
40
- mouse events for a disabled control, so without it the wrapper never sees the hover --}}
41
- <button type="button" class="btn btn-soft btn-sm{{#if accountParked}} pointer-events-none{{/if}}" id="request-reconnect"{{#if accountParked}} disabled{{/if}}>
42
- <span class="icon-[tabler--refresh] size-4" id="reconnect-icon"></span> Reconnect
43
- </button>
39
+ {{> ui/btn label="Reconnect" bare=true style="soft" size="sm" icon="icon-[tabler--refresh]"
40
+ id="request-reconnect" disabled=accountParked}}
44
41
  {{/ui/tooltip}}
45
42
 
46
43
  {{#> ui/tooltip text="Run periodic folder syncing now"}}
47
44
  <button type="button" class="btn btn-soft btn-sm" id="request-sync">
48
- <span class="icon-[tabler--rotate-clockwise] size-4" id="sync-icon"></span> Run sync
45
+ <span class="icon-[tabler--rotate-clockwise] size-4"></span> Run sync
49
46
  </button>
50
47
  {{/ui/tooltip}}
51
48
 
@@ -121,7 +118,16 @@
121
118
  </button>
122
119
  <ul class="dropdown-menu dropdown-open:opacity-100 hidden min-w-56" role="menu"
123
120
  aria-orientation="vertical" aria-labelledby="logs-info">
124
- <li><a class="dropdown-item" href="/admin/accounts/{{urlpart account.account}}/logs.txt" download>Download stored logs</a></li>
121
+ {{!-- Downloading or clearing an empty log is a no-op dressed as work, so both
122
+ entries below render inert. This line says why: an inert entry is out of hit
123
+ testing, so it cannot carry a tooltip of its own --}}
124
+ <li id="no-stored-logs" class="{{#if hasStoredLogs}}hidden{{/if}}"><span
125
+ class="text-base-content/60 block px-4 py-2 text-sm">No stored logs for this account</span>
126
+ </li>
127
+ <li>
128
+ <a id="download-logs" class="dropdown-item{{#unless hasStoredLogs}} dropdown-disabled{{/unless}}"
129
+ {{#if hasStoredLogs}}href="/admin/accounts/{{urlpart account.account}}/logs.txt" download{{else}}aria-disabled="true"{{/if}}>Download stored logs</a>
130
+ </li>
125
131
  <li>
126
132
  <div class="divider my-1"></div>
127
133
  </li>
@@ -129,7 +135,8 @@
129
135
  <li><span class="text-base-content/60 block px-4 py-2 text-sm">Logging is enabled for all accounts</span></li>
130
136
  {{else}}
131
137
  <li><a class="dropdown-item" href="#" id="toggle-logs">{{#if account.logs}}Disable logging{{else}}Enable logging{{/if}}</a></li>
132
- <li><a class="dropdown-item" href="#" id="flush-logs">Clear stored logs</a></li>
138
+ <li><a id="flush-logs" class="dropdown-item{{#unless hasStoredLogs}} dropdown-disabled{{/unless}}"
139
+ {{#if hasStoredLogs}}href="#"{{else}}aria-disabled="true"{{/if}}>Clear stored logs</a></li>
133
140
  {{/if}}
134
141
  </ul>
135
142
  </div>
@@ -273,7 +280,7 @@
273
280
 
274
281
  {{#if account.oauth2.generatedStr}}
275
282
  <span class="local-date-time code-link" data-time="{{account.oauth2.generatedStr}}"
276
- title="{{account.oauth2.generatedStr}}"></span> &mdash;
283
+ title="{{account.oauth2.generatedStr}}"></span> -
277
284
  {{else}}
278
285
  To
279
286
  {{/if}}
@@ -931,7 +938,7 @@ submitLabel="Delete account"}}
931
938
  <span class="icon-[tabler--trash] size-4"></span> Reset
932
939
  </button>
933
940
  <button type="button" class="btn btn-primary" id="export-start-btn">
934
- <span class="icon-[tabler--file-export] size-4" id="export-start-icon"></span> Start Export
941
+ <span class="icon-[tabler--file-export] size-4"></span> Start Export
935
942
  </button>
936
943
  </div>
937
944
  {{/ui/modal}}
@@ -952,29 +959,14 @@ submitLabel="Delete account"}}
952
959
  return data;
953
960
  }
954
961
 
955
- let reconnecting = false;
956
962
  const requestReconnectElm = document.getElementById('request-reconnect');
957
963
  requestReconnectElm.addEventListener('click', e => {
958
964
  e.preventDefault();
959
- if (requestReconnectElm.classList.contains('disabled')) {
960
- return;
961
- }
962
-
963
- if (reconnecting) {
964
- return
965
- }
966
-
967
- reconnecting = true;
968
- document.getElementById('reconnect-icon').classList.add('animate-spin');
969
- reconnectAccount().then(data => {
970
- document.getElementById('reconnect-icon').classList.remove('animate-spin');
971
- reconnecting = false;
972
- showToast(data.error ? data.error : (data.success ? 'Account reconnection requested' : 'Failed to request reconnect'), data.success ? 'check-circle' : 'alert-triangle');
973
- }).catch(err => {
974
- document.getElementById('reconnect-icon').classList.remove('animate-spin');
975
- reconnecting = false;
976
- showToast('Request failed\n' + err.message, 'alert-triangle');
977
- })
965
+ // Busy for the round trip: the request goes to a worker that has to reach the mail
966
+ // server, and the busy button is what stops a second one being asked for meanwhile.
967
+ uiBusyAction(requestReconnectElm, () =>
968
+ reconnectAccount().then(data => uiToastResult(data, 'Account reconnection requested', 'Failed to request reconnect'))
969
+ );
978
970
  });
979
971
 
980
972
  // Only rendered for an account the auth-failure safety net switched off
@@ -1016,29 +1008,12 @@ submitLabel="Delete account"}}
1016
1008
  return data;
1017
1009
  }
1018
1010
 
1019
- let syncing = false;
1020
1011
  const requestSyncElm = document.getElementById('request-sync');
1021
1012
  requestSyncElm.addEventListener('click', e => {
1022
1013
  e.preventDefault();
1023
- if (requestSyncElm.classList.contains('disabled')) {
1024
- return;
1025
- }
1026
-
1027
- if (syncing) {
1028
- return
1029
- }
1030
-
1031
- syncing = true;
1032
- document.getElementById('sync-icon').classList.add('animate-spin');
1033
- syncAccount().then(data => {
1034
- document.getElementById('sync-icon').classList.remove('animate-spin');
1035
- syncing = false;
1036
- showToast(data.error ? data.error : (data.success ? 'Account sync requested' : 'Failed to request syncing'), data.success ? 'check-circle' : 'alert-triangle');
1037
- }).catch(err => {
1038
- document.getElementById('sync-icon').classList.remove('animate-spin');
1039
- syncing = false;
1040
- showToast('Request failed\n' + err.message, 'alert-triangle');
1041
- })
1014
+ uiBusyAction(requestSyncElm, () =>
1015
+ syncAccount().then(data => uiToastResult(data, 'Account sync requested', 'Failed to request syncing'))
1016
+ );
1042
1017
  });
1043
1018
 
1044
1019
  const toggleLogs = async () => {
@@ -1062,47 +1037,41 @@ submitLabel="Delete account"}}
1062
1037
  return data;
1063
1038
  }
1064
1039
 
1065
- let togglingLogs = false;
1066
1040
  // #toggle-logs / #flush-logs only render when the global "log all accounts"
1067
1041
  // setting is off - guard so the rest of this block still gets wired
1068
- document.getElementById('toggle-logs')?.addEventListener('click', e => {
1042
+ const toggleLogsElm = document.getElementById('toggle-logs');
1043
+ toggleLogsElm?.addEventListener('click', e => {
1069
1044
  e.preventDefault();
1070
- if (togglingLogs) {
1071
- return
1072
- }
1073
- togglingLogs = true;
1074
-
1075
- toggleLogs().then(data => {
1076
- togglingLogs = false;
1077
- showToast(data.error ? data.error : (data.success ? 'Logging settings updated' : 'Failed to request reconnect'), data.success ? 'check-circle' : 'alert-triangle');
1078
- }).catch(err => {
1079
- togglingLogs = false;
1080
- showToast('Request failed\n' + err.message, 'alert-triangle');
1081
- })
1045
+ uiBusyAction(toggleLogsElm, () =>
1046
+ toggleLogs().then(data => uiToastResult(data, 'Logging settings updated', 'Failed to update logging settings'))
1047
+ );
1082
1048
  });
1083
1049
 
1084
- const flushLogs = async () => {
1085
- const account = document.getElementById('account-id').value.trim();
1050
+ const downloadLogsElm = document.getElementById('download-logs');
1051
+ const flushLogsElm = document.getElementById('flush-logs');
1086
1052
 
1087
- const data = await uiPostJson(`/admin/accounts/${account}/logs-flush`);
1088
- return data;
1053
+ // The client-side mirror of hasStoredLogs = false: nothing left to download or to clear,
1054
+ // and the note carries the reason that an entry out of hit testing cannot show itself
1055
+ const markLogsEmpty = () => {
1056
+ for (const elm of [downloadLogsElm, flushLogsElm]) {
1057
+ elm.classList.add('dropdown-disabled');
1058
+ elm.removeAttribute('href');
1059
+ elm.setAttribute('aria-disabled', 'true');
1060
+ }
1061
+ document.getElementById('no-stored-logs').classList.remove('hidden');
1089
1062
  }
1090
1063
 
1091
- let flushingLogs = false;
1092
- document.getElementById('flush-logs')?.addEventListener('click', e => {
1064
+ flushLogsElm?.addEventListener('click', e => {
1093
1065
  e.preventDefault();
1094
- if (flushingLogs) {
1095
- return
1096
- }
1097
- flushingLogs = true;
1098
-
1099
- flushLogs().then(data => {
1100
- flushingLogs = false;
1101
- showToast(data.error ? data.error : (data.success ? 'Stored logs were flushed' : 'Failed to flush logs'), data.success ? 'check-circle' : 'alert-triangle');
1102
- }).catch(err => {
1103
- flushingLogs = false;
1104
- showToast('Request failed\n' + err.message, 'alert-triangle');
1105
- })
1066
+ const account = document.getElementById('account-id').value.trim();
1067
+ uiBusyAction(flushLogsElm, () =>
1068
+ uiPostJson(`/admin/accounts/${account}/logs-flush`).then(data => {
1069
+ if (data.success) {
1070
+ markLogsEmpty();
1071
+ }
1072
+ uiToastResult(data, 'Stored logs were flushed', 'Failed to flush logs');
1073
+ })
1074
+ );
1106
1075
  });
1107
1076
 
1108
1077
  // Export status indicator on page load
@@ -1318,7 +1287,8 @@ submitLabel="Delete account"}}
1318
1287
  updateExportIndicator();
1319
1288
  });
1320
1289
 
1321
- document.getElementById('export-start-btn').addEventListener('click', async function () {
1290
+ const exportStartBtn = document.getElementById('export-start-btn');
1291
+ exportStartBtn.addEventListener('click', () => {
1322
1292
  const account = document.getElementById('account-id').value.trim();
1323
1293
  const startDate = document.getElementById('export-start-date').value;
1324
1294
  const endDate = document.getElementById('export-end-date').value;
@@ -1329,39 +1299,39 @@ submitLabel="Delete account"}}
1329
1299
  return;
1330
1300
  }
1331
1301
 
1332
- document.getElementById('export-start-icon').classList.add('animate-spin');
1333
-
1334
- try {
1335
- const data = await uiPostJson(`/admin/accounts/${account}/export`, {
1336
- startDate: startDate + 'T00:00:00Z',
1337
- endDate: endDate + 'T23:59:59Z',
1338
- includeAttachments
1339
- });
1340
- if (data.exportId) {
1341
- currentExportId = data.exportId;
1342
- showStatusView();
1343
- // Reset progress display state
1344
- document.getElementById('export-progress-section').classList.remove('hidden');
1345
- document.getElementById('export-error-section').classList.add('hidden');
1346
- document.getElementById('export-download-section').classList.add('hidden');
1347
- document.getElementById('export-phase-badge').classList.add('hidden');
1348
- const progressBar = document.getElementById('export-progress-bar');
1349
- progressBar.classList.remove('bg-success');
1350
- progressBar.classList.add('bg-info');
1351
- progressBar.style.width = '0%';
1352
- progressBar.setAttribute('aria-valuenow', 0);
1353
- document.getElementById('export-progress-text').textContent = '';
1354
- await updateExportStatus();
1355
- startPolling();
1356
- showToast('Export started', 'check-circle');
1357
- } else {
1358
- showToast(data.error || data.message || 'Failed to start export', 'alert-triangle');
1302
+ // Every call mints its own exportId and starts a full mailbox walk, so a second click
1303
+ // would run two exports and leave the first one with nothing pointing at it.
1304
+ uiBusyAction(exportStartBtn, async () => {
1305
+ try {
1306
+ const data = await uiPostJson(`/admin/accounts/${account}/export`, {
1307
+ startDate: startDate + 'T00:00:00Z',
1308
+ endDate: endDate + 'T23:59:59Z',
1309
+ includeAttachments
1310
+ });
1311
+ if (data.exportId) {
1312
+ currentExportId = data.exportId;
1313
+ showStatusView();
1314
+ // Reset progress display state
1315
+ document.getElementById('export-progress-section').classList.remove('hidden');
1316
+ document.getElementById('export-error-section').classList.add('hidden');
1317
+ document.getElementById('export-download-section').classList.add('hidden');
1318
+ document.getElementById('export-phase-badge').classList.add('hidden');
1319
+ const progressBar = document.getElementById('export-progress-bar');
1320
+ progressBar.classList.remove('bg-success');
1321
+ progressBar.classList.add('bg-info');
1322
+ progressBar.style.width = '0%';
1323
+ progressBar.setAttribute('aria-valuenow', 0);
1324
+ document.getElementById('export-progress-text').textContent = '';
1325
+ await updateExportStatus();
1326
+ startPolling();
1327
+ showToast('Export started', 'check-circle');
1328
+ } else {
1329
+ showToast(data.error || data.message || 'Failed to start export', 'alert-triangle');
1330
+ }
1331
+ } catch (err) {
1332
+ showToast('Export failed: ' + err.message, 'alert-triangle');
1359
1333
  }
1360
- } catch (err) {
1361
- showToast('Export failed: ' + err.message, 'alert-triangle');
1362
- } finally {
1363
- document.getElementById('export-start-icon').classList.remove('animate-spin');
1364
- }
1334
+ });
1365
1335
  });
1366
1336
 
1367
1337
  document.getElementById('export-reset-btn').addEventListener('click', async function () {
@@ -1479,6 +1449,11 @@ submitLabel="Delete account"}}
1479
1449
  uiModal.open('#testSendModal');
1480
1450
 
1481
1451
  createSmtpTestAccount(testData.account, testData.gateway).then((result) => {
1452
+ if (result.error) {
1453
+ // the route answers 200 with { error } when the account could not be loaded or
1454
+ // the probe could not be queued - polling with no user would only report "Not Found"
1455
+ throw new Error(result.error);
1456
+ }
1482
1457
  return waitForTestResults(result.user);
1483
1458
  }).then(results => {
1484
1459
  document.getElementById('test-send-pending-message').classList.add('hidden');
@@ -17,6 +17,14 @@ dropdown allows skipping the test. --}}
17
17
 
18
18
  <input type="hidden" id="tz" name="tz" value="{{values.tz}}">
19
19
 
20
+ {{#if autodetectFailed}}
21
+ <div class="ee-alert ee-alert-info">
22
+ <span class="ee-icon ee-icon-alert-circle"></span>
23
+ <span>{{_ "Server settings could not be detected automatically for %s. Enter them below." templateLocale
24
+ (escapeHtml autodetectDomain) }}</span>
25
+ </div>
26
+ {{/if}}
27
+
20
28
  <div class="ee-form-grid">
21
29
  <div class="ee-form-col">
22
30
  <h6>{{_ "IMAP" templateLocale }}</h6>
@@ -295,14 +303,12 @@ focus ring on) the corner close button --}}
295
303
  let submitDownElm = document.getElementById('submit-settings-btn-down')
296
304
  let errorsListElm = document.getElementById('test-errors-list')
297
305
 
298
- // Cosmetic only: greys out the real submit <button> while a submit is in flight (the dropdown
299
- // toggle is a <summary> and the skip link an <a>, neither has disabled semantics). The actual
300
- // duplicate-submit guard is the formSubmitting latch in submitForm(), which every path routes
301
- // through.
302
- let setSubmitButtonsDisabled = (disabled) => {
303
- submitElm.disabled = disabled;
304
- };
305
-
306
+ // eeButtonBusy() below is feedback only: it greys the real submit <button> out and spins its
307
+ // icon while a submit is in flight, so the wait for the account to be created is visible (the
308
+ // dropdown toggle is a <summary> and the skip link an <a>, neither has disabled semantics).
309
+ // The actual duplicate-submit guard is the formSubmitting latch in submitForm(), which every
310
+ // path routes through - this form submits through myForm.submit(), which fires no submit
311
+ // event, so the shared guard in static/js/public.js never sees it.
306
312
  let formSubmitting = false;
307
313
  let submitRecoveryTimer = null;
308
314
  let resetSubmitGuard = () => {
@@ -311,7 +317,7 @@ focus ring on) the corner close button --}}
311
317
  clearTimeout(submitRecoveryTimer);
312
318
  submitRecoveryTimer = null;
313
319
  }
314
- setSubmitButtonsDisabled(false);
320
+ eeButtonBusy(submitElm, false);
315
321
  };
316
322
  let submitForm = () => {
317
323
  // The server claims a single-use nonce, so a second POST from a double-click loses the race and
@@ -327,7 +333,7 @@ focus ring on) the corner close button --}}
327
333
  return;
328
334
  }
329
335
  formSubmitting = true;
330
- setSubmitButtonsDisabled(true);
336
+ eeButtonBusy(submitElm, true);
331
337
  // Recovery timer for an aborted submit: a successful submit navigates away (this page and the
332
338
  // timer are discarded) and a validation error reloads the page fresh, so this only fires when the
333
339
  // navigation never happened - the user cancelled it (Esc / Stop) while the page stayed alive. There
@@ -550,8 +556,8 @@ focus ring on) the corner close button --}}
550
556
  // enable TLS checkbox
551
557
  document.getElementById(`${proto}_secure`).checked = true;
552
558
  }
553
- if (portNr === 110) {
554
- // enable TLS checkbox
559
+ if (portNr === 143) {
560
+ // plaintext IMAP port (STARTTLS), so clear the TLS checkbox
555
561
  document.getElementById(`${proto}_secure`).checked = false;
556
562
  }
557
563
  break;
@@ -4,6 +4,8 @@
4
4
  content to OpenAI and adds the AI response to your webhooks.
5
5
  </p>
6
6
 
7
+ {{> ui/env-managed-alert}}
8
+
7
9
  <form method="post" id="settings-form" action="/admin/config/ai">
8
10
  {{!-- no id: the layout already renders the #crumb element the script reads --}}
9
11
  <input type="hidden" name="crumb" value="{{crumb}}" />
@@ -2,6 +2,8 @@
2
2
 
3
3
  <p class="mb-6">Customize public pages like authentication forms, error pages, and unsubscribe pages.</p>
4
4
 
5
+ {{> ui/env-managed-alert}}
6
+
5
7
  <form method="post" id="settings-form" action="/admin/config/branding">
6
8
  {{!-- no id: the layout already renders the #crumb element the script reads --}}
7
9
  <input type="hidden" name="crumb" value="{{crumb}}" />
@@ -135,13 +135,13 @@
135
135
  return data;
136
136
  }
137
137
 
138
- document.getElementById('test-payload-btn').addEventListener('click', e => {
138
+ const testPayloadBtn = document.getElementById('test-payload-btn');
139
+ testPayloadBtn.addEventListener('click', e => {
139
140
  e.preventDefault()
140
- sendTestPayload().then(data => {
141
- showToast(data.error ? data.error : (data.success ? data.message || 'Connection successful' : 'Failed to establish connection'), data.success ? 'check-circle' : 'alert-triangle');
142
- }).catch(err => {
143
- showToast('Request failed\n' + err.message, 'alert-triangle');
144
- })
141
+ // Busy until Elasticsearch answers, rather than looking unpressed and being clicked again.
142
+ uiBusyAction(testPayloadBtn, () =>
143
+ sendTestPayload().then(data => uiToastResult(data, data.message || 'Connection successful', 'Failed to establish connection'))
144
+ );
145
145
  });
146
146
  })
147
147
  </script>
@@ -2,6 +2,8 @@
2
2
 
3
3
  <p class="mb-6">Control how EmailEngine delivers, indexes, and tracks email messages.</p>
4
4
 
5
+ {{> ui/env-managed-alert}}
6
+
5
7
  <form method="post" action="/admin/config/email-processing">
6
8
  {{!-- no id: the layout already renders the #crumb element the script reads --}}
7
9
  <input type="hidden" name="crumb" value="{{crumb}}" />
@@ -15,6 +15,8 @@
15
15
 
16
16
  <p class="mb-6">Configure your IMAP proxy server below.</p>
17
17
 
18
+ {{> ui/env-managed-alert}}
19
+
18
20
  <form method="post" action="/admin/config/imap-proxy">
19
21
  {{!-- no id: the layout already renders the #crumb element the script reads --}}
20
22
  <input type="hidden" name="crumb" value="{{crumb}}" />
@@ -133,7 +133,10 @@ Remove the current license key from this EmailEngine instance?
133
133
  licenseFileTxt = (licenseFileTxt || '').toString().trim().substring(0, 10 * 1024)
134
134
  licenseTextElm.value = licenseFileTxt;
135
135
  if (licenseFileTxt.indexOf('BEGIN LICENSE') >= 0) {
136
- document.getElementById('licenseForm').submit();
136
+ // requestSubmit(), not submit(): this posts to the license server like the
137
+ // Activate button does, and only requestSubmit fires the submit event the
138
+ // busy/double-submit guard in static/js/ui.js listens for.
139
+ document.getElementById('licenseForm').requestSubmit();
137
140
  } else {
138
141
  licenseTextElm.focus();
139
142
  licenseTextElm.select();
@@ -5,6 +5,8 @@
5
5
  activity (credentials and message content are never logged). Download logs anytime for troubleshooting.
6
6
  </p>
7
7
 
8
+ {{> ui/env-managed-alert}}
9
+
8
10
  <form method="post" action="/admin/config/logging">
9
11
  {{!-- no id: the layout already renders the #crumb element scripts read --}}
10
12
  <input type="hidden" name="crumb" value="{{crumb}}" />
@@ -14,7 +16,7 @@
14
16
  {{> ui/setting-ref name="logs.all"}}
15
17
  {{> ui/checkbox id="settingsLogsAll" name="all" label="Enable Logging for All Accounts"
16
18
  checked=values.all error=errors.all}}
17
- <span class="helper-text">Turn on logging for every connected account. Use with caution-this can impact
19
+ <span class="helper-text">Turn on logging for every connected account. Use with caution, this can impact
18
20
  performance with many accounts.<br>
19
21
  <strong>Restart required</strong> after changing this setting.</span>
20
22
  </div>
@@ -33,6 +33,8 @@
33
33
 
34
34
  <div id="mcp-settings" role="tabpanel" aria-labelledby="mcp-settings-tab">
35
35
 
36
+ {{> ui/env-managed-alert}}
37
+
36
38
  <form method="post" action="/admin/config/mcp">
37
39
  {{!-- no id: the layout already renders the #crumb element scripts read --}}
38
40
  <input type="hidden" name="crumb" value="{{crumb}}" />
@@ -2,6 +2,8 @@
2
2
 
3
3
  <p class="mb-6">Control how EmailEngine connects to email servers and routes traffic.</p>
4
4
 
5
+ {{> ui/env-managed-alert}}
6
+
5
7
  <form method="post" action="/admin/config/network">
6
8
  {{!-- no id: the layout already renders the #crumb element the script reads --}}
7
9
  <input type="hidden" name="crumb" value="{{crumb}}" />
@@ -88,7 +88,7 @@
88
88
 
89
89
  {{#if app.cloudData}}
90
90
  <dt>Cloud environment</dt>
91
- <dd>{{app.cloudData.name}} <em>&mdash;
91
+ <dd>{{app.cloudData.name}} <em>-
92
92
  {{app.cloudData.description}}</em></dd>
93
93
  {{/if}}
94
94
 
@@ -170,7 +170,7 @@
170
170
  {{#if app.pubSubAppData}}
171
171
  <a href="/admin/config/oauth/app/{{app.pubSubAppData.id}}"
172
172
  class="link link-animated">{{app.pubSubAppData.name}}{{#if
173
- app.pubSubAppData.description}} &mdash; <em>{{app.pubSubAppData.description}}</em>{{/if}}</a>
173
+ app.pubSubAppData.description}} - <em>{{app.pubSubAppData.description}}</em>{{/if}}</a>
174
174
  {{else}}
175
175
  <em>App set but not found</em>
176
176
  {{/if}}
@@ -288,7 +288,7 @@
288
288
 
289
289
 
290
290
  {{#> ui/confirm-modal id="deleteModal" title="Delete OAuth2 App" action="/admin/config/oauth/delete"
291
- fieldName="app" fieldValue=app.id submitLabel="Delete app" submitIcon="icon-[tabler--trash]" formClass="pending-form"}}
291
+ fieldName="app" fieldValue=app.id submitLabel="Delete app" submitIcon="icon-[tabler--trash]"}}
292
292
  <p>Are you sure you want to delete the OAuth2 application "{{app.name}}"? This action cannot be undone.</p>
293
293
  {{/ui/confirm-modal}}
294
294
 
@@ -13,7 +13,7 @@ appData.id) midLabel=appData.name current="Edit app" class="mt-6 mb-6"}}
13
13
  {{/if}}
14
14
  {{/unless}}{{/unless}}{{/unless}}
15
15
 
16
- <form method="post" action="/admin/config/oauth/edit" class="pending-form">
16
+ <form method="post" action="/admin/config/oauth/edit">
17
17
  <input type="hidden" name="crumb" value="{{crumb}}" />
18
18
  <input type="hidden" name="provider" value="{{appData.provider}}">
19
19
  <input type="hidden" name="app" value="{{appData.id}}">
@@ -13,7 +13,7 @@ providerData.comment " app") class="mt-6 mb-6"}}
13
13
  {{/if}}
14
14
  {{/unless}}{{/unless}}{{/unless}}
15
15
 
16
- <form method="post" action="/admin/config/oauth/new" class="pending-form">
16
+ <form method="post" action="/admin/config/oauth/new">
17
17
  <input type="hidden" name="crumb" value="{{crumb}}" />
18
18
  <input type="hidden" name="provider" value="{{values.provider}}">
19
19
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  <p class="mb-6">Control API authentication, secrets, and connection security for this EmailEngine instance.</p>
4
4
 
5
+ {{> ui/env-managed-alert}}
6
+
5
7
  <form method="post" action="/admin/config/security">
6
8
  {{!-- no id: the layout already renders the #crumb element the script reads --}}
7
9
  <input type="hidden" name="crumb" value="{{crumb}}" />
@@ -2,6 +2,8 @@
2
2
 
3
3
  <p class="mb-6">Configure core settings for your EmailEngine instance.</p>
4
4
 
5
+ {{> ui/env-managed-alert}}
6
+
5
7
  <form method="post" action="/admin/config/service">
6
8
  {{!-- no id: the layout already renders the #crumb element the script reads --}}
7
9
  <input type="hidden" name="crumb" value="{{crumb}}" />
@@ -9,6 +9,8 @@
9
9
  interface supports legacy systems that require traditional email sending.</p>
10
10
  <p class="mb-6">Configure your SMTP server settings below.</p>
11
11
 
12
+ {{> ui/env-managed-alert}}
13
+
12
14
  <form method="post" action="/admin/config/smtp">
13
15
  {{!-- no id: the layout already renders the #crumb element the script reads --}}
14
16
  <input type="hidden" name="crumb" value="{{crumb}}" />
@@ -27,6 +27,8 @@ class="mb-1"}}
27
27
  {{/if}}
28
28
  {{/if}}
29
29
 
30
+ {{> ui/env-managed-alert}}
31
+
30
32
  <form method="post" id="settings-form" action="/admin/config/webhooks">
31
33
  {{!-- no id: the layout already renders the #crumb element the script reads --}}
32
34
  <input type="hidden" name="crumb" value="{{crumb}}" />
@@ -282,13 +284,14 @@ class="mb-1"}}
282
284
  return data;
283
285
  }
284
286
 
285
- document.getElementById('test-payload-btn').addEventListener('click', e => {
287
+ const testPayloadBtn = document.getElementById('test-payload-btn');
288
+ testPayloadBtn.addEventListener('click', e => {
286
289
  e.preventDefault()
287
- sendTestPayload().then(data => {
288
- uiToastResult(data, 'Test payload sent', 'Failed to send payload');
289
- }).catch(err => {
290
- showToast('Request failed\n' + err.message, 'alert-triangle');
291
- })
290
+ // The delivery waits for the configured URL to answer; a second click would send a
291
+ // second payload.
292
+ uiBusyAction(testPayloadBtn, () =>
293
+ sendTestPayload().then(data => uiToastResult(data, 'Test payload sent', 'Failed to send payload'))
294
+ );
292
295
  });
293
296
 
294
297
  const editors = new Map();
package/views/error.hbs CHANGED
@@ -17,9 +17,15 @@ pages, blocked access, failed form submissions without a friendlier page). --}}
17
17
  <a href="javascript:history.back()" class="ee-btn ee-btn-neutral ee-btn-soft ee-btn-sm">
18
18
  <span class="ee-icon ee-icon-arrow-left"></span> {{_ "Go back" templateLocale}}
19
19
  </a>
20
+ {{!-- The dashboard is an admin destination. A mailbox owner on the hosted form or a
21
+ list recipient on an unsubscribe link has no business there, so the button only
22
+ shows for a requester who holds an admin session, or on an instance that has no
23
+ admin login at all (showDashboardLink, set by the view context in workers/api.js). --}}
24
+ {{#if showDashboardLink}}
20
25
  <a href="/admin" class="ee-btn ee-btn-primary ee-btn-sm">
21
26
  <span class="ee-icon ee-icon-home"></span> {{_ "Dashboard" templateLocale}}
22
27
  </a>
28
+ {{/if}}
23
29
  </div>
24
30
  </div>
25
31
  <div class="ee-error-card-icon">