emailengine-app 2.80.0 → 2.80.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +24 -0
  3. package/README.md +6 -0
  4. package/data/google-crawlers.json +1 -1
  5. package/lib/api-routes/account-routes.js +81 -1
  6. package/lib/api-routes/blocklist-routes.js +24 -0
  7. package/lib/api-routes/delivery-test-routes.js +6 -0
  8. package/lib/api-routes/gateway-routes.js +30 -0
  9. package/lib/api-routes/license-routes.js +10 -0
  10. package/lib/api-routes/mcp-oauth-routes.js +3 -3
  11. package/lib/api-routes/mcp-routes.js +39 -21
  12. package/lib/api-routes/oauth2-app-routes.js +38 -1
  13. package/lib/api-routes/outbox-routes.js +6 -0
  14. package/lib/api-routes/permission-map.js +208 -43
  15. package/lib/api-routes/pubsub-routes.js +8 -0
  16. package/lib/api-routes/route-helpers.js +58 -11
  17. package/lib/api-routes/settings-routes.js +50 -4
  18. package/lib/api-routes/stats-routes.js +6 -0
  19. package/lib/api-routes/template-routes.js +21 -0
  20. package/lib/api-routes/token-routes.js +34 -2
  21. package/lib/api-routes/webhook-route-routes.js +13 -0
  22. package/lib/email-client/base-client.js +6 -3
  23. package/lib/email-client/credential-errors.js +4 -0
  24. package/lib/email-client/imap/login-failure.js +52 -0
  25. package/lib/email-client/imap/subconnection.js +2 -1
  26. package/lib/email-client/imap-client.js +3 -6
  27. package/lib/enum-descriptions.js +12 -2
  28. package/lib/imapproxy/imap-server.js +1 -1
  29. package/lib/mcp/oauth.js +46 -8
  30. package/lib/mcp/protocol.js +78 -35
  31. package/lib/mcp/tools.js +53 -17
  32. package/lib/privileged-settings.js +147 -0
  33. package/lib/schemas.js +60 -16
  34. package/lib/settings.js +13 -0
  35. package/lib/tls/catalog.js +428 -0
  36. package/lib/tls/context.js +87 -161
  37. package/lib/tls/listeners.js +62 -0
  38. package/lib/tls/status.js +128 -79
  39. package/lib/tls/store.js +3 -2
  40. package/lib/token-permission-view.js +252 -102
  41. package/lib/token-permissions.js +176 -26
  42. package/lib/tokens.js +7 -6
  43. package/lib/tools.js +4 -3
  44. package/lib/ui-routes/admin-config-routes.js +41 -21
  45. package/lib/ui-routes/admin-entities-routes.js +23 -13
  46. package/lib/ui-routes/mcp-consent-routes.js +72 -31
  47. package/lib/ui-routes/tls-config-routes.js +121 -74
  48. package/package.json +12 -12
  49. package/sbom.json +1 -1
  50. package/server.js +7 -1
  51. package/static/css/flyonui.css +1 -1
  52. package/static/js/ui.js +89 -36
  53. package/static/licenses.html +46 -28
  54. package/translations/messages.pot +74 -68
  55. package/views/account/login-redirect.hbs +1 -1
  56. package/views/account/passkeys.hbs +2 -2
  57. package/views/accounts/account.hbs +2 -2
  58. package/views/accounts/browse.hbs +1 -1
  59. package/views/accounts/edit.hbs +1 -1
  60. package/views/accounts/register/imap-server.hbs +1 -1
  61. package/views/config/ai.hbs +1 -1
  62. package/views/config/branding.hbs +2 -2
  63. package/views/config/document-store/chat.hbs +1 -1
  64. package/views/config/document-store/index.hbs +1 -1
  65. package/views/config/imap-proxy.hbs +1 -1
  66. package/views/config/license.hbs +1 -1
  67. package/views/config/mcp.hbs +88 -52
  68. package/views/config/network.hbs +1 -1
  69. package/views/config/oauth/app.hbs +2 -2
  70. package/views/config/service.hbs +1 -1
  71. package/views/config/smtp.hbs +1 -1
  72. package/views/config/tls.hbs +266 -165
  73. package/views/config/webhooks.hbs +2 -2
  74. package/views/internals/index.hbs +1 -1
  75. package/views/layout/app.hbs +6 -6
  76. package/views/layout/login.hbs +5 -5
  77. package/views/layout/main.hbs +2 -2
  78. package/views/layout/prompt.hbs +3 -3
  79. package/views/layout/public.hbs +1 -1
  80. package/views/mcp/authorize.hbs +47 -45
  81. package/views/partials/ace_assets.hbs +1 -1
  82. package/views/partials/add_account_modal.hbs +1 -1
  83. package/views/partials/filter_editor_js.hbs +2 -2
  84. package/views/partials/gateway_js.hbs +1 -1
  85. package/views/partials/mcp_access_levels.hbs +16 -9
  86. package/views/partials/mcp_tool_count.hbs +15 -14
  87. package/views/partials/oauth_form.hbs +1 -1
  88. package/views/partials/public_theme_init.hbs +1 -1
  89. package/views/partials/template_form.hbs +1 -1
  90. package/views/partials/theme_init.hbs +1 -1
  91. package/views/partials/webhooks_editor_functions.hbs +1 -1
  92. package/views/reference/index.hbs +1 -1
  93. package/views/reference/redirect.hbs +1 -1
  94. package/views/reference/tag.hbs +1 -1
  95. package/views/reference/token.hbs +1 -1
  96. package/views/templates/template.hbs +1 -1
  97. package/views/tokens/new.hbs +175 -74
  98. package/views/unsubscribe.hbs +1 -1
  99. package/views/webhooks/webhook.hbs +1 -1
  100. package/workers/api.js +9 -8
  101. package/workers/smtp.js +1 -1
