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
@@ -142,7 +142,7 @@
142
142
  {{#> ui/modal id="disableTfaModal" title="Disable two-factor authentication" titleId="disableTfaModalLabel"}}
143
143
  <form method="post" action="/admin/account/tfa/disable">
144
144
  <div class="modal-body space-y-4">
145
- <p>Disabling two-factor authentication will make your account less secure. Are you sure you want to continue?</p>
145
+ <p>Turn off two-factor authentication? Password sign-ins will no longer require a code from your authenticator app.</p>
146
146
 
147
147
  <div>
148
148
  {{!-- The route verifies this server-side: switching the second factor off is a step
@@ -151,7 +151,7 @@
151
151
  {{#> ui/form-field id="tfa-disable-password" label="Current password"}}
152
152
  <input type="password" class="input" id="tfa-disable-password" name="password" maxlength="256"
153
153
  autocomplete="current-password" required />
154
- <span class="helper-text">Confirm your identity before switching off two-factor authentication.</span>
154
+ <span class="helper-text">Enter your password to confirm this change.</span>
155
155
  {{/ui/form-field}}
156
156
  </div>
157
157
  </div>
@@ -40,7 +40,7 @@
40
40
  id="request-reconnect" disabled=accountParked}}
41
41
  {{/ui/tooltip}}
42
42
 
43
- {{#> ui/tooltip text="Run periodic folder syncing now"}}
43
+ {{#> ui/tooltip text="Sync folders now without waiting for the next scheduled sync"}}
44
44
  <button type="button" class="btn btn-soft btn-sm" id="request-sync">
45
45
  <span class="icon-[tabler--rotate-clockwise] size-4"></span> Run sync
46
46
  </button>
@@ -85,7 +85,7 @@
85
85
  aria-orientation="vertical">
86
86
  {{#if canUseSmtp}}
87
87
  <li><button type="button" class="dropdown-item test-send-trigger"
88
- data-account="{{account.account}}">Account's Mail server</button></li>
88
+ data-account="{{account.account}}">Account mail server</button></li>
89
89
  <li>
90
90
  <div class="divider my-1"></div>
91
91
  </li>
@@ -397,7 +397,7 @@
397
397
  <div class="grid gap-6 {{#if showSmtp}}lg:grid-cols-2 {{/if}}items-start mb-6">
398
398
 
399
399
  <div class="card bg-base-100 shadow-md">
400
- <div class="card-header"><h6 class="card-title text-primary">IMAP {{#if account.lastErrorState}}<span class="badge badge-error badge-sm">errored</span>{{/if}}</h6>
400
+ <div class="card-header"><h6 class="card-title text-primary">IMAP {{#if account.lastErrorState}}<span class="badge badge-error badge-sm">Error</span>{{/if}}</h6>
401
401
  </div>
402
402
  <div class="card-body">
403
403
 
@@ -480,7 +480,7 @@
480
480
  {{/unless}}
481
481
 
482
482
  {{#if account.imap.resyncDelay}}
483
- <dt>Resync delay</dt>
483
+ <dt>Resync interval (seconds)</dt>
484
484
  <dd>{{account.imap.resyncDelay}}</dd>
485
485
  {{/if}}
486
486
 
@@ -513,10 +513,8 @@
513
513
  <hr>
514
514
  <h6 class="card-title text-primary">Subconnections</h6>
515
515
 
516
- <p>Subconnections are supplementary IMAP connections that help detect changes in secondary folders more quickly.
517
- By default, EmailEngine only receives real-time updates for the primary folder and uses periodic
518
- polling for secondary folders. However, when faster updates are required from
519
- secondary folders, subconnections can be used to ensure prompt notifications.</p>
516
+ <p>Subconnections are additional IMAP connections that watch secondary folders for changes.
517
+ They provide faster updates than the periodic sync used for these folders by default.</p>
520
518
 
521
519
  <dl class="ee-dl mt-4">
522
520
  {{#each subConnectionInfo}}
@@ -533,7 +531,7 @@
533
531
 
534
532
  {{#if showSmtp}}
535
533
  <div class="card bg-base-100 shadow-md">
536
- <div class="card-header"><h6 class="card-title text-primary">SMTP {{#if smtpError}}<span class="badge badge-error badge-sm">errored</span>{{/if}}</h6>
534
+ <div class="card-header"><h6 class="card-title text-primary">SMTP {{#if smtpError}}<span class="badge badge-error badge-sm">Error</span>{{/if}}</h6>
537
535
  </div>
538
536
  <div class="card-body">
539
537
 
@@ -760,7 +758,7 @@
760
758
  <span class="text-base-content/60">None selected - the default target receives no events</span>
761
759
  {{/if}}
762
760
  {{#if webhookRouting.defaultRoute.inboxNewOnly}}
763
- <div><small>New-message notifications are limited to INBOX (<em>inboxNewOnly</em>).</small></div>
761
+ <div><small>New-message notifications are limited to the Inbox (<code>inboxNewOnly</code>).</small></div>
764
762
  {{/if}}
765
763
  </dd>
766
764
  {{/if}}
@@ -789,7 +787,7 @@
789
787
  {{#if account.webhookErrorFlag.message}}
790
788
  <hr />
791
789
 
792
- <div><small><strong>Note:</strong> The last webhook attempt failed with the following response.</small></div>
790
+ <div><small>The last webhook delivery attempt failed:</small></div>
793
791
  <div><code>{{account.webhookErrorFlag.message}}</code></div>
794
792
  {{/if}}
795
793
 
@@ -820,26 +818,26 @@
820
818
  </div>
821
819
  {{/ui/modal}}
822
820
 
823
- {{#> ui/confirm-modal id="deleteModal" title="Delete Account" action=(concat "/admin/accounts/" (urlpart account.account) "/delete")
821
+ {{#> ui/confirm-modal id="deleteModal" title="Delete account" action=(concat "/admin/accounts/" (urlpart account.account) "/delete")
824
822
  submitLabel="Delete account"}}
825
- <p>Are you sure you want to delete the account for {{account.name}}? This action cannot be undone.</p>
823
+ <p>Delete <strong>{{account.name}}</strong> from EmailEngine? This removes its synced data, account-specific templates, access tokens, and queued emails. Emails on the mail server are not deleted. This action cannot be undone.</p>
826
824
  {{/ui/confirm-modal}}
827
825
 
828
826
  {{#> ui/modal id="testSendModal" title="Email delivery test" dialogClass="max-w-3xl"}}
829
827
  <div class="modal-body">
830
828
  <p><small class="text-base-content/60">EmailEngine sends a test email from the selected account to EmailEngine's
831
829
  remote testing server. Once the test email has been processed, EmailEngine displays the
832
- authorization validation results below.</small>
830
+ SPF, DKIM, and DMARC authentication results below.</small>
833
831
  </p>
834
832
  <div id="test-send-pending-message">
835
- <p><span class="loading loading-spinner loading-sm align-middle"></span> Testing email delivery settings, please
833
+ <p><span class="loading loading-spinner loading-sm align-middle"></span> Testing email delivery. Please
836
834
  wait&mldr;<br />
837
835
  <small><strong>Note:</strong> This process may take several
838
836
  minutes depending on the SMTP server.</small>
839
837
  </p>
840
838
  </div>
841
839
  <div id="test-send-error">
842
- <p>Message submission failed with the following result:</p>
840
+ <p>The test email could not be submitted:</p>
843
841
  <div>
844
842
  <small class="alert alert-soft alert-error error-message block font-mono"></small>
845
843
  </div>
@@ -932,7 +930,7 @@ submitLabel="Delete account"}}
932
930
  </div>
933
931
  <div id="export-download-section" class="hidden mt-4">
934
932
  <a href="#" id="export-download-link" class="btn btn-success btn-block">
935
- <span class="icon-[tabler--download] size-4"></span> Download Export
933
+ <span class="icon-[tabler--download] size-4"></span> Download export
936
934
  </a>
937
935
  </div>
938
936
  </div>
@@ -943,7 +941,7 @@ submitLabel="Delete account"}}
943
941
  <span class="icon-[tabler--trash] size-4"></span> Reset
944
942
  </button>
945
943
  <button type="button" class="btn btn-primary" id="export-start-btn">
946
- <span class="icon-[tabler--file-export] size-4"></span> Start Export
944
+ <span class="icon-[tabler--file-export] size-4"></span> Start export
947
945
  </button>
948
946
  </div>
949
947
  {{/ui/modal}}
@@ -951,7 +949,7 @@ submitLabel="Delete account"}}
951
949
  {{!-- no #crumb input: the layout already renders the element the script reads --}}
952
950
  <input type="hidden" id="account-id" value="{{account.account}}">
953
951
 
954
- <script nonce="{{cspNonce}}">
952
+ <script data-cfasync="false" nonce="{{cspNonce}}">
955
953
  document.addEventListener('DOMContentLoaded', () => {
956
954
 
957
955
  const reconnectAccount = async () => {
@@ -1365,7 +1363,7 @@ submitLabel="Delete account"}}
1365
1363
  });
1366
1364
  </script>
1367
1365
 
1368
- <script nonce="{{cspNonce}}">
1366
+ <script data-cfasync="false" nonce="{{cspNonce}}">
1369
1367
  document.addEventListener('DOMContentLoaded', () => {
1370
1368
  let aborted = false;
1371
1369
 
@@ -1466,4 +1464,4 @@ submitLabel="Delete account"}}
1466
1464
  aborted = true;
1467
1465
  });
1468
1466
  })
1469
- </script>
1467
+ </script>
@@ -26,7 +26,7 @@
26
26
  </div>
27
27
  {{/ui/modal}}
28
28
 
29
- <script type="module" nonce="{{cspNonce}}">
29
+ <script data-cfasync="false" 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 -
@@ -13,9 +13,9 @@
13
13
 
14
14
  <div class="card-body space-y-4">
15
15
 
16
- {{> ui/form-field id="name" label="Full name" value=values.name error=errors.name hint="Full name of the user"}}
17
- {{> ui/form-field id="email" type="email" label="Email" value=values.email error=errors.email hint="Email address of the user"}}
18
- {{> ui/form-field id="expectedEmail" type="email" label="Expected identity" value=values.expectedEmail error=errors.expectedEmail hint="Optional. Setups through the hosted authentication form are rejected unless the identity they authenticate matches this address. Clear the field to remove the restriction."}}
16
+ {{> ui/form-field id="name" label="Full name" value=values.name error=errors.name hint="Name shown for this account in EmailEngine."}}
17
+ {{> ui/form-field id="email" type="email" label="Email address" value=values.email error=errors.email hint="Email address associated with this account."}}
18
+ {{> ui/form-field id="expectedEmail" type="email" label="Restrict sign-in to email (optional)" value=values.expectedEmail error=errors.expectedEmail hint="The hosted authentication form only accepts sign-ins that match this address. Leave blank to remove this restriction."}}
19
19
 
20
20
  </div>
21
21
  </div>
@@ -38,12 +38,12 @@
38
38
 
39
39
  {{> ui/form-field id="imap_auth_user" label="Username" value=values.imap_auth_user error=errors.imap_auth_user lpignore=true required=true}}
40
40
 
41
- {{> ui/form-field id="imap_auth_pass" type="password" label="Password" value=values.imap_auth_pass error=errors.imap_auth_pass lpignore=true placeholder=(when hasIMAPPass "Password is set but not shown...") hint="Only set if you want to change the current IMAP password"}}
41
+ {{> ui/form-field id="imap_auth_pass" type="password" label="Password" value=values.imap_auth_pass error=errors.imap_auth_pass lpignore=true placeholder=(when hasIMAPPass "Password saved") hint="Leave blank to keep the current IMAP password."}}
42
42
 
43
43
  {{> ui/form-field id="imap_host" label="Hostname" value=values.imap_host error=errors.imap_host lpignore=true required=true}}
44
44
  {{> ui/form-field id="imap_port" type="number" label="Port" value=values.imap_port error=errors.imap_port lpignore=true required=true}}
45
45
 
46
- {{> ui/checkbox id="imap_secure" label="Use TLS" checked=values.imap_secure error=errors.imap_secure tooltip="TLS (also known as SSL) is usually only needed when using port 993. For other ports EmailEngine falls back to using STARTTLS based encryption."}}
46
+ {{> ui/checkbox id="imap_secure" label="Use direct TLS" checked=values.imap_secure error=errors.imap_secure tooltip="Usually enabled for port 993. When disabled, EmailEngine uses STARTTLS if the server supports it."}}
47
47
 
48
48
  {{> ui/checkbox id="imap_tls_ignoreCertErrors" label="Allow invalid certificates" checked=values.imap_tls_ignoreCertErrors error=errors.imap_tls_ignoreCertErrors tooltip="Accept self-signed or otherwise invalid TLS certificates when connecting to the IMAP server of this account. The Allow Insecure Email Certificates option on the Security configuration page applies the same override to all accounts."}}
49
49
 
@@ -51,13 +51,13 @@
51
51
 
52
52
  {{/unless}}
53
53
 
54
- {{> ui/form-field id="imap_sentMailPath" label="Sent Mail folder" value=values.imap_sentMailPath error=errors.imap_sentMailPath lpignore=true placeholder='Folder path like "Sent Mail"' list="available-paths-list" hint='Copies of sent emails will be uploaded to this folder. Leave empty to use the default "Sent Mail" folder for this account.'}}
54
+ {{> ui/form-field id="imap_sentMailPath" label="Sent Mail folder" value=values.imap_sentMailPath error=errors.imap_sentMailPath lpignore=true placeholder='Folder path like "Sent Mail"' list="available-paths-list" hint='Store copies of sent emails in this folder. Leave blank to use the default "Sent Mail" folder for this account.'}}
55
55
 
56
- {{> ui/form-field id="imap_resyncDelay" type="number" label="Resync delay" value=values.imap_resyncDelay error=errors.imap_resyncDelay lpignore=true hint="Keep empty for default"}}
56
+ {{> ui/form-field id="imap_resyncDelay" type="number" label="Resync interval (seconds)" value=values.imap_resyncDelay error=errors.imap_resyncDelay lpignore=true hint="Time between full mailbox syncs. Leave blank to keep the current interval."}}
57
57
 
58
58
  {{/unless}}
59
59
 
60
- {{> ui/checkbox id="imap_disabled" label="Disable IMAP" checked=values.imap_disabled error=errors.imap_disabled tooltip="Disable IMAP if you are using this email account only for sending emails."}}
60
+ {{> ui/checkbox id="imap_disabled" label="Disable IMAP" checked=values.imap_disabled error=errors.imap_disabled tooltip="Stop syncing this mailbox while keeping the account available for sending email."}}
61
61
 
62
62
  </div>
63
63
  </div>
@@ -76,12 +76,12 @@
76
76
 
77
77
  {{> ui/form-field id="smtp_auth_user" label="Username" value=values.smtp_auth_user error=errors.smtp_auth_user lpignore=true required=true}}
78
78
 
79
- {{> ui/form-field id="smtp_auth_pass" type="password" label="Password" value=values.smtp_auth_pass error=errors.smtp_auth_pass lpignore=true placeholder=(when hasSMTPPass "Password is set but not shown...") hint="Only set if you want to change the current SMTP password"}}
79
+ {{> ui/form-field id="smtp_auth_pass" type="password" label="Password" value=values.smtp_auth_pass error=errors.smtp_auth_pass lpignore=true placeholder=(when hasSMTPPass "Password saved") hint="Leave blank to keep the current SMTP password."}}
80
80
 
81
81
  {{> ui/form-field id="smtp_host" label="Hostname" value=values.smtp_host error=errors.smtp_host lpignore=true required=true}}
82
82
  {{> ui/form-field id="smtp_port" type="number" label="Port" value=values.smtp_port error=errors.smtp_port lpignore=true required=true}}
83
83
 
84
- {{> ui/checkbox id="smtp_secure" label="Use TLS" checked=values.smtp_secure error=errors.smtp_secure tooltip="TLS (also known as SSL) is usually only needed when using port 465. For other ports EmailEngine falls back to using STARTTLS based encryption."}}
84
+ {{> ui/checkbox id="smtp_secure" label="Use direct TLS" checked=values.smtp_secure error=errors.smtp_secure tooltip="Usually enabled for port 465. When disabled, EmailEngine uses STARTTLS if the server supports it."}}
85
85
 
86
86
  {{> ui/checkbox id="smtp_tls_ignoreCertErrors" label="Allow invalid certificates" checked=values.smtp_tls_ignoreCertErrors error=errors.smtp_tls_ignoreCertErrors tooltip="Accept self-signed or otherwise invalid TLS certificates when connecting to the SMTP server of this account. The Allow Insecure Email Certificates option on the Security configuration page applies the same override to all accounts."}}
87
87
 
@@ -99,7 +99,7 @@
99
99
 
100
100
  <div class="card-body space-y-4">
101
101
 
102
- {{#> ui/form-field id="proxy" label="Proxy URL" error=errors.proxy hint="Fill this if you want to use a custom proxy for this account. Proxy URL must start with http://, https://, socks://, socks4:// or socks5://"}}
102
+ {{#> ui/form-field id="proxy" label="Proxy URL" error=errors.proxy hint="Use a custom proxy for this account. Start the URL with http://, https://, socks://, socks4://, or socks5://."}}
103
103
  <input type="text" class="input or-else-all{{#if errors.proxy}} is-invalid{{/if}}" id="proxy"
104
104
  placeholder="Connection URL like &quot;socks://localhost:1080&quot;&mldr;" value="{{values.proxy}}"
105
105
  name="proxy" data-target="proxy-status">
@@ -107,7 +107,7 @@
107
107
 
108
108
  <div>
109
109
  {{> ui/setting-ref name="smtpEhloName"}}
110
- {{> ui/form-field id="smtpEhloName" label="SMTP Greeting Hostname" value=values.smtpEhloName error=errors.smtpEhloName placeholder='Proxy hostname like "my.proxy.tld"...'}}
110
+ {{> ui/form-field id="smtpEhloName" label="SMTP greeting hostname" value=values.smtpEhloName error=errors.smtpEhloName placeholder="mail.example.com"}}
111
111
  <span class="helper-text">Hostname to use for the SMTP EHLO/HELO greeting. Leave empty to use the
112
112
  default <code>{{defaultSmtpEhloName}}</code>. If you are using a dedicated IP address, the hostname
113
113
  of that IP is preferred over this value.</span>
@@ -123,7 +123,7 @@
123
123
  clear.</span>
124
124
  {{/ui/form-field}}
125
125
 
126
- {{#> ui/form-field id="customHeaders" label="List of custom webhook request headers" error=errors.customHeaders hint="Keep one header per line. These headers will be added to the HTTP request when posting webhooks for this email account."}}
126
+ {{#> ui/form-field id="customHeaders" label="Custom webhook headers" error=errors.customHeaders hint="Enter one header per line in Header-Name: value format. These headers are sent with webhooks for this account."}}
127
127
  <textarea class="textarea font-mono w-full{{#if errors.customHeaders}} is-invalid{{/if}}" id="customHeaders"
128
128
  name="customHeaders" rows="5" spellcheck="false" data-enable-grammarly="false"
129
129
  placeholder="Custom headers like &quot;Authorization: Bearer secret_token&quot;&mldr;">{{values.customHeaders}}</textarea>
@@ -133,14 +133,14 @@
133
133
  </div>
134
134
 
135
135
  <div class="mb-6">
136
- {{> ui/btn label="Update account" type="submit" icon="icon-[tabler--device-floppy]"}}
136
+ {{> ui/btn label="Save changes" type="submit" icon="icon-[tabler--device-floppy]"}}
137
137
  </div>
138
138
  </form>
139
139
 
140
140
 
141
141
  <input type="hidden" id="availablePaths" value="{{availablePaths}}">
142
142
 
143
- <script nonce="{{cspNonce}}">
143
+ <script data-cfasync="false" 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
@@ -1,5 +1,5 @@
1
- {{#> ui/page-header title="Accounts" icon="icon-[tabler--users]" subtitle="Email accounts connected to EmailEngine for syncing and sending mail." badgeLabel=total badgeVariant="neutral" class="mb-6"}}
2
- {{> ui/btn label="Add an account" icon="icon-[tabler--user-plus]" overlay="#addAccount"}}
1
+ {{#> ui/page-header title="Accounts" icon="icon-[tabler--users]" subtitle="Connect and manage email accounts for syncing and sending email." badgeLabel=total badgeVariant="neutral" class="mb-6"}}
2
+ {{> ui/btn label="Add account" icon="icon-[tabler--user-plus]" overlay="#addAccount"}}
3
3
  {{/ui/page-header}}
4
4
 
5
5
  {{> ui/search-crumb parentHref="/admin/accounts" parentLabel="Accounts" query=query}}
@@ -11,7 +11,7 @@
11
11
  {{/if}}
12
12
 
13
13
  {{#> ui/delete-modal id="deleteAccount" noun="account" action="/admin/accounts"}}
14
- Are you sure you want to delete <strong class="delete-target-name"></strong>? All synced data for this account will be removed and this action cannot be undone.
14
+ Delete <strong class="delete-target-name"></strong> from EmailEngine? This removes its synced data, account-specific templates, access tokens, and queued emails. Emails on the mail server are not deleted. This action cannot be undone.
15
15
  {{/ui/delete-modal}}
16
16
 
17
17
  {{>add_account_modal}}
@@ -15,7 +15,7 @@ dropdown allows skipping the test. --}}
15
15
  submission - the payload schemas stripUnknown any posted copy. Do not reintroduce hidden
16
16
  inputs for them: echoing a client-controlled hint into the page was an XSS vector. --}}
17
17
 
18
- <input type="hidden" id="tz" name="tz" value="{{values.tz}}">
18
+ <input type="hidden" id="tz" name="tz" value="{{values.tz}}" data-ee-tz>
19
19
 
20
20
  {{#if autodetectFailed}}
21
21
  <div class="ee-alert ee-alert-info">
@@ -25,6 +25,17 @@ dropdown allows skipping the test. --}}
25
25
  </div>
26
26
  {{/if}}
27
27
 
28
+ {{!-- Set when the checking page sent the visitor here because its connection check did not pass,
29
+ so the form says what it is for instead of appearing out of nowhere. The per-protocol detail stays
30
+ on the page they read it on. --}}
31
+ {{#if checkFailed}}
32
+ <div class="ee-alert ee-alert-warning">
33
+ <span class="ee-icon ee-icon-alert-circle"></span>
34
+ <span>{{_ "We couldn't sign in to your mail server with those settings. Check them and try again."
35
+ templateLocale }}</span>
36
+ </div>
37
+ {{/if}}
38
+
28
39
  <div class="ee-form-grid">
29
40
  <div class="ee-form-col">
30
41
  <h6>{{_ "IMAP" templateLocale }}</h6>
@@ -256,7 +267,7 @@ dropdown allows skipping the test. --}}
256
267
  <details class="ee-dropdown">
257
268
  <summary id="submit-settings-btn-down" class="ee-btn ee-btn-neutral ee-dropdown-toggle"
258
269
  aria-haspopup="menu">
259
- <span class="ee-sr-only">Toggle Dropdown</span>
270
+ <span class="ee-sr-only">{{_ "Toggle Dropdown" templateLocale }}</span>
260
271
  <span class="ee-icon ee-icon-chevron-down"></span>
261
272
  </summary>
262
273
  <ul class="ee-dropdown-menu" role="menu" aria-labelledby="submit-settings-btn-down">
@@ -274,7 +285,7 @@ focus ring on) the corner close button --}}
274
285
  <dialog id="testResponseModal" class="ee-modal ee-modal-wide" aria-labelledby="testResponseModalLabel" autofocus>
275
286
  <div class="ee-modal-header">
276
287
  <h3 class="ee-modal-title" id="testResponseModalLabel">{{_ "Connection test failed" templateLocale }}</h3>
277
- <button type="button" class="ee-modal-close" aria-label="Close" data-modal-close>
288
+ <button type="button" class="ee-modal-close" aria-label="{{_ "Close" templateLocale }}" data-modal-close>
278
289
  <span class="ee-icon ee-icon-x"></span>
279
290
  </button>
280
291
  </div>
@@ -290,7 +301,7 @@ focus ring on) the corner close button --}}
290
301
 
291
302
  <input type="hidden" id="autoTest" value="{{#if autoTest}}true{{/if}}">
292
303
 
293
- <script nonce="{{cspNonce}}">
304
+ <script data-cfasync="false" nonce="{{cspNonce}}">
294
305
  document.addEventListener('DOMContentLoaded', () => {
295
306
 
296
307
  let formTested = false;
@@ -303,139 +314,19 @@ focus ring on) the corner close button --}}
303
314
  let submitDownElm = document.getElementById('submit-settings-btn-down')
304
315
  let errorsListElm = document.getElementById('test-errors-list')
305
316
 
306
- // eeButtonBusy() below is feedback only: it greys the real submit <button> out and spins its
307
- // icon while a submit is in flight, so the wait for the account to be created is visible (the
308
- // dropdown toggle is a <summary> and the skip link an <a>, neither has disabled semantics).
309
- // The actual duplicate-submit guard is the formSubmitting latch in submitForm(), which every
310
- // path routes through - this form submits through myForm.submit(), which fires no submit
311
- // event, so the shared guard in static/js/public.js never sees it.
312
- let formSubmitting = false;
313
- let submitRecoveryTimer = null;
314
- let resetSubmitGuard = () => {
315
- formSubmitting = false;
316
- if (submitRecoveryTimer) {
317
- clearTimeout(submitRecoveryTimer);
318
- submitRecoveryTimer = null;
319
- }
320
- eeButtonBusy(submitElm, false);
321
- };
322
- let submitForm = () => {
323
- // The server claims a single-use nonce, so a second POST from a double-click loses the race and
324
- // renders a 403 even though the first request created the account. Submit at most once and
325
- // disable the submit controls so a duplicate submission cannot fire.
326
- if (formSubmitting) {
327
- return;
328
- }
329
- // myForm.submit() below bypasses HTML5 constraint validation (unlike a real submit button), so
330
- // run it explicitly - otherwise a cleared required field round-trips to the server, 400s, and the
331
- // re-render wipes the password fields. Bail (without latching the guard) so the user can fix it.
332
- if (!myForm.reportValidity()) {
333
- return;
334
- }
335
- formSubmitting = true;
336
- eeButtonBusy(submitElm, true);
337
- // Recovery timer for an aborted submit: a successful submit navigates away (this page and the
338
- // timer are discarded) and a validation error reloads the page fresh, so this only fires when the
339
- // navigation never happened - the user cancelled it (Esc / Stop) while the page stayed alive. There
340
- // is no DOM event for an aborted navigation, so without this the one-shot guard would leave the form
341
- // permanently unsubmittable. Re-enabling is safe: the server's single-use nonce is the real
342
- // double-submit guard, so at worst a later duplicate POST is rejected server-side. The delay is a
343
- // generous upper bound on a create round trip so it never re-arms a genuinely in-flight submit.
344
- submitRecoveryTimer = setTimeout(resetSubmitGuard, 20 * 1000);
345
- myForm.submit();
346
- };
347
-
348
- // Reset the one-shot guard when the page is restored from the back-forward cache (Back after a
349
- // submit): bfcache keeps JS state, so without this the flag stays set and the buttons stay disabled,
350
- // permanently deadening the form.
351
- window.addEventListener('pageshow', e => {
352
- if (!e.persisted) {
353
- return;
354
- }
355
- resetSubmitGuard();
356
- });
357
-
358
- let appendLinkified = (parentElm, text) => {
359
- // Split on URLs and append text nodes + anchors via DOM APIs so server-provided text is
360
- // never parsed as HTML (avoids an innerHTML injection sink).
361
- let parts = String(text == null ? '' : text).split(/(https?:\/\/[^\s]+)/g);
362
- for (let part of parts) {
363
- if (/^https?:\/\//.test(part)) {
364
- let a = document.createElement('a');
365
- a.href = part;
366
- a.target = '_blank';
367
- a.rel = 'noopener noreferrer';
368
- a.textContent = part;
369
- parentElm.appendChild(a);
370
- } else if (part) {
371
- parentElm.appendChild(document.createTextNode(part));
372
- }
373
- }
374
- }
375
-
376
- let addErrorRow = (type, text, extraLabel, extraText) => {
377
- let keyElm = document.createElement('dt');
378
- let valueContainerElm = document.createElement('dd');
379
- let valueElm = document.createElement('div');
380
-
381
- valueElm.classList.add('ee-error-text')
382
-
383
- keyElm.textContent = type;
384
- valueElm.textContent = text;
385
-
386
- valueContainerElm.append(valueElm);
387
-
388
- errorsListElm.appendChild(keyElm);
389
- errorsListElm.appendChild(valueContainerElm);
390
-
391
- if (extraLabel && extraText) {
392
-
393
- let extraLabelElm = document.createElement('div');
394
- extraLabelElm.textContent = extraLabel;
395
-
396
- let extraTextElm = document.createElement('small');
397
- appendLinkified(extraTextElm, extraText);
317
+ {{!-- The busy button is feedback only: it greys the real submit <button> out and spins its
318
+ icon while a submit is in flight, so the wait for the account to be created is visible (the
319
+ dropdown toggle is a <summary> and the skip link an <a>, neither has disabled semantics).
320
+ The duplicate-submit guard is inside eeSubmitOnce (static/js/public.js), which every submit
321
+ path here routes through. --}}
322
+ let submitForm = eeSubmitOnce(myForm, { button: submitElm, validate: true, recoveryMs: 20 * 1000 });
398
323
 
399
- valueContainerElm.appendChild(extraLabelElm);
400
- valueContainerElm.appendChild(extraTextElm);
401
- }
402
- }
324
+ {{!-- Both the row layout and the three response shapes it has to tell apart are shared with
325
+ the checking page (static/js/public.js); only what happens after belongs to this page. --}}
326
+ {{> public_test_labels}}
403
327
 
404
328
  let showErrorPopup = (data) => {
405
- data = data || {}
406
-
407
- errorsListElm.innerHTML = '';
408
-
409
- if (data.error && !data.fields) {
410
- // A Hapi/Boom error body carries the human-readable text in data.message and only the
411
- // status name in data.error ('Forbidden', 'Too Many Requests'); the client-side catch
412
- // path passes { error: Error } instead, hence the fallbacks.
413
- addErrorRow(`{{_ "Error" templateLocale }}`, data.message || data.error.message || data.error)
414
- } else if (data.fields) {
415
- addErrorRow(`{{_ "Invalid settings" templateLocale }}`, data.message);
416
- for (let field of data.fields) {
417
- addErrorRow('-', field.message);
418
- }
419
- } else {
420
- if (!data.imap || !data.imap.success) {
421
- let error = data.imap && data.imap.error || `{{_ "Couldn't connect to IMAP server" templateLocale }}`
422
- if (data.imap && data.imap.responseText) {
423
- addErrorRow('IMAP', error, `{{_ "Server response:" templateLocale }}`, data.imap.responseText);
424
- } else {
425
- addErrorRow('IMAP', error);
426
- }
427
- }
428
-
429
- if (!data.smtp || !data.smtp.success) {
430
- let error = data.smtp && data.smtp.error || `{{_ "Couldn't connect to SMTP server" templateLocale }}`
431
- if (data.smtp && data.smtp.responseText) {
432
- addErrorRow('SMTP', error, `{{_ "Server response:" templateLocale }}`, data.smtp.responseText);
433
- } else {
434
- addErrorRow('SMTP', error);
435
- }
436
- }
437
- }
438
-
329
+ eeRenderTestErrors(errorsListElm, data, TEST_ERROR_LABELS);
439
330
  document.getElementById('testResponseModal').showModal();
440
331
  }
441
332
 
@@ -464,35 +355,7 @@ focus ring on) the corner close button --}}
464
355
  }
465
356
  }
466
357
 
467
- let testSettings = async () => {
468
- let formData = new FormData(myForm);
469
- let body = {}
470
- for (var pair of formData.entries()) {
471
- body[pair[0]] = pair[1];
472
- }
473
-
474
- const res = await fetch('/accounts/new/imap/test', {
475
- method: 'post',
476
- headers: { 'content-type': 'application/json' },
477
- body: JSON.stringify(body)
478
- });
479
-
480
- if (!res.ok) {
481
- try {
482
- let errData = await res.json();
483
- return errData
484
- } catch (err) {
485
- // ignore
486
- console.error(err)
487
- }
488
-
489
- throw new Error(`{{_ "Request failed." templateLocale}} status: ${res.status}`);
490
- }
491
-
492
- const data = await res.json();
493
-
494
- return data;
495
- }
358
+ let testSettings = () => eePostConnectionTest(myForm, { requestFailedText: REQUEST_FAILED_TEXT });
496
359
 
497
360
  let runTest = (continueIfSuccessful) => {
498
361
  if (formTesting) {
@@ -577,16 +440,7 @@ focus ring on) the corner close button --}}
577
440
  let imapPortElm = document.getElementById('imap_port');
578
441
  let smtpPortElm = document.getElementById('smtp_port');
579
442
 
580
- try {
581
- if (typeof Intl !== 'undefined' && Intl && typeof Intl.DateTimeFormat === 'function') {
582
- let tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
583
- if (tz) {
584
- document.getElementById('tz').value = tz;
585
- }
586
- }
587
- } catch (err) {
588
- // Intl probably not supported
589
- }
443
+ {{!-- the tz field carries data-ee-tz, which static/js/public.js fills --}}
590
444
 
591
445
  imapPortElm.addEventListener('change', () => checkPort('imap'));
592
446
  imapPortElm.addEventListener('click', () => checkPort('imap'));