emailengine-app 2.80.0 → 2.81.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/.dockerignore +44 -0
  2. package/.github/docker-smoke-test.sh +16 -0
  3. package/.github/workflows/deploy.yml +4 -0
  4. package/.github/workflows/release.yaml +4 -0
  5. package/.github/workflows/test.yml +2 -0
  6. package/.release-please-manifest.json +1 -1
  7. package/CHANGELOG.md +56 -0
  8. package/Dockerfile +17 -9
  9. package/README.md +6 -0
  10. package/data/google-crawlers.json +1 -1
  11. package/docker-compose.yml +7 -1
  12. package/lib/api-routes/account-routes.js +239 -73
  13. package/lib/api-routes/blocklist-routes.js +24 -0
  14. package/lib/api-routes/delivery-test-routes.js +6 -0
  15. package/lib/api-routes/gateway-routes.js +30 -0
  16. package/lib/api-routes/license-routes.js +10 -0
  17. package/lib/api-routes/mcp-oauth-routes.js +3 -3
  18. package/lib/api-routes/mcp-routes.js +39 -21
  19. package/lib/api-routes/oauth2-app-routes.js +38 -1
  20. package/lib/api-routes/outbox-routes.js +6 -0
  21. package/lib/api-routes/permission-map.js +212 -42
  22. package/lib/api-routes/pubsub-routes.js +8 -0
  23. package/lib/api-routes/route-helpers.js +58 -11
  24. package/lib/api-routes/settings-routes.js +50 -4
  25. package/lib/api-routes/stats-routes.js +6 -0
  26. package/lib/api-routes/template-routes.js +21 -0
  27. package/lib/api-routes/token-routes.js +34 -2
  28. package/lib/api-routes/webhook-route-routes.js +13 -0
  29. package/lib/autodetect-imap-settings.js +4 -4
  30. package/lib/email-client/base-client.js +6 -3
  31. package/lib/email-client/credential-errors.js +4 -0
  32. package/lib/email-client/imap/login-failure.js +52 -0
  33. package/lib/email-client/imap/subconnection.js +2 -1
  34. package/lib/email-client/imap-client.js +3 -6
  35. package/lib/enum-descriptions.js +12 -2
  36. package/lib/imapproxy/imap-server.js +1 -1
  37. package/lib/mcp/oauth.js +46 -8
  38. package/lib/mcp/protocol.js +78 -35
  39. package/lib/mcp/tools.js +53 -17
  40. package/lib/privileged-settings.js +147 -0
  41. package/lib/schemas.js +60 -16
  42. package/lib/sentry.js +13 -2
  43. package/lib/settings.js +13 -0
  44. package/lib/tls/catalog.js +428 -0
  45. package/lib/tls/context.js +87 -161
  46. package/lib/tls/listeners.js +62 -0
  47. package/lib/tls/provision.js +1 -1
  48. package/lib/tls/status.js +128 -79
  49. package/lib/tls/store.js +3 -2
  50. package/lib/token-permission-view.js +253 -102
  51. package/lib/token-permissions.js +176 -26
  52. package/lib/tokens.js +7 -6
  53. package/lib/tools.js +5 -3
  54. package/lib/ui-routes/account-routes.js +195 -61
  55. package/lib/ui-routes/admin-config-routes.js +41 -21
  56. package/lib/ui-routes/admin-entities-routes.js +32 -22
  57. package/lib/ui-routes/mcp-consent-routes.js +72 -31
  58. package/lib/ui-routes/tls-config-routes.js +121 -74
  59. package/package.json +16 -16
  60. package/sbom.json +1 -1
  61. package/server.js +7 -1
  62. package/static/css/flyonui.css +1 -1
  63. package/static/css/public.css +41 -0
  64. package/static/css/src/app.tailwind.css +135 -4
  65. package/static/js/public.js +218 -0
  66. package/static/js/ui.js +89 -36
  67. package/static/licenses.html +55 -37
  68. package/translations/README.md +4 -3
  69. package/translations/de.mo +0 -0
  70. package/translations/de.po +296 -185
  71. package/translations/en.po +220 -128
  72. package/translations/es.mo +0 -0
  73. package/translations/es.po +558 -0
  74. package/translations/et.mo +0 -0
  75. package/translations/et.po +288 -181
  76. package/translations/fr.mo +0 -0
  77. package/translations/fr.po +295 -183
  78. package/translations/it.mo +0 -0
  79. package/translations/it.po +558 -0
  80. package/translations/ja.mo +0 -0
  81. package/translations/ja.po +268 -192
  82. package/translations/locales.json +24 -0
  83. package/translations/messages.pot +179 -127
  84. package/translations/nl.mo +0 -0
  85. package/translations/nl.po +288 -175
  86. package/translations/pl.mo +0 -0
  87. package/translations/pl.po +294 -181
  88. package/translations/sv.mo +0 -0
  89. package/translations/sv.po +555 -0
  90. package/translations/tr.mo +0 -0
  91. package/translations/tr.po +555 -0
  92. package/update-info.sh +12 -6
  93. package/views/account/login-redirect.hbs +6 -5
  94. package/views/account/passkeys.hbs +8 -8
  95. package/views/account/security.hbs +2 -2
  96. package/views/accounts/account.hbs +19 -21
  97. package/views/accounts/browse.hbs +1 -1
  98. package/views/accounts/edit.hbs +15 -15
  99. package/views/accounts/index.hbs +3 -3
  100. package/views/accounts/register/imap-server.hbs +27 -173
  101. package/views/accounts/register/validating.hbs +139 -0
  102. package/views/config/ai.hbs +15 -17
  103. package/views/config/branding.hbs +7 -7
  104. package/views/config/document-store/chat.hbs +9 -8
  105. package/views/config/document-store/index.hbs +14 -15
  106. package/views/config/document-store/mappings/index.hbs +5 -6
  107. package/views/config/document-store/mappings/new.hbs +1 -2
  108. package/views/config/document-store/pre-processing/index.hbs +4 -4
  109. package/views/config/email-processing.hbs +6 -6
  110. package/views/config/imap-proxy.hbs +7 -8
  111. package/views/config/license.hbs +9 -9
  112. package/views/config/logging.hbs +5 -7
  113. package/views/config/mcp.hbs +90 -58
  114. package/views/config/network.hbs +4 -4
  115. package/views/config/oauth/app.hbs +12 -12
  116. package/views/config/oauth/index.hbs +6 -6
  117. package/views/config/oauth/subscriptions.hbs +9 -9
  118. package/views/config/security.hbs +5 -7
  119. package/views/config/service.hbs +11 -10
  120. package/views/config/smtp.hbs +9 -12
  121. package/views/config/tls-upload.hbs +3 -3
  122. package/views/config/tls.hbs +281 -182
  123. package/views/config/webhooks.hbs +12 -15
  124. package/views/dashboard.hbs +9 -8
  125. package/views/gateways/edit.hbs +3 -3
  126. package/views/gateways/gateway.hbs +3 -3
  127. package/views/gateways/index.hbs +6 -6
  128. package/views/gateways/new.hbs +3 -3
  129. package/views/internals/index.hbs +15 -13
  130. package/views/layout/app.hbs +6 -6
  131. package/views/layout/login.hbs +32 -19
  132. package/views/layout/main.hbs +2 -2
  133. package/views/layout/prompt.hbs +15 -18
  134. package/views/layout/public.hbs +1 -1
  135. package/views/mcp/authorize.hbs +47 -45
  136. package/views/partials/accounts_table.hbs +5 -5
  137. package/views/partials/ace_assets.hbs +1 -1
  138. package/views/partials/add_account_modal.hbs +4 -4
  139. package/views/partials/address_list.hbs +4 -4
  140. package/views/partials/filter_editor_js.hbs +2 -2
  141. package/views/partials/gateway_form.hbs +5 -5
  142. package/views/partials/gateway_js.hbs +1 -1
  143. package/views/partials/mcp_access_levels.hbs +16 -9
  144. package/views/partials/mcp_account_limit.hbs +2 -2
  145. package/views/partials/mcp_tool_count.hbs +15 -14
  146. package/views/partials/oauth_config_header.hbs +2 -2
  147. package/views/partials/oauth_form.hbs +37 -42
  148. package/views/partials/public_alerts.hbs +1 -1
  149. package/views/partials/public_test_labels.hbs +15 -0
  150. package/views/partials/public_theme_init.hbs +1 -1
  151. package/views/partials/security_header.hbs +2 -2
  152. package/views/partials/template_form.hbs +4 -4
  153. package/views/partials/theme_init.hbs +1 -1
  154. package/views/partials/tls_security_card.hbs +4 -1
  155. package/views/partials/ui/form-field.hbs +6 -1
  156. package/views/partials/ui/setting-ref.hbs +12 -7
  157. package/views/partials/ui/stat-card.hbs +4 -1
  158. package/views/partials/ui/tabs.hbs +3 -7
  159. package/views/partials/webhook_form.hbs +9 -12
  160. package/views/partials/webhooks_editor_functions.hbs +1 -1
  161. package/views/reference/index.hbs +3 -3
  162. package/views/reference/redirect.hbs +1 -1
  163. package/views/reference/tag.hbs +1 -1
  164. package/views/reference/token.hbs +4 -4
  165. package/views/suppression-lists/index.hbs +8 -6
  166. package/views/suppression-lists/list.hbs +13 -8
  167. package/views/templates/edit.hbs +1 -1
  168. package/views/templates/index.hbs +10 -11
  169. package/views/templates/template.hbs +5 -5
  170. package/views/tokens/index.hbs +17 -17
  171. package/views/tokens/new.hbs +190 -93
  172. package/views/unsubscribe.hbs +1 -1
  173. package/views/webhooks/edit.hbs +1 -1
  174. package/views/webhooks/index.hbs +10 -11
  175. package/views/webhooks/new.hbs +1 -1
  176. package/views/webhooks/webhook.hbs +5 -6
  177. package/workers/api.js +9 -8
  178. package/workers/smtp.js +1 -1