@@ -32,9 +32,9 @@ const { accountExists } = require('../account');
32
32
  const { accountPickerSelection, mcpToolGrants } = require('./route-helpers');
33
33
  const { failAction } = require('../tools');
34
34
  const { accountIdSchema } = require('../schemas');
35
- const { MCP_ACCESS_LEVELS, MCP_ACCESS_LEVEL_OPTIONS, MCP_GRANT_WORDING } = require('../token-permission-view');
35
+ const { MCP_SECTIONS, mcpGrantsFor, mcpLevelNames } = require('../token-permission-view');
36
36
  const { mcpFeatureEnabled } = require('../mcp');
37
- const { oauthOrigin, getClient, touchClient, createAuthorizationCode, isAcceptableResource } = require('../mcp/oauth');
37
+ const { oauthOrigin, getClient, touchClient, createAuthorizationCode, isAcceptableResource, normalizeScopes } = require('../mcp/oauth');
38
38
 
39
39
  // Both consent routes answer with a redirect to the OAuth client's registered redirect_uri,
40
40
  // often http://localhost for a native client, and Chrome checks the redirect target of a form
@@ -101,10 +101,14 @@ async function init(args) {
101
101
  // lookup exactly when there is a choice on the form to show back
102
102
  const selectedAccount = canProvision && values && values.account ? await accountPickerSelection(values.account, server.logger) : null;
103
103
 
104
- // Read-only unless the operator picked otherwise; a re-render after a validation error
105
- // keeps whatever they chose. The template compares this against each option itself
106
- // (the `equals` helper), so the level is one value rather than three booleans.
107
- const accessLevel = values && Object.hasOwn(MCP_ACCESS_LEVELS, values.access) ? values.access : 'read';
104
+ // Management at Observe and no mail access unless the request or the operator said
105
+ // otherwise; a re-render after a validation error keeps whatever they chose. One value per
106
+ // section, which the template compares against each level itself (the `equals` helper).
107
+ const selectedLevels = {};
108
+ for (const [key, section] of Object.entries(MCP_SECTIONS)) {
109
+ const posted = values && values[key];
110
+ selectedLevels[key] = mcpLevelNames(section).includes(posted) ? posted : section.defaultLevel;
111
+ }
108
112
 
109
113
  // From the registry the endpoint dispatches through, so the count under the radios cannot
110
114
  // describe a tool set that has since changed
@@ -118,21 +122,18 @@ async function init(args) {
118
122
  clientName: (client && client.client_name) || 'An MCP client',
119
123
  redirectHost: redirectHostOf(redirectUri),
120
124
 
121
- // What approving actually grants, in plain words, derived once at load from the
122
- // same tables the enforcement reads - hand-written prose here would drift the
123
- // first time the tool set changes
124
- grantWording: MCP_GRANT_WORDING,
125
-
126
- accessLevel,
127
- // The radio group itself renders through the shared mcp_access_levels partial
128
- accessOptions: MCP_ACCESS_LEVEL_OPTIONS,
125
+ // The two sections and their levels, with what approving each one actually grants
126
+ // in plain words, derived once at load from the same tables the enforcement reads -
127
+ // hand-written prose here would drift the first time the tool set changes. The
128
+ // radio groups render through the shared mcp_access_levels partial.
129
+ mcpSections: MCP_SECTIONS,
130
+ selectedLevels,
129
131
 
130
- // The tool count under the radios, through the shared mcp_tool_count partial. The
132
+ // The tool count under the sections, through the shared mcp_tool_count partial. The
131
133
  // grant sentences above it say what a level allows in the permission vocabulary;
132
134
  // this says which tools the client ends up holding, which is the thing the person
133
135
  // approving is actually being asked about.
134
136
  mcpTools,
135
- mcpAccessPresets: MCP_ACCESS_LEVELS,
136
137
 
137
138
  selectedAccount,
138
139
 
@@ -191,6 +192,22 @@ async function init(args) {
191
192
 
192
193
  await touchClient(client.client_id);
193
194
 
195
+ // The `scope` parameter is a hint for the starting position of the form, never a
196
+ // grant: a client asking for `mcp` is asking for mail access, so the mail section
197
+ // starts at its narrowest level; one asking only for `mcp` starts with no management
198
+ // access, since it did not ask for any. A request naming no scope starts where the
199
+ // page starts anyway, management at Observe and mail declined. The person still
200
+ // decides.
201
+ const requested = normalizeScopes(request.query.scope);
202
+ const hinted = {};
203
+ for (const [key, section] of Object.entries(MCP_SECTIONS)) {
204
+ if (requested.includes(section.scope)) {
205
+ hinted[key] = section.levels[0].value;
206
+ } else if (requested.length) {
207
+ hinted[key] = 'none';
208
+ }
209
+ }
210
+
194
211
  return renderConsent(h, {
195
212
  client,
196
213
  redirectUri: request.query.redirect_uri,
@@ -200,7 +217,8 @@ async function init(args) {
200
217
  redirect_uri: request.query.redirect_uri,
201
218
  state: request.query.state,
202
219
  code_challenge: request.query.code_challenge,
203
- resource: request.query.resource
220
+ resource: request.query.resource,
221
+ ...hinted
204
222
  }
205
223
  });
206
224
  },
@@ -281,12 +299,28 @@ async function init(args) {
281
299
  });
282
300
  }
