emailengine-app 2.79.7 → 2.79.9

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 (188) hide show
  1. package/.github/dependabot.yml +22 -0
  2. package/.github/workflows/test.yml +39 -0
  3. package/.release-please-manifest.json +1 -1
  4. package/CHANGELOG.md +37 -0
  5. package/DOCKER_DEPLOYMENT.md +8 -7
  6. package/Dockerfile +35 -11
  7. package/bin/emailengine.js +29 -13
  8. package/config/default.toml +15 -4
  9. package/copy-static-files.sh +23 -5
  10. package/data/google-crawlers.json +7 -1
  11. package/docker-compose.yml +12 -3
  12. package/install.sh +2 -0
  13. package/lib/account.js +26 -1
  14. package/lib/api-routes/account-routes.js +14 -3
  15. package/lib/api-routes/bull-board-routes.js +3 -2
  16. package/lib/api-routes/mailbox-routes.js +4 -1
  17. package/lib/api-routes/message-routes.js +6 -5
  18. package/lib/api-routes/outbox-routes.js +7 -4
  19. package/lib/api-routes/route-helpers.js +8 -0
  20. package/lib/api-routes/settings-routes.js +34 -25
  21. package/lib/api-routes/stats-routes.js +8 -1
  22. package/lib/api-routes/submit-routes.js +2 -1
  23. package/lib/api-routes/template-routes.js +3 -2
  24. package/lib/auth-token.js +73 -2
  25. package/lib/autodetect-imap-settings.js +33 -25
  26. package/lib/bounce-detect.js +45 -0
  27. package/lib/consts.js +13 -2
  28. package/lib/egress-fetch.js +133 -0
  29. package/lib/egress-filter.js +39 -4
  30. package/lib/email-client/base-client.js +274 -24
  31. package/lib/email-client/gmail/gmail-api.js +15 -7
  32. package/lib/email-client/gmail-client.js +121 -64
  33. package/lib/email-client/imap/mailbox.js +18 -59
  34. package/lib/email-client/imap-client.js +53 -29
  35. package/lib/email-client/notification-handler.js +11 -2
  36. package/lib/email-client/outlook/graph-api.js +106 -90
  37. package/lib/email-client/outlook-client.js +222 -106
  38. package/lib/export.js +35 -2
  39. package/lib/generate-text-preview.js +10 -5
  40. package/lib/handlebars-helpers.js +129 -0
  41. package/lib/headers-rewriter.js +1 -1
  42. package/lib/imap-proxy-auth.js +41 -21
  43. package/lib/imapproxy/imap-core/README.md +1 -0
  44. package/lib/imapproxy/imap-core/lib/tls-options.js +5 -46
  45. package/lib/imapproxy/imap-server.js +9 -10
  46. package/lib/llm-pre-process.js +4 -1
  47. package/lib/mcp/json-schema.js +50 -2
  48. package/lib/openapi/index.js +3 -0
  49. package/lib/outbox.js +50 -8
  50. package/lib/pre-process.js +4 -1
  51. package/lib/rate-limit.js +23 -4
  52. package/lib/rewrite-text-nodes.js +12 -1
  53. package/lib/schemas.js +37 -8
  54. package/lib/security-headers.js +396 -0
  55. package/lib/sentry.js +36 -4
  56. package/lib/settings.js +19 -1
  57. package/lib/smtp-auth.js +86 -7
  58. package/lib/sso.js +13 -3
  59. package/lib/submit-progress.js +29 -0
  60. package/lib/templates.js +11 -0
  61. package/lib/tools.js +361 -173
  62. package/lib/ui-routes/account-routes.js +73 -13
  63. package/lib/ui-routes/admin-config-routes.js +7 -21
  64. package/lib/ui-routes/admin-entities-routes.js +42 -12
  65. package/lib/ui-routes/auth-routes.js +87 -28
  66. package/lib/ui-routes/dashboard-routes.js +1 -1
  67. package/lib/ui-routes/export-routes.js +4 -0
  68. package/lib/ui-routes/internals-routes.js +2 -0
  69. package/lib/ui-routes/mcp-consent-routes.js +12 -2
  70. package/lib/ui-routes/network-config-routes.js +6 -5
  71. package/lib/ui-routes/oauth-config-routes.js +12 -1
  72. package/lib/ui-routes/route-helpers.js +65 -14
  73. package/lib/ui-routes/settings-page.js +10 -0
  74. package/lib/ui-routes/smtp-test-routes.js +7 -0
  75. package/lib/ui-routes/suppression-list-routes.js +16 -5
  76. package/lib/ui-routes/unsubscribe-routes.js +22 -3
  77. package/lib/webhook-egress.js +5 -0
  78. package/lib/webhooks.js +14 -2
  79. package/package.json +23 -26
  80. package/sbom.json +1 -1
  81. package/server.js +100 -71
  82. package/static/css/flyonui.css +1 -1
  83. package/static/js/ace/css/ace.css +1462 -0
  84. package/static/js/ace/css/kuroir-1.png +0 -0
  85. package/static/js/ace/css/kuroir-2.png +0 -0
  86. package/static/js/ace/css/main-1.png +0 -0
  87. package/static/js/ace/css/main-10.svg +4 -0
  88. package/static/js/ace/css/main-11.svg +5 -0
  89. package/static/js/ace/css/main-12.svg +4 -0
  90. package/static/js/ace/css/main-13.png +0 -0
  91. package/static/js/ace/css/main-14.png +0 -0
  92. package/static/js/ace/css/main-15.png +0 -0
  93. package/static/js/ace/css/main-16.png +0 -0
  94. package/static/js/ace/css/main-17.png +0 -0
  95. package/static/js/ace/css/main-18.png +0 -0
  96. package/static/js/ace/css/main-19.png +0 -0
  97. package/static/js/ace/css/main-2.png +0 -0
  98. package/static/js/ace/css/main-20.png +0 -0
  99. package/static/js/ace/css/main-21.png +0 -0
  100. package/static/js/ace/css/main-22.png +0 -0
  101. package/static/js/ace/css/main-23.png +0 -0
  102. package/static/js/ace/css/main-24.png +0 -0
  103. package/static/js/ace/css/main-25.svg +1 -0
  104. package/static/js/ace/css/main-26.png +0 -0
  105. package/static/js/ace/css/main-3.png +0 -0
  106. package/static/js/ace/css/main-4.png +0 -0
  107. package/static/js/ace/css/main-5.svg +7 -0
  108. package/static/js/ace/css/main-6.svg +9 -0
  109. package/static/js/ace/css/main-7.svg +7 -0
  110. package/static/js/ace/css/main-8.svg +9 -0
  111. package/static/js/ace/css/main-9.svg +6 -0
  112. package/static/js/ace/css/theme/kuroir.css +78 -0
  113. package/static/js/ace/css/theme/tomorrow_night.css +128 -0
  114. package/static/js/ace/css/theme/tomorrow_night_eighties.css +128 -0
  115. package/static/js/ace/css/theme/xcode.css +106 -0
  116. package/static/js/ace/css/tomorrow_night-1.png +0 -0
  117. package/static/js/ace/css/tomorrow_night-2.png +0 -0
  118. package/static/js/ace/css/tomorrow_night_eighties-1.png +0 -0
  119. package/static/js/ace/css/tomorrow_night_eighties-2.png +0 -0
  120. package/static/js/ace/css/xcode-1.png +0 -0
  121. package/static/js/ace/css/xcode-2.png +0 -0
  122. package/static/js/ee-client.js +256 -102
  123. package/static/js/public.js +7 -0
  124. package/static/js/ui.js +32 -0
  125. package/static/licenses.html +338 -298
  126. package/static/vendor/simplewebauthn/browser.min.js +2 -2
  127. package/translations/messages.pot +158 -112
  128. package/views/account/passkeys.hbs +8 -0
  129. package/views/account/password.hbs +11 -0
  130. package/views/account/security.hbs +18 -7
  131. package/views/accounts/account.hbs +21 -38
  132. package/views/accounts/browse.hbs +3 -1
  133. package/views/accounts/edit.hbs +1 -1
  134. package/views/accounts/register/imap-server.hbs +11 -3
  135. package/views/config/ai.hbs +3 -1
  136. package/views/config/branding.hbs +4 -2
  137. package/views/config/document-store/chat.hbs +1 -1
  138. package/views/config/document-store/index.hbs +1 -1
  139. package/views/config/email-processing.hbs +2 -0
  140. package/views/config/imap-proxy.hbs +3 -1
  141. package/views/config/license.hbs +1 -1
  142. package/views/config/logging.hbs +3 -1
  143. package/views/config/mcp.hbs +3 -1
  144. package/views/config/network.hbs +16 -16
  145. package/views/config/oauth/app.hbs +4 -4
  146. package/views/config/security.hbs +2 -0
  147. package/views/config/service.hbs +3 -1
  148. package/views/config/smtp.hbs +3 -1
  149. package/views/config/webhooks.hbs +4 -2
  150. package/views/error.hbs +10 -2
  151. package/views/internals/index.hbs +1 -1
  152. package/views/layout/app.hbs +9 -14
  153. package/views/layout/login.hbs +1 -1
  154. package/views/layout/prompt.hbs +1 -1
  155. package/views/layout/public.hbs +1 -1
  156. package/views/legal.hbs +1 -1
  157. package/views/mcp/authorize.hbs +1 -1
  158. package/views/partials/ace_assets.hbs +13 -0
  159. package/views/partials/add_account_modal.hbs +1 -1
  160. package/views/partials/address_list.hbs +4 -4
  161. package/views/partials/filter_editor_js.hbs +3 -3
  162. package/views/partials/gateway_js.hbs +1 -1
  163. package/views/partials/oauth_form.hbs +6 -6
  164. package/views/partials/public_theme_init.hbs +1 -1
  165. package/views/partials/template_form.hbs +2 -2
  166. package/views/partials/test_send.hbs +7 -4
  167. package/views/partials/theme_init.hbs +1 -1
  168. package/views/partials/ui/details.hbs +2 -2
  169. package/views/partials/ui/env-managed-alert.hbs +19 -0
  170. package/views/partials/webhook_form.hbs +1 -1
  171. package/views/partials/webhooks_editor_functions.hbs +1 -1
  172. package/views/reference/redirect.hbs +1 -1
  173. package/views/templates/template.hbs +2 -2
  174. package/views/tokens/new.hbs +1 -1
  175. package/views/unsubscribe.hbs +7 -1
  176. package/views/webhooks/webhook.hbs +2 -2
  177. package/workers/api.js +179 -175
  178. package/workers/export.js +1 -5
  179. package/workers/imap.js +33 -6
  180. package/workers/smtp.js +19 -43
  181. package/workers/submit.js +31 -13
  182. package/workers/webhooks.js +9 -24
  183. package/lib/reconnection-manager.js +0 -106
  184. package/static/front/EmailEngine_logo_horiz.png +0 -0
  185. package/static/front/EmailEngine_logo_vert.png +0 -0
  186. package/static/front/index.html +0 -57
  187. package/static/front/logo.png +0 -0
  188. package/static/vendor/handlebars/handlebars.min-v4.7.9.js +0 -29