@@ -25,8 +25,9 @@
25
25
  the one MCP surface a person can reach without passing one of those first, so it is
26
26
  also the one where the label would otherwise be missing. --}}
27
27
  {{> ui/badge label="Beta" variant="info" soft=true class="badge-sm align-middle"}}</h1>
28
- <p class="text-base-content/60 mt-2 text-sm">An MCP client is asking for access to the email accounts on this
29
- EmailEngine instance. Once you decide, the browser returns to <code>{{redirectHost}}</code>.</p>
28
+ <p class="text-base-content/60 mt-2 text-sm">An MCP client is asking for access to this EmailEngine instance. Decide
29
+ what it may manage and which email actions it may perform. After you approve or deny access, you return to
30
+ <code>{{redirectHost}}</code>.</p>
30
31
  </div>
31
32
 
32
33
  {{#unless canProvision}}
@@ -46,40 +47,38 @@
46
47
  <input type="hidden" name="code_challenge" value="{{values.code_challenge}}" />
47
48
  <input type="hidden" name="resource" value="{{values.resource}}" />
48
49
 
49
- <div class="space-y-4">
50
-
50
+ <div class="space-y-5">
51
+
52
+ {{!-- One block per section, in table order: management first, because it is what the
53
+ endpoint is for by default, then mail, declined unless the person or the client's
54
+ scope request said otherwise. The radio group of a section is named after its key,
55
+ which is the field the route reads and what ui.js reads the selection back from.
56
+ Under each group, one grant sentence per level, generated from the table rather than
57
+ written per level: the grant word lists come from the surface tables the enforcement
58
+ reads (never written out here), so this screen cannot promise less than the token
59
+ grants after the tool set changes, and the caveat travels with the level it
60
+ describes. One is visible at a time - the one describing the selected level. --}}
61
+ {{#each mcpSections}}
51
62
  <fieldset class="space-y-2">
52
- <legend class="label-text mb-1">Access level</legend>
53
- {{> mcp_access_levels name="access" idPrefix="access" selected=accessLevel}}
63
+ <legend class="label-text mb-1">{{label}}</legend>
64
+ {{> mcp_access_levels section=this name=@key idPrefix=@key selected=(lookup ../selectedLevels @key) includeNone=true}}
54
65
  </fieldset>
55
66
 
56
- {{!-- The grant word lists come from MCP_GRANT_WORDING (derived from SURFACE_GRANTS.mcp,
57
- never written out here), so this screen cannot promise less than the token grants
58
- after the tool set changes. The framing prose around them is bespoke per level - a
59
- level added to MCP_ACCESS_LEVELS needs its own alert block here. One is visible at
60
- a time - the one describing the selected access level. --}}
61
- <div data-access="read" class="consent-grant alert alert-soft alert-info text-sm{{#equals accessLevel 'read'}}{{else}} hidden{{/equals}}">
62
- <span class="icon-[tabler--info-circle] size-5 shrink-0"></span>
63
- <span>Through the MCP tool set the client will be able to <strong>{{grantWording.read.actions}}</strong>
64
- {{grantWording.read.groups}} on the accounts its token can reach. It cannot send email, delete anything,
65
- change anything, read stored credentials, or change instance settings.</span>
66
- </div>
67
-
68
- <div data-access="mail" class="consent-grant alert alert-soft alert-warning text-sm{{#equals accessLevel 'mail'}}{{else}} hidden{{/equals}}">
69
- <span class="icon-[tabler--alert-triangle] size-5 shrink-0"></span>
70
- <span>Through the MCP tool set the client will be able to <strong>{{grantWording.mail.actions}}</strong>
71
- across {{grantWording.mail.groups}} on the accounts its token can reach - everything except the delete
72
- tool. Instructions inside received mail are a real prompt-injection risk once sending is granted. It
73
- cannot read stored credentials or change instance settings.</span>
67
+ {{#each levels}}
68
+ <div data-section="{{@../key}}" data-level="{{value}}"
69
+ class="consent-grant alert alert-soft alert-{{variant}} text-sm{{#equals (lookup ../../selectedLevels @../key) value}}{{else}} hidden{{/equals}}">
70
+ <span class="{{#equals variant 'info'}}icon-[tabler--info-circle]{{else}}icon-[tabler--alert-triangle]{{/equals}} size-5 shrink-0"></span>
71
+ <span>{{../lead}} <strong>{{actions}}</strong> across {{groups}}. {{caveat}}</span>
74
72
  </div>
73
+ {{/each}}
74
+ {{/each}}
75
75
 
76
- <div data-access="full" class="consent-grant alert alert-soft alert-warning text-sm{{#equals accessLevel 'full'}}{{else}} hidden{{/equals}}">
77
- <span class="icon-[tabler--alert-triangle] size-5 shrink-0"></span>
78
- <span>Through the MCP tool set the client will be able to <strong>{{grantWording.full.actions}}</strong>
79
- across {{grantWording.full.groups}} on the accounts its token can reach. Instructions inside received
80
- mail are a real prompt-injection risk once sending is granted. It cannot read stored credentials or
81
- change instance settings.</span>
76
+ {{#if errors.access}}
77
+ <div class="alert alert-soft alert-error text-sm">
78
+ <span class="icon-[tabler--alert-circle] size-5 shrink-0"></span>
79
+ <span>{{errors.access}}</span>
82
80
  </div>
81
+ {{/if}}
83
82
 
84
83
  <div>
85
84
  {{> mcp_account_limit id="account" value=values.account selected=selectedAccount error=errors.account}}
@@ -88,8 +87,9 @@
88
87
  {{!-- The grant sentences above say what a level allows in the permission vocabulary; this
89
88
  says which tools the client ends up holding, which is closer to the thing being
90
89
  approved. Follows the account field too, because limiting the client to one account
91
- takes the instance-wide tools away from it. --}}
92
- {{> mcp_tool_count id="consentToolCount" levelName="access" accountId="account"}}
90
+ takes the instance-wide tools away from it - what is left of a management grant is
91
+ then the tools that operate that one account. --}}
92
+ {{> mcp_tool_count id="consentToolCount" autoWire=true levelPrefix="" accountId="account"}}
93
93
 
94
94
  <div class="flex gap-3 pt-2">
95
95
  <button type="submit" name="decision" value="deny" class="btn btn-neutral btn-outline grow">
@@ -108,29 +108,31 @@
108
108
  TTL, so an approved client holds its token until someone takes it away. Said here
109
109
  because this is the screen where the decision is made, and the person making it has
110
110
  no other place to learn it. --}}
111
- <p class="text-base-content/60 text-center text-xs">Approving creates an access token with the <code>mcp</code>
112
- scope. It does not expire - it appears on the <a href="/admin/tokens?scope=mcp" class="link">Access
113
- Tokens</a> page and stays valid until you revoke it there.</p>
111
+ <p class="text-base-content/60 text-center text-xs">Approving creates an access token with the MCP scopes you
112
+ chose (<code>mcp-manage</code> for the instance, <code>mcp</code> for mail) and exactly the grants shown
113
+ above. It does not expire - it appears on the <a href="/admin/tokens?scope=mcp-manage&amp;scope=mcp"
114
+ class="link">Access Tokens</a> page and stays valid until you revoke it there.</p>
114
115
 
115
116
  </div>
116
117
  </form>
117
118
 
118
- <script nonce="{{cspNonce}}">
119
- (() => {
120
- // The grant sentences describe the same token under each setting of the radio, so
121
- // whichever is showing is the one the operator is about to approve
122
- let radios = Array.from(document.querySelectorAll('input[name="access"]'));
119
+ <script data-cfasync="false" nonce="{{cspNonce}}">
120
+ // The grant sentences describe the same token under each setting of the radios, so whichever
121
+ // are showing are the ones the operator is about to approve. The tool count is wired by ui.js
122
+ // off the count element's data attributes; this only follows the alerts. On DOMContentLoaded
123
+ // because the prompt layout loads ui.js after the page body, and the helper lives there.
124
+ document.addEventListener('DOMContentLoaded', () => {
125
+ let sections = JSON.parse(document.getElementById('consentToolCount').dataset.mcpSections || '{}');
123
126
  let grants = Array.from(document.querySelectorAll('.consent-grant'));
124
127
 
125
128
  let sync = () => {
126
- let selected = radios.find(radio => radio.checked);
127
- let access = (selected && selected.value) || 'read';
128
- grants.forEach(grant => grant.classList.toggle('hidden', grant.dataset.access !== access));
129
+ let choice = uiMcpLevelChoice(sections, '');
130
+ grants.forEach(grant => grant.classList.toggle('hidden', grant.dataset.level !== choice[grant.dataset.section]));
129
131
  };
130
132
 
131
- radios.forEach(radio => radio.addEventListener('change', sync));
133
+ document.querySelectorAll('input[type="radio"]').forEach(radio => radio.addEventListener('change', sync));
132
134
  sync();
133
- })();
135
+ });
134
136
  </script>
135
137
 
136
138
  {{/if}}
@@ -12,7 +12,7 @@
12
12
  <div class="card bg-base-100 shadow-md mb-6">
13
13
 
14
14
  <div class="overflow-x-auto">
15
- <table class="table">
15
+ <table class="table ee-table-stack">
16
16
  <thead>
17
17
  <tr>
18
18
  <th>Name</th>
@@ -33,11 +33,11 @@
33
33
  <div><strong>{{name}}</strong></div>
34
34
  {{> ui/entity-id id=account label="Account ID"}}
35
35
  </td>
36
- <td class="relative">
36
+ <td class="relative" data-label="Email">
37
37
  {{> ui/row-link href=(concat "/admin/accounts/" (urlpart account))}}{{email}}
38
38
  </td>
39
39
 
40
- <td class="relative">
40
+ <td class="relative" data-label="Type">
41
41
  {{> ui/row-link href=(concat "/admin/accounts/" (urlpart account))}}
42
42
  {{#if type.icon}}
43
43
  {{!-- relative z-[1] lifts the tooltip trigger above the row link --}}
@@ -52,7 +52,7 @@
52
52
  {{/if}}
53
53
  </td>
54
54
 
55
- <td class="relative w-32">
55
+ <td class="relative w-32" data-label="Status">
56
56
  {{> ui/row-link href=(concat "/admin/accounts/" (urlpart account))}}
57
57
  {{!-- live state badge: app.js updates the badge-{type} class,
58
58
  text and error tooltip through the /admin/changes SSE
@@ -67,7 +67,7 @@
67
67
  {{!-- ../showActions: inside {{#each}} the bare name would resolve against the
68
68
  row, not the partial params, so the cell silently vanished (phantom column) --}}
69
69
  {{#if ../showActions}}
70
- <td class="relative text-end">
70
+ <td class="ee-stack-actions relative text-end">
71
71
  {{> ui/row-actions openHref=(concat "/admin/accounts/" (urlpart account)) label="Account actions"
72
72
  deleteModal="#deleteAccount" deleteName=(when name name email) deleteAction=(concat "/admin/accounts/" (urlpart account) "/delete")}}
73
73
  </td>
@@ -10,4 +10,4 @@
10
10
  <link rel="stylesheet" href="/static/js/ace/css/theme/kuroir.css">
11
11
  <link rel="stylesheet" href="/static/js/ace/css/theme/tomorrow_night.css">
12
12
  <link rel="stylesheet" href="/static/js/ace/css/theme/tomorrow_night_eighties.css">
13
- <script src="/static/js/ace/ace.js"></script>
13
+ <script data-cfasync="false" src="/static/js/ace/ace.js"></script>
@@ -2,10 +2,10 @@
2
2
  <form method="post" action="/admin/accounts/new">
3
3
  <input type="hidden" name="crumb" value="{{crumb}}">
4
4
  <div class="modal-body space-y-4">
5
- {{> ui/form-field id="account-name" name="name" label="Full name:" placeholder="e.g., John Smith"}}
6
- {{> ui/form-field id="account-id" name="account" label="Account identifier (optional):" placeholder="e.g., account_123" hint="Leave blank to auto-generate. Existing accounts with this ID will be updated."}}
5
+ {{> ui/form-field id="account-name" name="name" label="Full name" placeholder="e.g., John Smith"}}
6
+ {{> ui/form-field id="account-id" name="account" label="Account ID (optional)" placeholder="e.g., account_123" hint="Leave blank to generate an ID. Using an existing ID updates that account."}}
7
7
 
8
- <p class="text-sm text-base-content/60">You'll be redirected to a hosted authentication form. You can also <a
8
+ <p class="text-sm text-base-content/60">Next, connect the email account through the hosted authentication form. You can also <a
9
9
  href="https://learn.emailengine.app/docs/accounts/hosted-authentication" target="_blank" rel="noopener noreferrer"
10
10
  referrerpolicy="no-referrer" class="link link-animated">use this form in your own app</a>.
11
11
  </p>
@@ -17,7 +17,7 @@
17
17
  </form>
18
18
  {{/ui/modal}}
19
19
 
20
- <script nonce="{{cspNonce}}">
20
+ <script data-cfasync="false" nonce="{{cspNonce}}">
21
21
  document.addEventListener('DOMContentLoaded', () => {
22
22
  let modalElm = document.getElementById('addAccount');
23
23
 
@@ -8,7 +8,7 @@
8
8
  <input type="checkbox" class="checkbox checkbox-sm checkbox-entry" data-ip="{{localAddress}}"
9
9
  name="localAddresses" value="{{localAddress}}" {{#if checked}}checked{{/if}}>
10
10
  </td>
11
- <td>{{localAddress}}
11
+ <td data-label="Local IP">{{localAddress}}
12
12
 
13
13
  {{#if notice}}<span class="tooltip [--placement:top] inline-flex align-middle"><span
14
14
  class="tooltip-toggle cursor-default"><span
@@ -19,11 +19,11 @@
19
19
  {{#if defaultInterface}}<span class="badge badge-soft">default</span>{{/if}}
20
20
  </div>
21
21
  </td>
22
- <td>{{ip}}</td>
23
- <td>
22
+ <td data-label="Public IP">{{ip}}</td>
23
+ <td data-label="Hostname">
24
24
  {{name}}
25
25
  </td>
26
- <td class="text-end">
26
+ <td class="ee-stack-actions text-end">
27
27
  <button type="button" class="btn btn-error btn-soft btn-circle btn-sm address-action-delete"
28
28
  data-address="{{localAddress}}" aria-label="Delete this address" title="Delete this address">
29
29
  <span class="icon-[tabler--trash] size-4"></span>
@@ -22,7 +22,7 @@
22
22
  notificationTypesJson, which switches on the event-name autocompleter.
23
23
  --}}
24
24
  {{> ace_assets}}
25
- <script src="/static/js/ace/ext-language_tools.js"></script>
25
+ <script data-cfasync="false" src="/static/js/ace/ext-language_tools.js"></script>
26
26
 
27
27
  {{#if notificationTypesJson}}
28
28
  <input type="hidden" id="notificationTypesJson" value="{{notificationTypesJson}}">
@@ -50,7 +50,7 @@
50
50
  </div>
51
51
  {{/ui/modal}}
52
52
 
53
- <script nonce="{{cspNonce}}">
53
+ <script data-cfasync="false" nonce="{{cspNonce}}">
54
54
  document.addEventListener('DOMContentLoaded', () => {
55
55
 
56
56
  let scriptEnv = JSON.parse(document.getElementById('scriptEnvJson').value);
@@ -3,16 +3,16 @@
3
3
  basicAutoComplete class hook) --}}
4
4
  <div class="space-y-4">
5
5
 
6
- {{> ui/form-field id="name" label="Display Name" value=values.name error=errors.name placeholder="SendGrid Transactional" lpignore=true required=true class="basicAutoComplete" hint="Friendly name to identify this gateway"}}
6
+ {{> ui/form-field id="name" label="Display Name" value=values.name error=errors.name placeholder="SendGrid Transactional" lpignore=true required=true class="basicAutoComplete" hint="Name shown for this gateway in EmailEngine."}}
7
7
 
8
- {{> ui/form-field id="user" label="Username" value=values.user error=errors.user lpignore=true hint="SMTP authentication username (if required)"}}
8
+ {{> ui/form-field id="user" label="Username" value=values.user error=errors.user lpignore=true hint="Username required by your SMTP provider, if any."}}
9
9
 
10
- {{> ui/form-field id="pass" type="password" label="Password" value=values.pass error=errors.pass lpignore=true placeholder=(when hasSMTPPass "Password saved (hidden for security)") hint=(concat "SMTP authentication password" (when gatewayData ". Leave empty to keep current password"))}}
10
+ {{> ui/form-field id="pass" type="password" label="Password" value=values.pass error=errors.pass lpignore=true placeholder=(when hasSMTPPass "Password saved") hint=(concat "Password required by your SMTP provider." (when gatewayData " Leave blank to keep the current password."))}}
11
11
 
12
12
  {{> ui/form-field id="host" label="Server Address" value=values.host error=errors.host lpignore=true placeholder="smtp.sendgrid.net" required=true hint="SMTP server hostname or IP address"}}
13
13
 
14
- {{> ui/form-field id="port" type="number" label="Port" value=values.port error=errors.port lpignore=true placeholder="587" required=true hint="Common ports: 25, 587 (STARTTLS), 465 (TLS/SSL)"}}
14
+ {{> ui/form-field id="port" type="number" label="Port" value=values.port error=errors.port lpignore=true placeholder="587" required=true hint="Common ports: 25 or 587 for STARTTLS, 465 for direct TLS."}}
15
15
 
16
- {{> ui/checkbox id="secure" label="Use direct TLS" checked=values.secure error=errors.secure tooltip="Enable for port 465 (direct TLS/SSL). For ports 25 and 587, EmailEngine automatically upgrades to encrypted connections using STARTTLS when available."}}
16
+ {{> ui/checkbox id="secure" label="Use direct TLS" checked=values.secure error=errors.secure tooltip="Usually enabled for port 465. When disabled, EmailEngine uses STARTTLS if the server supports it."}}
17
17
 
18
18
  </div>
@@ -1,5 +1,5 @@
1
1
  <input type="hidden" id="wellKnownServices" value="{{wellKnownServices}}">
2
- <script nonce="{{cspNonce}}">
2
+ <script data-cfasync="false" nonce="{{cspNonce}}">
3
3
  document.addEventListener('DOMContentLoaded', () => {
4
4
  let wellKnownServices = JSON.parse(document.getElementById('wellKnownServices').value);
5
5
 
@@ -1,13 +1,20 @@
1
1
  {{!--
2
- The MCP access-level radio group, rendered identically by the OAuth consent prompt and the
3
- admin token generator so the two cannot drift on what each level promises. The options come
4
- from MCP_ACCESS_LEVEL_OPTIONS (lib/token-permission-view.js) through the accessOptions
5
- context value.
2
+ The radio group of one MCP access section (instance management or email access), rendered
3
+ identically by the OAuth consent prompt, the MCP config page's generator and the token form
4
+ so the three cannot drift on what each level promises. The options come from MCP_SECTIONS
5
+ (lib/token-permission-view.js), which also carries the pair list each level mints.
6
6
  Params:
7
- name - input name shared by the radio group (required)
8
- idPrefix - per-page prefix for the input ids (required)
9
- selected - the selected value (required; pass "read" for the static default)
7
+ section - the section object from MCP_SECTIONS (required)
8
+ name - input name shared by the radio group (required; the pages name it
9
+ <prefix><section key>, which is what static/js/ui.js reads back)
10
+ idPrefix - per-page prefix for the input ids; ids are <idPrefix>_<level> (required)
11
+ selected - the selected level (required)
12
+ includeNone - true to offer the section's decline option first (the consent prompt and the
13
+ generator; the token form declines a section by leaving its scope unticked)
10
14
  --}}
11
- {{#each accessOptions}}
12
- {{> ui/radio id=(concat ../idPrefix value) name=../name value=value label=label selected=../selected hint=hint}}
15
+ {{#if includeNone}}
16
+ {{> ui/radio id=(concat idPrefix "_none") name=name value="none" label=section.none.label selected=selected hint=section.none.hint}}
17
+ {{/if}}
18
+ {{#each section.levels}}
19
+ {{> ui/radio id=(concat ../idPrefix "_" value) name=../name value=value label=label selected=../selected hint=hint}}
13
20
  {{/each}}
@@ -10,5 +10,5 @@
10
10
  error - validation error message (optional)
11
11
  --}}
12
12
  {{> ui/account-picker id=id value=value selected=selected error=error label="Limit to one account"
13
- placeholder="Search by name, address or account id"
14
- hint="Recommended. The client then only reaches this account, and its tools stop asking which account to act on. Leave empty to allow every account on the instance."}}
13
+ placeholder="Search by name, email address, or account ID"
14
+ hint="Limit access to this account and exclude instance-wide tools. Leave blank to allow all accounts and instance tools within the selected access levels."}}
@@ -1,19 +1,20 @@
1
1
  {{!--
2
- The "N of M MCP tools available" line, shown by every page that mints an mcp-scoped token so
3
- the three cannot disagree about what a credential will actually be offered. The counting rule
4
- is uiMcpToolCount() in static/js/ui.js - the browser's copy of toolVisibleTo(), pinned to it by
5
- test/mcp-tools-test.js. Reads mcpTools (and mcpAccessPresets, when auto-wired) from the
6
- page context.
2
+ The "N of M MCP tools available" line, shown by every page that mints an MCP token so the
3
+ three cannot disagree about what a credential will actually be offered. The counting rule is
4
+ uiMcpToolCount() in static/js/ui.js - the browser's copy of toolVisibleTo(), pinned to it by
5
+ test/mcp-tools-test.js. Reads mcpTools (and mcpSections, when auto-wired) from the page
6
+ context.
7
7
 
8
- Pass levelName to have ui.js drive the count from a named access level (the MCP config
9
- generator and the consent prompt); leave it out and the page repaints the element itself,
10
- which is what the access-token form does for its custom-permissions option.
8
+ Pass levelPrefix to have ui.js drive the count from the section radio groups named
9
+ <levelPrefix><section key> (the MCP config generator and the consent prompt); leave it out
10
+ and the page repaints the element itself, which is what the access-token form does.
11
11
  Params:
12
- id - element id (required; the page's own script needs it, and so does nothing else)
13
- levelName - the radio group name to follow, for the auto-wired pages (optional)
14
- accountId - id of the "limit to one account" field to follow (optional, with levelName)
15
- class - extra classes on the wrapper (optional)
12
+ id - element id (required; the page's own script needs it, and so does nothing else)
13
+ autoWire - true to let ui.js drive the count (optional)
14
+ levelPrefix - the radio group name prefix, with autoWire; may be empty (optional)
15
+ accountId - id of the "limit to one account" field to follow, with autoWire (optional)
16
+ class - extra classes on the wrapper (optional)
16
17
  --}}
17
18
  <div id="{{id}}" class="text-sm space-y-1{{#if class}} {{class}}{{/if}}" data-mcp-tools="{{json mcpTools}}"
18
- {{#if levelName}}data-mcp-level-name="{{levelName}}" data-mcp-account-id="{{accountId}}"
19
- data-mcp-presets="{{json mcpAccessPresets}}"{{/if}}></div>
19
+ {{#if autoWire}}data-mcp-auto-wire="1" data-mcp-level-prefix="{{levelPrefix}}" data-mcp-account-id="{{accountId}}"
20
+ data-mcp-sections="{{json mcpSections}}"{{/if}}></div>
@@ -2,7 +2,7 @@
2
2
  actions in the header row (same idiom as ui/page-header). Pass badgeLabel
3
3
  to show a count badge after the title (e.g. the apps total). --}}
4
4
  {{#if @partial-block}}
5
- {{#> ui/page-header title="OAuth2 Apps" icon="icon-[tabler--brand-oauth]" subtitle="Connect Gmail, Outlook, and other providers so users can authorize their accounts." badgeLabel=badgeLabel badgeVariant="neutral" class="mb-6"}}{{> @partial-block}}{{/ui/page-header}}
5
+ {{#> ui/page-header title="OAuth2 Apps" icon="icon-[tabler--brand-oauth]" subtitle="Configure provider credentials for connecting Gmail, Outlook, and other email accounts." badgeLabel=badgeLabel badgeVariant="neutral" class="mb-6"}}{{> @partial-block}}{{/ui/page-header}}
6
6
  {{else}}
7
- {{> ui/page-header title="OAuth2 Apps" icon="icon-[tabler--brand-oauth]" subtitle="Connect Gmail, Outlook, and other providers so users can authorize their accounts." badgeLabel=badgeLabel badgeVariant="neutral" class="mb-6"}}
7
+ {{> ui/page-header title="OAuth2 Apps" icon="icon-[tabler--brand-oauth]" subtitle="Configure provider credentials for connecting Gmail, Outlook, and other email accounts." badgeLabel=badgeLabel badgeVariant="neutral" class="mb-6"}}
8
8
  {{/if}}