283
301
 
284
- // Read-only is the default here exactly as it is on the admin generator, and for a
285
- // stronger reason: this flow issues credentials to the least controllable clients on
286
- // the least controllable devices. The radio always posts a value, so the schema
287
- // default only ever fires for a stale or hand-crafted POST - and defaulting that to
288
- // 'read' means an omitted field mints the narrowest token, not the widest.
289
- const access = request.payload.access;
302
+ // Management at Observe and no mail access are the defaults here exactly as they are
303
+ // on the admin generator, and for a stronger reason: this flow issues credentials to
304
+ // the least controllable clients on the least controllable devices. The radios always
305
+ // post a value, so the schema defaults only ever fire for a stale or hand-crafted POST
306
+ // - and they mint the narrowest useful token, not the widest.
307
+ const choice = {};
308
+ for (const key of Object.keys(MCP_SECTIONS)) {
309
+ choice[key] = request.payload[key];
310
+ }
311
+ const { scopes, permissions } = mcpGrantsFor(choice);
312
+
313
+ if (!scopes.length) {
314
+ // Every section declined is not a narrow token, it is no token: re-rendered with
315
+ // the reason rather than minting a credential that can do nothing
316
+ return renderConsent(h, {
317
+ client,
318
+ redirectUri: request.payload.redirect_uri,
319
+ canProvision: true,
320
+ values: request.payload,
321
+ errors: { access: 'Choose at least one kind of access, or deny the request.' }
322
+ });
323
+ }
290
324
 