@@ -280,13 +280,18 @@
280
280
 
281
281
  {{#if account.oauth2.generatedStr}}
282
282
  <span class="local-date-time code-link" data-time="{{account.oauth2.generatedStr}}"
283
- title="{{account.oauth2.generatedStr}}"></span> &mdash;
283
+ title="{{account.oauth2.generatedStr}}"></span> -
284
284
  {{else}}
285
285
  To
286
286
  {{/if}}
287
287
 
288
+ {{#if account.oauth2.accessTokenInvalidated}}
289
+ {{!-- the expiry was rewound to force a renewal, so the stored end is meaningless --}}
290
+ invalidated, a new token is requested on the next connection
291
+ {{else}}
288
292
  <span class="local-date-time code-link" data-time="{{account.oauth2.expiresStr}}"
289
293
  title="{{account.oauth2.expiresStr}}"></span>
294
+ {{/if}}
290
295
  </dd>
291
296
  {{/if}}
292
297
 
@@ -946,7 +951,7 @@ submitLabel="Delete account"}}
946
951
  {{!-- no #crumb input: the layout already renders the element the script reads --}}
947
952
  <input type="hidden" id="account-id" value="{{account.account}}">
948
953
 
949
- <script>
954
+ <script nonce="{{cspNonce}}">
950
955
  document.addEventListener('DOMContentLoaded', () => {
951
956
 
952
957
  const reconnectAccount = async () => {
@@ -1340,11 +1345,14 @@ submitLabel="Delete account"}}
1340
1345
  const account = document.getElementById('account-id').value.trim();
1341
1346
 
1342
1347
  try {
1343
- await fetch(`/admin/accounts/${account}/export/${currentExportId}`, {
1348
+ // the crumb travels in the header: the route validates DELETE in restful mode
1349
+ const res = await fetch(`/admin/accounts/${account}/export/${currentExportId}`, {
1344
1350
  method: 'DELETE',
1345
- headers: { 'Content-Type': 'application/json' },
1346
- body: JSON.stringify({ crumb: document.getElementById('crumb').value })
1351
+ headers: { 'X-CSRF-Token': document.getElementById('crumb').value }
1347
1352
  });
1353
+ if (!res.ok) {
1354
+ throw new Error(`HTTP ${res.status}`);
1355
+ }
1348
1356
 
1349
1357
  stopPolling();
1350
1358
  currentExportId = null;
@@ -1357,39 +1365,8 @@ submitLabel="Delete account"}}
1357
1365
  });
1358
1366
  </script>
1359
1367
 
1360
- <script id="test-send-template" type="text/x-handlebars-template">{{{testSendTemplate}}}</script>
1361
-
1362
- <script>
1368
+ <script nonce="{{cspNonce}}">
1363
1369
  document.addEventListener('DOMContentLoaded', () => {
1364
- Handlebars.registerHelper('equals', function (compareVal, baseVal, options) {
1365
- if (baseVal == compareVal) {
1366
- return options.fn(this);
1367
- }
1368
- return options.inverse(this);
1369
- });
1370
-
1371
- Handlebars.registerHelper('inc', function (nr, inc, options) {
1372
- return Number(nr) + Number(inc);
1373
- });
1374
-
1375
- // status -> FlyonUI color/icon maps for the delivery-test results template
1376
- const STATUS_COLORS = { pass: 'success', softfail: 'warning', fail: 'error', permerror: 'info', temperror: 'info' };
1377
- Handlebars.registerHelper('statusColor', result => STATUS_COLORS[result] || 'neutral');
1378
-
1379
- Handlebars.registerHelper('statusIcon', result => {
1380
- switch (result) {
1381
- case 'pass':
1382
- return 'icon-[tabler--circle-check]';
1383
- case 'neutral':
1384
- case 'none':
1385
- return 'icon-[tabler--circle-off]';
1386
- default:
1387
- return 'icon-[tabler--alert-triangle]';
1388
- }
1389
- });
1390
-
1391
- const testSendTemplate = Handlebars.compile(document.getElementById('test-send-template').innerHTML);
1392
-
1393
1370
  let aborted = false;
1394
1371
 
1395
1372
  const createSmtpTestAccount = async (account, gateway) => {
@@ -1449,6 +1426,11 @@ submitLabel="Delete account"}}
1449
1426
  uiModal.open('#testSendModal');
1450
1427
 
1451
1428
  createSmtpTestAccount(testData.account, testData.gateway).then((result) => {
1429
+ if (result.error) {
1430
+ // the route answers 200 with { error } when the account could not be loaded or
1431
+ // the probe could not be queued - polling with no user would only report "Not Found"
1432
+ throw new Error(result.error);
1433
+ }
1452
1434
  return waitForTestResults(result.user);
1453
1435
  }).then(results => {
1454
1436
  document.getElementById('test-send-pending-message').classList.add('hidden');
@@ -1457,7 +1439,8 @@ submitLabel="Delete account"}}
1457
1439
  return false
1458
1440
  }
1459
1441
  document.getElementById('test-send-results').classList.remove('hidden');
1460
- document.getElementById('test-send-results').innerHTML = testSendTemplate(results);
1442
+ // rendered server-side by /admin/smtp/check-test from views/partials/test_send.hbs
1443
+ document.getElementById('test-send-results').innerHTML = results.html;
1461
1444
  }).catch(err => {
1462
1445
  if (aborted) {
1463
1446
  return false
@@ -26,7 +26,7 @@
26
26
  </div>
27
27
  {{/ui/modal}}
28
28
 
29
- <script type="module">
29
+ <script type="module" nonce="{{cspNonce}}">
30
30
  import { EmailEngineClient } from '/static/js/ee-client.js';
31
31
 
32
32
  // Create client with UI container. The embed follows the admin theme -
@@ -36,6 +36,8 @@
36
36
  apiUrl: window.location.origin,
37
37
  account: '{{account}}',
38
38
  accessToken: '{{sessionToken}}',
39
+ // the widget appends its own stylesheet element; the admin policy accepts it with this nonce
40
+ styleNonce: '{{cspNonce}}',
39
41
  container: document.getElementById('email-client'),
40
42
  darkMode: uiEffectiveTheme() === 'dark',
41
43
  showDarkModeToggle: false,
@@ -140,7 +140,7 @@
140
140
 
141
141
  <input type="hidden" id="availablePaths" value="{{availablePaths}}">
142
142
 
143
- <script>
143
+ <script nonce="{{cspNonce}}">
144
144
  document.addEventListener('DOMContentLoaded', () => {
145
145
  let availablePaths = JSON.parse(document.getElementById('availablePaths').value);
146
146
  // native datalist suggestions for the Sent Mail folder input (the
@@ -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>
@@ -282,7 +290,7 @@ focus ring on) the corner close button --}}
282
290
 
283
291
  <input type="hidden" id="autoTest" value="{{#if autoTest}}true{{/if}}">
284
292
 
285
- <script>
293
+ <script nonce="{{cspNonce}}">
286
294
  document.addEventListener('DOMContentLoaded', () => {
287
295
 
288
296
  let formTested = false;
@@ -548,8 +556,8 @@ focus ring on) the corner close button --}}
548
556
  // enable TLS checkbox
549
557
  document.getElementById(`${proto}_secure`).checked = true;
550
558
  }
551
- if (portNr === 110) {
552
- // enable TLS checkbox
559
+ if (portNr === 143) {
560
+ // plaintext IMAP port (STARTTLS), so clear the TLS checkbox
553
561
  document.getElementById(`${proto}_secure`).checked = false;
554
562
  }
555
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}}" />
@@ -309,7 +311,7 @@ defaultTestPayload='{"account":"test","path":"INBOX","subject":"test email"}'}}
309
311
 