291
325
  const code = await createAuthorizationCode({
292
326
  clientId: client.client_id,
@@ -294,7 +328,8 @@ async function init(args) {
294
328
  codeChallenge: request.payload.code_challenge,
295
329
  resource: request.payload.resource || null,
296
330
  account,
297
- permissions: MCP_ACCESS_LEVELS[access],
331
+ scopes,
332
+ permissions,
298
333
  description: `MCP: ${client.client_name || redirectHostOf(request.payload.redirect_uri)}${account ? ` (${account})` : ''}`
299
334
  });
300
335
 
@@ -303,7 +338,7 @@ async function init(args) {
303
338
  client: client.client_id,
304
339
  clientName: client.client_name,
305
340
  account,
306
- access
341
+ levels: choice
307
342
  });
308
343
 
309
344
  return redirectToClient(h, authRequest, { code });
@@ -324,12 +359,18 @@ async function init(args) {
324
359
  Object.assign({}, oauthParamsSchema, {
325
360
  decision: Joi.string().valid('approve', 'deny').required(),
326
361
  account: accountIdSchema.allow('').default(null),
327
- // The keys of MCP_ACCESS_LEVELS, defaulting to the narrowest: a payload
328
- // that names no level (a stale form, a hand-crafted POST) mints the
329
- // read-only token, never the wide one
330
- access: Joi.string()
331
- .valid(...Object.keys(MCP_ACCESS_LEVELS))
332
- .default('read')
362
+ // One field per section, validated against the levels the table has plus
363
+ // `none`, defaulting to the section's own default - the narrowest useful
364
+ // choice: a payload that names no level (a stale form, a hand-crafted POST)
365
+ // mints a management token that can only observe, and no mail access
366
+ ...Object.fromEntries(
367
+ Object.entries(MCP_SECTIONS).map(([key, section]) => [
368
+ key,
369
+ Joi.string()
370
+ .valid(...mcpLevelNames(section))
371
+ .default(section.defaultLevel)
372
+ ])
373
+ )
333
374
  })
334
375
  )
335
376
  }
@@ -7,10 +7,11 @@
7
7
  // it. There was nowhere to see what was installed, no way to upload a certificate, and no way to
8
8
  // find out why an order had failed.
9
9
  //
10
- // This page separates the three things that checkbox conflated: which names EmailEngine serves,
11
- // where the certificate for them comes from, and which listeners use TLS. The last of those stays
12
- // on the SMTP and IMAP proxy pages, because it is part of what those servers are; this page shows
13
- // it read-only alongside the certificate each listener is actually serving.
10
+ // This page separates the things that checkbox conflated: which names EmailEngine serves, where
11
+ // the certificate for them comes from, which certificate each listener presents by default, and
12
+ // which listeners use TLS. The last of those stays on the SMTP and IMAP proxy pages, because it is
13
+ // part of what those servers are; this page shows it read-only alongside the certificate each
14
+ // listener is actually serving.
14
15
  //
15
16
  // The page is status first: what each listener serves, then one row per hostname. Hostnames are
16
17
  // added and removed from that table and post immediately, the way every other list on the admin
@@ -35,12 +36,12 @@ const {
35
36
  deleteManualCertificate,
36
37
  deleteSelfSignedCertificate,
37
38
  getSelfSignedCertificate,
38
- normalizeHostname,
39
- LISTENER_TLS_SETTINGS,
40
- listenerTlsFrom
39
+ normalizeHostname
41
40
  } = require('../tls/store');
42
41
  const { buildCertificateStatus, listenerCertificateSummary, summarizeLabels, publicView, reportedListenerTls } = require('../tls/status');
43
42
  const { runPreflight, resolvePreflightProbe, clearProvisioningStatus } = require('../tls/provision');
43
+ const { LISTENERS, TLS_CERTIFICATE_SETTINGS, AUTO, MANUAL_ID, SELF_SIGNED_ID } = require('../tls/listeners');
44
+ const { requestedCertificate, isSelectable, listCertificates } = require('../tls/catalog');
44
45
 
45
46
  // Certificates and keys are pasted into a textarea. A generous ceiling that still refuses a file
46
47
  // upload dressed as a certificate: a full chain with a 4096 bit leaf is a few kilobytes.
@@ -290,6 +291,74 @@ Token: ${JSON.stringify(request.params.token)}`
290
291
  }
291
292
  });
292
293
 
294
+ // Which certificate each listener presents by default. One form for the three listeners,
295
+ // posted with a Save button rather than on change: a wrong default is what a client sees on
296
+ // its next handshake, and three dropdowns that each reload every listener the moment they are
297
+ // touched is three chances to do that by accident.
298
+ server.route({
299
+ method: 'POST',
300
+ path: '/admin/config/tls/listeners',
301
+ async handler(request, h) {
302
+ try {
303
+ // Checked against what exists rather than against the schema alone: the schema
304
+ // knows the shape of an id, not whether a certificate answers to it, and a
305
+ // listener told to present nothing would silently fall back to its automatic
306
+ // choice while the page showed the choice as saved
307
+ const values = await settings.getMulti('serviceUrl', 'tlsHostnames', ...TLS_CERTIFICATE_SETTINGS);
308
+ const catalog = await listCertificates({ certs: h.certs, hostnames: hostnamesFrom(values) });
309
+ const available = new Set(catalog.filter(isSelectable).map(entry => entry.id));
310
+
311
+ const changed = [];
312
+ for (const listener of LISTENERS) {
313
+ const requested = requestedCertificate(request.payload[listener.settingKey]);
314
+ if (requested !== AUTO && !available.has(requested)) {
315
+ throw new Error(`${listener.name}: the selected certificate (${requested}) is not available`);
316
+ }
317
+ const value = requested === AUTO ? null : requested;
318
+ if (tlsSettingChanged(listener.settingKey, values[listener.settingKey], value)) {
319
+ changed.push({ key: listener.settingKey, value });
320
+ }
321
+ }
322
+
323
+ for (const { key, value } of changed) {
324
+ await settings.set(key, value);
325
+ }
326
+
327
+ // The listeners resolve their default against these, so a change is what they
328
+ // should be presenting from now on. Left alone when nothing changed: a reload for
329
+ // a save that wrote the same values would only churn the secure contexts.
330
+ await maybeReloadTlsCertificates(
331
+ call,
332
+ request.logger,
333
+ changed.map(entry => entry.key),
334
+ { action: 'settings' }
335
+ );
336
+
337
+ await request.flash({ type: 'info', message: changed.length ? 'Updated which certificate each listener presents' : 'No changes to save' });
338
+ } catch (err) {
339
+ request.logger.error({ msg: 'Failed to update the listener default certificates', err });
340
+ await request.flash({ type: 'danger', message: err.message });
341
+ }
342
+
343
+ return h.redirect(TLS_PAGE);
344
+ },
345
+ options: {
346
+ validate: {
347
+ options: { stripUnknown: true, abortEarly: false, convert: true },
348
+
349
+ async failAction(request, h, err) {
350
+ request.logger.error({ msg: 'Failed to validate the listener default certificates', err });
351
+ await request.flash({ type: 'danger', message: 'The selected certificate is not a valid choice' });
352
+ return h.redirect(TLS_PAGE).takeover();
353
+ },
354
+
355
+ payload: Joi.object(
356
+ Object.assign({ crumb: Joi.string().max(1024) }, Object.fromEntries(TLS_CERTIFICATE_SETTINGS.map(key => [key, settingsSchema[key]])))
357
+ )
358
+ }
359
+ }
360
+ });
361
+
293
362
  server.route({
294
363
  method: 'GET',
295
364
  path: UPLOAD_PAGE,
@@ -425,13 +494,17 @@ Token: ${JSON.stringify(request.params.token)}`
425
494
  path: '/admin/config/tls/delete',