310
312
  <input type="hidden" id="defaultPromptJson" value="{{defaultPromptJson}}">
311
313
 
312
- <script>
314
+ <script nonce="{{cspNonce}}">
313
315
  document.addEventListener('DOMContentLoaded', () => {
314
316
 
315
317
  const editorPrompt = uiAceEditor("editor-prompt", "markdown", document.getElementById('openAiPromptElement').value, {
@@ -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}}" />
@@ -76,10 +78,10 @@
76
78
  </form>
77
79
 
78
80
 
79
- <script src="/static/js/ace/ace.js"></script>
81
+ {{> ace_assets}}
80
82
  <script src="/static/js/ace/ext-language_tools.js"></script>
81
83
 
82
- <script>
84
+ <script nonce="{{cspNonce}}">
83
85
  document.addEventListener('DOMContentLoaded', () => {
84
86
 
85
87
  const editors = new Map();
@@ -171,7 +171,7 @@
171
171
  </form>
172
172
  {{/ui/modal}}
173
173
 
174
- <script>
174
+ <script nonce="{{cspNonce}}">
175
175
  document.addEventListener('DOMContentLoaded', () => {
176
176
 
177
177
  const sendQuestionPayload = async () => {
@@ -116,7 +116,7 @@
116
116
 
117
117
  </form>
118
118
 
119
- <script>
119
+ <script nonce="{{cspNonce}}">
120
120
  document.addEventListener('DOMContentLoaded', () => {
121
121
 
122
122
  const sendTestPayload = async () => {
@@ -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}}" />
@@ -138,7 +140,7 @@
138
140
 
139
141
  <input type="hidden" id="availableAddresses" value="{{availableAddresses}}">
140
142
 
141
- <script>
143
+ <script nonce="{{cspNonce}}">
142
144
  document.addEventListener('DOMContentLoaded', () => {
143
145
 
144
146
  let availableAddresses = document.getElementById('availableAddresses').value.split(',').map(e => e.trim()).filter(e => e);
@@ -122,7 +122,7 @@ submitLabel="Remove License"}}
122
122
  Remove the current license key from this EmailEngine instance?
123
123
  {{/ui/confirm-modal}}
124
124
 
125
- <script>
125
+ <script nonce="{{cspNonce}}">
126
126
  document.addEventListener('DOMContentLoaded', () => {
127
127
  let licenseTextElm = document.getElementById('licenseTextElement')
128
128
  let fileSelectElm = document.getElementById('licenseFile');
@@ -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}}" />
@@ -289,7 +291,7 @@
289
291
 
290
292
  </div>
291
293
 
292
- <script>
294
+ <script nonce="{{cspNonce}}">
293
295
  (() => {
294
296
  let container = document.getElementById('mcpTokenGen');
295
297
  let presets = JSON.parse(container.dataset.presets || '{}');
@@ -2,18 +2,22 @@
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}}" />
8
10
 
9
11
  {{#> ui/card title="Proxy Settings" bodyClass="space-y-4"}}
10
- <p>Route all email server connections through a proxy. Supports HTTP CONNECT, SOCKS4, and SOCKS5.</p>
12
+ <p>Route all outbound connections through a proxy: IMAP and SMTP sessions, Gmail API and Microsoft
13
+ Graph requests, OAuth2 token exchange, webhook delivery, and EmailEngine's own requests such as
14
+ license validation. Supports HTTP CONNECT, SOCKS4, and SOCKS5.</p>
11
15
 
12
16
  <div>
13
17
  {{> ui/setting-ref name="proxyEnabled"}}
14
18
  {{> ui/checkbox id="proxy_enabled" name="proxyEnabled" label="Enable Global Proxy" class="proxy-status"
15
19
  checked=values.proxyEnabled error=errors.proxyEnabled
16
- hint="Routes all connections through the proxy below. Individual accounts can override this setting."}}
20
+ hint="Routes all outbound connections through the proxy below. Individual accounts can override it for their IMAP and SMTP connections."}}
17
21
  </div>
18
22
 
19
23
  <div>
@@ -41,14 +45,15 @@
41
45
  {{/ui/card}}
42
46
 
43
47
  {{#> ui/card title="HTTP Proxy Settings" bodyClass="space-y-4"}}
44
- <p>Route all outbound HTTP/HTTPS requests through a proxy. This applies to webhook delivery, OAuth token
45
- exchange, and API calls to Gmail/Outlook. This is separate from the IMAP/SMTP proxy above.</p>
48
+ <p>Optional. Use a different proxy for HTTP/HTTPS requests only: webhook delivery, OAuth2 token exchange,
49
+ Gmail API and Microsoft Graph calls, and license validation. When disabled, these requests use the
50
+ global proxy above.</p>
46
51
 
47
52
  <div>
48
53
  {{> ui/setting-ref name="httpProxyEnabled"}}
49
54
  {{> ui/checkbox id="http_proxy_enabled" name="httpProxyEnabled" label="Enable HTTP Proxy"
50
55
  class="http-proxy-status" checked=values.httpProxyEnabled error=errors.httpProxyEnabled
51
- hint="Routes all outbound HTTP/HTTPS requests through the proxy below."}}
56
+ hint="Routes outbound HTTP/HTTPS requests through the proxy below instead of the global proxy."}}
52
57
  </div>
53
58
 
54
59
  <div>
@@ -179,11 +184,7 @@ Remove this IP from the list? It will be re-added if found during the next scan.
179
184
  {{/ui/confirm-modal}}
180
185
 
181
186
 
182
- <script id="address-list-template" type="text/x-handlebars-template">
183
- {{{addressListTemplate}}}
184
- </script>
185
-
186
- <script>
187
+ <script nonce="{{cspNonce}}">
187
188
  document.addEventListener('DOMContentLoaded', () => {
188
189
  let reloadBtn = document.getElementById('reload-btn');
189
190
 
@@ -221,10 +222,9 @@ Remove this IP from the list? It will be re-added if found during the next scan.
221
222
 
222
223
  checkCheckboxes()
223
224
 
224
- const addressListTemplate = Handlebars.compile(document.getElementById('address-list-template').innerHTML);
225
-
226
- let redrawAddressList = data => {
227
- let html = addressListTemplate(data);
225
+ let redrawAddressList = html => {
226
+ // rendered server-side by /admin/config/network/reload from the same
227
+ // address_list partial as the initial page
228
228
  document.getElementById('address-list').innerHTML = html;
229
229
 
230
230
  for (let elm of document.querySelectorAll('#address-list .checkbox-entry')) {
@@ -248,8 +248,8 @@ Remove this IP from the list? It will be re-added if found during the next scan.
248
248
  return;
249
249
  }
250
250
 
251
- if (data.addresses) {
252
- redrawAddressList(data);
251
+ if (data.html) {
252
+ redrawAddressList(data.html);
253
253
  }
254
254
 
255
255
  }).catch(err => {
@@ -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}}
@@ -355,7 +355,7 @@ fieldName="app" fieldValue=app.id submitLabel="Delete app" submitIcon="icon-[tab
355
355
  </form>
356
356
  {{/ui/modal}}
357
357
 
358
- <script>
358
+ <script nonce="{{cspNonce}}">
359
359
  document.addEventListener('DOMContentLoaded', () => {
360
360
  document.getElementById('addServiceAccountModal').addEventListener('open.overlay', () => {
361
361
  document.getElementById('service-account-name').focus();
@@ -364,7 +364,7 @@ fieldName="app" fieldValue=app.id submitLabel="Delete app" submitIcon="icon-[tab
364
364
  </script>
365
365
  {{/if}}
366
366
 
367
- <script>
367
+ <script nonce="{{cspNonce}}">
368
368
  document.addEventListener('DOMContentLoaded', () => {
369
369
  const appId = "{{app.id}}";
370
370
  const stepsElm = document.getElementById('verify-steps');
@@ -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}}" />
@@ -121,7 +123,7 @@
121
123
 
122
124
  </form>
123
125
 
124
- <script>
126
+ <script nonce="{{cspNonce}}">
125
127
  document.addEventListener('DOMContentLoaded', () => {
126
128
 
127
129
  const sendCleanPayload = async () => {
@@ -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}}" />
@@ -142,7 +144,7 @@
142
144
 
143
145
  <input type="hidden" id="availableAddresses" value="{{availableAddresses}}">
144
146
 
145
- <script>
147
+ <script nonce="{{cspNonce}}">
146
148
  document.addEventListener('DOMContentLoaded', () => {
147
149
 
148
150
  let availableAddresses = document.getElementById('availableAddresses').value.split(',').map(e => e.trim()).filter(e => e);
@@ -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}}" />
@@ -264,10 +266,10 @@ class="mb-1"}}
264
266
 
265
267
  </form>
266
268
 
267
- <script src="/static/js/ace/ace.js"></script>
269
+ {{> ace_assets}}
268
270
  <script src="/static/js/ace/ext-language_tools.js"></script>
269
271
 
270
- <script>
272
+ <script nonce="{{cspNonce}}">
271
273
  document.addEventListener('DOMContentLoaded', () => {
272
274
 
273
275
  const sendTestPayload = async () => {
package/views/error.hbs CHANGED
@@ -14,12 +14,20 @@ pages, blocked access, failed form submissions without a friendlier page). --}}
14
14
  </div>
15
15
  {{/if}}
16
16
  <div class="ee-form-actions">
17
- <a href="javascript:history.back()" class="ee-btn ee-btn-neutral ee-btn-soft ee-btn-sm">
17
+ {{!-- A button rather than a javascript: link: the Content-Security-Policy on the admin
18
+ surface allows no javascript: URLs; static/js/public.js wires data-ee-back --}}
19
+ <button type="button" data-ee-back class="ee-btn ee-btn-neutral ee-btn-soft ee-btn-sm">
18
20
  <span class="ee-icon ee-icon-arrow-left"></span> {{_ "Go back" templateLocale}}
19
- </a>
21
+ </button>
22
+ {{!-- The dashboard is an admin destination. A mailbox owner on the hosted form or a
23
+ list recipient on an unsubscribe link has no business there, so the button only
24
+ shows for a requester who holds an admin session, or on an instance that has no
25
+ admin login at all (showDashboardLink, set by the view context in workers/api.js). --}}
26
+ {{#if showDashboardLink}}
20
27
  <a href="/admin" class="ee-btn ee-btn-primary ee-btn-sm">
21
28
  <span class="ee-icon ee-icon-home"></span> {{_ "Dashboard" templateLocale}}
22
29
  </a>
30
+ {{/if}}
23
31
  </div>
24
32
  </div>
25
33
  <div class="ee-error-card-icon">
@@ -163,7 +163,7 @@ submitLabel="Download Snapshot" submitVariant="info"}}
163
163
  Generate a memory snapshot for debugging? This may briefly affect thread performance.
164
164
  {{/ui/confirm-modal}}
165
165
 
166
- <script>
166
+ <script nonce="{{cspNonce}}">
167
167
  document.addEventListener('DOMContentLoaded', () => {
168
168
  for (let elm of document.querySelectorAll('.kill-thread-btn')) {
169
169
  elm.addEventListener('click', e => {
@@ -9,7 +9,7 @@
9
9
  <meta name="description" content="EmailEngine Application page; The Ultimate Email API for Developers" />
10
10
  <meta name="author" content="Postal Systems OÜ">
11
11
 
12
- <title>{{#if pageTitleFull}}{{pageTitleFull}}{{else}}{{pageBrandName}}{{#if pageTitle}} &ndash;
12
+ <title>{{#if pageTitleFull}}{{pageTitleFull}}{{else}}{{pageBrandName}}{{#if pageTitle}} -
13
13
  {{pageTitle}}{{/if}}{{/if}}</title>
14
14
 
15
15
  {{> head_assets}}
@@ -53,7 +53,10 @@
53
53
 
54
54
  <!-- Topbar -->
55
55
  <header class="bg-base-100 border-base-content/20 sticky top-0 z-30 border-b">
56
- <nav class="navbar flex items-center gap-2 px-6 py-2">
56
+ {{!-- flex-wrap: on phones the search form drops to a full-width second row (see its
57
+ max-sm classes) instead of disappearing, so the account search and the state
58
+ filter stay reachable without a redesign of the bar --}}
59
+ <nav class="navbar flex flex-wrap items-center gap-2 px-6 py-2">
57
60
 
58
61
  <button type="button" class="btn btn-text btn-circle btn-sm lg:hidden" aria-haspopup="dialog"
59
62
  aria-expanded="false" aria-controls="layout-sidebar" data-overlay="#layout-sidebar"
@@ -63,7 +66,7 @@
63
66
 
64
67
  {{#if searchTarget}}
65
68
  <!-- Topbar search -->
66
- <form class="hidden sm:flex items-center gap-2 grow max-w-xl" method="get" action="{{searchTarget}}">
69
+ <form class="flex items-center gap-2 grow max-w-xl max-sm:order-last max-sm:w-full max-sm:max-w-none" method="get" action="{{searchTarget}}">
67
70
 
68
71
  {{#if stateOptions}}
69
72
  <div class="dropdown relative inline-flex shrink-0">
@@ -140,13 +143,7 @@
140
143
  <span class="bg-{{eeColor level}}/10 text-{{eeColor level}} flex size-8 shrink-0 items-center justify-center rounded-field">
141
144
  <span class="{{icon}} size-4 shrink-0"></span>
142
145
  </span>
143
- <span class="text-sm whitespace-normal">
144
- {{#if verbatim}}
145
- {{{message}}}
146
- {{else}}
147
- {{message}}
148
- {{/if}}
149
- </span>
146
+ <span class="text-sm whitespace-normal">{{message}}</span>
150
147
  </a>
151
148
  </li>
152
149
  {{/each}}
@@ -340,8 +337,6 @@
340
337
  <script src="/static/js/flyonui.js"></script>
341
338
  <script src="/static/js/ui.js"></script>
342
339
 
343
- <script src="/static/vendor/handlebars/handlebars.min-v4.7.9.js"></script>
344
-
345
340
  <script src="/static/js/highlight.min.js"></script>
346
341
 
347
342
  <script src="/static/js/app.js"></script>
@@ -357,7 +352,7 @@
357
352
  Provisioning a trial license, please wait <span class="loading loading-spinner loading-sm align-middle"></span>
358
353
  </div>
359
354
  {{/ui/modal}}
360
- <script>
355
+ <script nonce="{{cspNonce}}">
361
356
  document.addEventListener('DOMContentLoaded', () => {
362
357
  let trialBtn = document.getElementById('start-trial-btn');
363
358
  if (!trialBtn) {
@@ -397,7 +392,7 @@
397
392
 
398
393
  {{#if updateBrowserInfo}}
399
394
  <input type="hidden" id="browser-info-crumb" value="{{crumb}}" />
400
- <script>
395
+ <script nonce="{{cspNonce}}">
401
396
  document.addEventListener('DOMContentLoaded', () => {
402
397
  let sendBrowserInfo = async () => {
403
398
  let timezone = false;
@@ -9,7 +9,7 @@
9
9
  <meta name="description" content="EmailEngine Application page; The Ultimate Email API for Developers" />
10
10
  <meta name="author" content="Postal Systems OÜ">
11
11
 
12
- <title>{{#if pageTitleFull}}{{pageTitleFull}}{{else}}{{pageBrandName}}{{#if pageTitle}} &ndash;
12
+ <title>{{#if pageTitleFull}}{{pageTitleFull}}{{else}}{{pageBrandName}}{{#if pageTitle}} -
13
13
  {{pageTitle}}{{/if}}{{/if}}</title>
14
14
 
15
15
  {{> head_assets}}
@@ -9,7 +9,7 @@
9
9
  <meta name="description" content="EmailEngine Application page; The Ultimate Email API for Developers" />
10
10
  <meta name="author" content="Postal Systems OÜ">
11
11
 
12
- <title>{{#if pageTitleFull}}{{pageTitleFull}}{{else}}{{pageBrandName}}{{#if pageTitle}} &ndash;
12
+ <title>{{#if pageTitleFull}}{{pageTitleFull}}{{else}}{{pageBrandName}}{{#if pageTitle}} -
13
13
  {{pageTitle}}{{/if}}{{/if}}</title>
14
14
 
15
15
  {{> head_assets}}
@@ -9,7 +9,7 @@
9
9
  <meta name="description" content="EmailEngine Application page; The Ultimate Email API for Developers" />
10
10
  <meta name="author" content="Postal Systems OÜ">
11
11
 
12
- <title>{{#if pageTitleFull}}{{pageTitleFull}}{{else}}{{pageBrandName}}{{#if pageTitle}} &ndash;
12
+ <title>{{#if pageTitleFull}}{{pageTitleFull}}{{else}}{{pageBrandName}}{{#if pageTitle}} -
13
13
  {{pageTitle}}{{/if}}{{/if}}</title>
14
14
 
15
15
  <link rel="apple-touch-icon" href="/static/favicon/apple-touch-icon.png" sizes="180x180" />
package/views/legal.hbs CHANGED
@@ -38,7 +38,7 @@
38
38
 
39
39
 
40
40
  </strong>
41
- &mdash; <a class="link link-animated" href="/admin/config/license">View license details</a>
41
+ - <a class="link link-animated" href="/admin/config/license">View license details</a>
42
42
  </li>
43
43
 
44
44
  <li class="px-6 py-4">