426
495
  async handler(request, h) {
427
496
  try {
497
+ // A listener that was told to present the removed certificate keeps the setting
498
+ // and presents its automatic choice, and the page says so under its dropdown: the
499
+ // same thing happens when the certificate goes away through the REST API, and one
500
+ // outcome for one event is worth more than a tidier setting on one of the paths
428
501
  switch (request.payload.certificate) {
429
- case 'manual':
502
+ case MANUAL_ID:
430
503
  await deleteManualCertificate();
431
504
  await request.flash({ type: 'info', message: 'Removed the uploaded certificate' });
432
505
  break;
433
506
 
434
- case 'self-signed':
507
+ case SELF_SIGNED_ID:
435
508
  await deleteSelfSignedCertificate();
436
509
  // Regenerated immediately rather than on the next handshake, so the
437
510
  // fingerprint the page shows after this is the one clients will see.
@@ -477,8 +550,8 @@ Token: ${JSON.stringify(request.params.token)}`
477
550
  }
478
551
 
479
552
  /**
480
- * The whole page model: the certificate for every configured name, the stored sources, and the
481
- * listeners with what each of them is serving right now.
553
+ * The whole page model: the certificate for every configured name, every certificate the instance
554
+ * holds, and the listeners with the default each is set to and what each is serving right now.
482
555
  *
483
556
  * A listener reports its own certificate in its state payload rather than having it inferred here.
484
557
  * Inferring it would describe what the listener would load if it started now, which is not the same
@@ -492,78 +565,52 @@ async function tlsPageContext(h) {
492
565
  const apiTls = h.apiTlsInfo();
493
566
 
494
567
  // Independent reads, so the page costs one round of latency rather than three.
495
- const listenerReads = Promise.all([getServerStatus('smtp'), getServerStatus('imapProxy'), settings.getMulti(...LISTENER_TLS_SETTINGS)]);
496
-
497
- // What each listener says it is serving, in the order the listener list below is built in.
498
- const reports = listenerReads.then(([smtp, imapProxy]) => [apiTls.active || null, reportedListenerTls(smtp), reportedListenerTls(imapProxy)]);
499
-
500
- // The model needs those reports: material supplied through the TLS environment variables is per
501
- // listener and per process, so a name served only that way has nothing stored for it and would
502
- // otherwise be described as having no certificate. It is built alongside the listener reads
503
- // rather than after them, so the page still costs one round of latency and not two.
504
- const [[smtpState, imapProxyState, serverSettings], reported, status] = await Promise.all([
568
+ const listenerReads = Promise.all([getServerStatus('smtp'), getServerStatus('imapProxy')]);
569
+
570
+ // What each listener says it is serving, keyed the way the model lists them.
571
+ const reports = listenerReads.then(([smtp, imapProxy]) => ({
572
+ api: apiTls.active || null,
573
+ smtp: reportedListenerTls(smtp),
574
+ imapProxy: reportedListenerTls(imapProxy)
575
+ }));
576
+
577
+ // The model wants to know whether anything is served at all - a listener reporting a
578
+ // certificate is what says a name is presented to clients. Built alongside the listener
579
+ // reads rather than after them, so the page still costs one round of latency and not two.
580
+ const [[smtpState, imapProxyState], reported, status] = await Promise.all([
505
581
  listenerReads,
506
582
  reports,
507
- buildCertificateStatus({ certs: h.certs, reported: reports })
583
+ buildCertificateStatus({ certs: h.certs, served: reports.then(entries => Object.values(entries).some(report => report)) })
508
584
  ]);
509
585
 
510
- // The one statement of "enabled, and TLS on" - the reconciler reads the same derivation
511
- const switches = listenerTlsFrom(serverSettings);
512
-
513
- // The name clients connect to, and the order state recorded for it. A listener serves every
514
- // configured name, but the one it reports on is the default context, which is the first name.
586
+ // The name clients connect to, and the order state recorded for it, for the summary a listener's
587
+ // report is described with. Described the way the certificate table on this same page
588
+ // describes one, so a listener's certificate cannot read differently depending on where it is
589
+ // shown.
515
590
  const primary = status.certificates[0] || null;
516
- const primaryHostname = primary ? primary.hostname : null;
591
+ const serving = report =>
592
+ listenerCertificateSummary({ reported: report, hostname: primary ? primary.hostname : null, status: primary ? primary.status : null });
517
593
 
518
- // Described the way the certificate table on this same page describes one, so a listener's
519
- // certificate cannot read differently depending on where it is shown.
520
- const serving = report => listenerCertificateSummary({ reported: report, hostname: primaryHostname, status: primary ? primary.status : null });
594
+ const states = { smtp: smtpState.label, imapProxy: imapProxyState.label };
521
595
 
522
596
  // A server listener that reports no certificate gets one sentence saying why. The template
523
- // adds the link to the listener's own page when switching something on there is the next step.
524
- const serverListener = (listener, report) =>
525
- Object.assign(listener, {
526
- serving: serving(report),
527
- hint: !listener.enabled
528
- ? 'The server is disabled.'
529
- : listener.tlsEnabled
530
- ? 'TLS is on, but the listener has not reported a certificate yet.'
531
- : 'TLS is off.',
532
- needsSetup: !listener.enabled || !listener.tlsEnabled
597
+ // adds the link to the listener's own page when switching something on there is the next
598
+ // step; the API listener has no such page, its TLS is an environment switch.
599
+ const listeners = status.listeners.map(listener => {
600
+ const server = !!listener.configuredAt;
601
+ return Object.assign({}, listener, {
602
+ state: states[listener.key] || null,
603
+ serving: serving(reported[listener.key]),
604
+ hint: !server
605
+ ? null
606
+ : !listener.enabled
607
+ ? 'The server is disabled.'
608
+ : listener.tlsEnabled
609
+ ? 'TLS is on, but the listener has not reported a certificate yet.'
610
+ : 'TLS is off.',
611
+ needsSetup: server && (!listener.enabled || !listener.tlsEnabled)
533
612
  });
534
-
535
- const listeners = [
536
- {
537
- key: 'api',
538
- name: 'Admin UI and API',
539
- configuredAt: null,
540
- enabled: true,
541
- tlsEnabled: apiTls.enabled,
542
- serving: serving(reported[0])
543
- },
544
- serverListener(
545
- {
546
- key: 'smtp',
547
- name: 'SMTP server',
548
- configuredAt: '/admin/config/smtp',
549
- enabled: switches.smtp.enabled,
550
- tlsEnabled: switches.smtp.tlsEnabled,
551
- state: smtpState.label
552
- },
553
- reported[1]
554
- ),
555
- serverListener(
556
- {
557
- key: 'imapProxy',
558
- name: 'IMAP proxy',
559
- configuredAt: '/admin/config/imap-proxy',
560
- enabled: switches.imapProxy.enabled,
561
- tlsEnabled: switches.imapProxy.tlsEnabled,
562
- state: imapProxyState.label
563
- },
564
- reported[2]
565
- )
566
- ];
613
+ });
567
614
 
568
615
  // The header badge: the worst of what the listeners serve and, once something is served, of
569
616
  // the rows too, so a failed order for one name is not hidden behind a green tile
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emailengine-app",
3
- "version": "2.80.0",
3
+ "version": "2.80.1",
4
4
  "private": false,
5
5
  "productTitle": "EmailEngine",
6
6
  "description": "Email Sync Engine",
@@ -51,11 +51,11 @@
51
51
  },
52
52
  "homepage": "https://emailengine.app/",
53
53
  "dependencies": {
54
- "@bull-board/api": "9.9.0",
55
- "@bull-board/hapi": "9.9.0",
54
+ "@bull-board/api": "9.10.0",
55
+ "@bull-board/hapi": "9.10.0",
56
56
  "@elastic/elasticsearch": "8.15.3",
57
57
  "@hapi/accept": "6.0.3",
58
- "@hapi/bell": "13.1.0",
58
+ "@hapi/bell": "13.2.0",
59
59
  "@hapi/boom": "10.0.1",
60
60
  "@hapi/cookie": "12.0.1",
61
61
  "@hapi/crumb": "9.0.1",
@@ -65,15 +65,15 @@
65
65
  "@msgpack/msgpack": "3.1.3",
66
66
  "@phc/pbkdf2": "1.1.14",
67
67
  "@postalsys/bounce-classifier": "3.0.0",
68
- "@postalsys/certs": "1.4.0",
68
+ "@postalsys/certs": "1.4.1",
69
69
  "@postalsys/ee-client": "1.8.0",
70
- "@postalsys/email-ai-tools": "1.14.3",
70
+ "@postalsys/email-ai-tools": "1.14.4",
71
71
  "@postalsys/email-content": "0.1.5",
72
72
  "@postalsys/email-text-tools": "2.4.16",
73
73
  "@postalsys/gettext": "4.1.1",
74
74
  "@postalsys/joi-messages": "1.0.5",
75
75
  "@postalsys/templates": "2.0.2",
76
- "@sentry/node": "10.73.0",
76
+ "@sentry/node": "10.74.0",
77
77
  "@simplewebauthn/browser": "14.0.0",
78
78
  "@simplewebauthn/server": "14.0.1",
79
79
  "@zone-eu/mailsplit": "5.4.16",
@@ -93,7 +93,7 @@
93
93
  "html-to-text": "10.0.1",
94
94
  "ical.js": "1.5.0",
95
95
  "iconv-lite": "0.7.3",
96
- "imapflow": "2.0.0",
96
+ "imapflow": "2.0.2",
97
97
  "ioredfour": "1.4.3",
98
98
  "ioredis": "6.0.0",
99
99
  "ipaddr.js": "2.5.0",
@@ -101,19 +101,19 @@
101
101
  "libbase64": "1.3.0",
102
102
  "libmime": "5.4.3",
103
103
  "libqp": "2.1.1",
104
- "mailparser": "3.9.23",
104
+ "mailparser": "3.9.24",
105
105
  "marked": "15.0.12",
106
106
  "minimist": "1.2.8",
107
107
  "murmurhash": "2.0.1",
108
108
  "nanoid": "3.3.18",
109
- "nodemailer": "10.0.1",
109
+ "nodemailer": "10.0.3",
110
110
  "pino": "10.3.1",
111
111
  "prom-client": "15.1.3",
112
112
  "psl": "1.15.0",
113
- "pubface": "1.1.12",
113
+ "pubface": "1.1.13",
114
114
  "punycode.js": "2.3.1",
115
115
  "qrcode": "1.5.4",
116
- "smtp-server": "3.19.9",
116
+ "smtp-server": "3.19.10",
117
117
  "socks": "2.8.10",
118
118
  "timezones-list": "3.1.0",
119
119
  "undici": "7.29.1"