emailengine-app 2.84.2 → 2.86.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 (164) hide show
  1. package/.ncurc.js +29 -9
  2. package/.prettierignore +5 -1
  3. package/.prettierrc.js +2 -0
  4. package/.release-please-manifest.json +1 -1
  5. package/CHANGELOG.md +107 -0
  6. package/Dockerfile +20 -1
  7. package/ENVIRONMENT.md +139 -0
  8. package/README.md +2 -2
  9. package/bin/emailengine.js +434 -408
  10. package/config/default.toml +2 -0
  11. package/copy-static-files.sh +41 -14
  12. package/data/google-crawlers.json +1 -1
  13. package/data/public_suffix_list.dat +16563 -0
  14. package/eslint.config.js +81 -99
  15. package/lib/account-assignment.js +19 -0
  16. package/lib/account.js +230 -170
  17. package/lib/api-error-codes.js +49 -0
  18. package/lib/api-reference/format.js +4 -3
  19. package/lib/api-reference/model.js +6 -1
  20. package/lib/api-routes/account-routes.js +255 -38
  21. package/lib/api-routes/blocklist-routes.js +91 -4
  22. package/lib/api-routes/delivery-test-routes.js +27 -4
  23. package/lib/api-routes/export-routes.js +28 -2
  24. package/lib/api-routes/gateway-routes.js +110 -12
  25. package/lib/api-routes/index.js +4 -0
  26. package/lib/api-routes/license-routes.js +2 -2
  27. package/lib/api-routes/mailbox-routes.js +44 -5
  28. package/lib/api-routes/message-routes.js +112 -10
  29. package/lib/api-routes/oauth2-app-routes.js +63 -23
  30. package/lib/api-routes/outbox-routes.js +97 -52
  31. package/lib/api-routes/permission-map.js +67 -7
  32. package/lib/api-routes/scoped-routes.js +74 -0
  33. package/lib/api-routes/settings-routes.js +34 -6
  34. package/lib/api-routes/stats-routes.js +5 -1
  35. package/lib/api-routes/submit-routes.js +337 -309
  36. package/lib/api-routes/template-routes.js +45 -8
  37. package/lib/api-routes/token-routes.js +152 -100
  38. package/lib/api-routes/webhook-delivery-routes.js +262 -0
  39. package/lib/api-routes/webhook-route-routes.js +132 -6
  40. package/lib/bounce-detect.js +397 -205
  41. package/lib/calendar-event.js +81 -1
  42. package/lib/consts.js +38 -45
  43. package/lib/db.js +14 -6
  44. package/lib/delivery-error.js +6 -0
  45. package/lib/deprecations.js +270 -0
  46. package/lib/email-client/base-client.js +137 -184
  47. package/lib/email-client/fallback-poll.js +62 -0
  48. package/lib/email-client/gmail-client.js +60 -22
  49. package/lib/email-client/imap/adaptive-idle-store.js +73 -0
  50. package/lib/email-client/imap/adaptive-idle.js +278 -0
  51. package/lib/email-client/imap/connection-errors.js +14 -1
  52. package/lib/email-client/imap/idle-settings.js +31 -5
  53. package/lib/email-client/imap/listing-diff.js +37 -0
  54. package/lib/email-client/imap/mailbox.js +372 -242
  55. package/lib/email-client/imap/subconnection.js +8 -30
  56. package/lib/email-client/imap/sync-operations.js +220 -127
  57. package/lib/email-client/imap-client.js +228 -164
  58. package/lib/email-client/message-builder.js +14 -79
  59. package/lib/email-client/notification-handler.js +1 -2
  60. package/lib/email-client/outlook-client.js +372 -338
  61. package/lib/email-client/smtp-pool-manager.js +16 -13
  62. package/lib/email-client/sync-state-fields.js +19 -0
  63. package/lib/encrypt.js +157 -41
  64. package/lib/enum-descriptions.js +3 -1
  65. package/lib/env-setting-overrides.js +288 -0
  66. package/lib/export-worker.js +751 -0
  67. package/lib/export.js +64 -15
  68. package/lib/gateway.js +19 -4
  69. package/lib/get-raw-email.js +25 -107
  70. package/lib/hapi-request-logger.js +107 -0
  71. package/lib/health.js +75 -0
  72. package/lib/imapproxy/imap-core/README.md +6 -5
  73. package/lib/lock-run.js +119 -0
  74. package/lib/logger-consts.js +48 -0
  75. package/lib/logger.js +1 -1
  76. package/lib/lua/z-head-scores.lua +28 -0
  77. package/lib/mcp/tools.js +37 -8
  78. package/lib/network-errors.js +1 -1
  79. package/lib/node-version.js +24 -0
  80. package/lib/notify-attachments.js +36 -0
  81. package/lib/oauth/outlook-mailbox.js +35 -0
  82. package/lib/oauth/state.js +24 -0
  83. package/lib/oauth2-apps.js +631 -656
  84. package/lib/outbox.js +184 -54
  85. package/lib/parse-message.js +3 -3
  86. package/lib/pbkdf2-phc.js +1 -1
  87. package/lib/privileged-settings.js +2 -2
  88. package/lib/queue-browser/definitions.js +11 -0
  89. package/lib/queue-browser/index.js +68 -19
  90. package/lib/queue-job-actions.js +18 -1
  91. package/lib/queue-retention.js +48 -12
  92. package/lib/queue-stats.js +11 -2
  93. package/lib/read-env-value.js +3 -0
  94. package/lib/redis-memory-warnings.js +99 -0
  95. package/lib/redis-reconnect.js +29 -0
  96. package/lib/request-timing.js +23 -0
  97. package/lib/respawn-backoff.js +35 -0
  98. package/lib/rewrite-text-nodes.js +19 -59
  99. package/lib/schemas.js +164 -40
  100. package/lib/settings.js +6 -2
  101. package/lib/smtp-auth.js +19 -1
  102. package/lib/sso.js +1 -1
  103. package/lib/swagger-options.js +1 -1
  104. package/lib/thread-diagnostics.js +63 -0
  105. package/lib/timezones.js +109 -0
  106. package/lib/tls/provision.js +6 -3
  107. package/lib/token-audit-log.js +19 -20
  108. package/lib/token-permission-view.js +7 -6
  109. package/lib/tools.js +48 -51
  110. package/lib/totp.js +2 -5
  111. package/lib/translations.js +1 -2
  112. package/lib/ui-routes/account-routes.js +475 -454
  113. package/lib/ui-routes/account-setup.js +99 -0
  114. package/lib/ui-routes/admin-config-routes.js +152 -100
  115. package/lib/ui-routes/admin-entities-routes.js +93 -21
  116. package/lib/ui-routes/auth-routes.js +90 -38
  117. package/lib/ui-routes/imap-idle-field.js +1 -1
  118. package/lib/ui-routes/internals-routes.js +5 -0
  119. package/lib/ui-routes/oauth-config-routes.js +124 -82
  120. package/lib/ui-routes/outlook-subscription-view.js +1 -1
  121. package/lib/ui-routes/overridable-fields.js +84 -0
  122. package/lib/ui-routes/queue-routes.js +8 -5
  123. package/lib/ui-routes/route-helpers.js +19 -3
  124. package/lib/ui-routes/settings-page.js +6 -0
  125. package/lib/ui-routes/tls-config-routes.js +58 -15
  126. package/lib/utils/back-off.js +82 -0
  127. package/lib/utils/decode-headers.js +3 -12
  128. package/lib/utils/filter-empty.js +20 -0
  129. package/lib/utils/int-setting.js +48 -0
  130. package/lib/utils/murmurhash3.js +66 -0
  131. package/lib/utils/public-suffix.js +122 -0
  132. package/lib/utils/random-id.js +26 -0
  133. package/lib/utils/tracking-settings.js +35 -0
  134. package/lib/utils/version.js +74 -0
  135. package/lib/web-safe-html.js +18 -105
  136. package/lib/webhook-delivery.js +461 -0
  137. package/lib/webhook-failures.js +132 -0
  138. package/lib/webhook-request.js +29 -1
  139. package/lib/webhook-routing.js +56 -0
  140. package/lib/webhook-test.js +88 -0
  141. package/lib/webhooks.js +93 -45
  142. package/lib/worker-rpc-error.js +2 -1
  143. package/package.json +37 -38
  144. package/sbom.json +7902 -1
  145. package/server.js +784 -518
  146. package/static/js/ace/ace.js +1 -1
  147. package/static/licenses.html +225 -1060
  148. package/translations/messages.pot +62 -63
  149. package/views/config/ai.hbs +1 -1
  150. package/views/config/security.hbs +24 -2
  151. package/views/config/service.hbs +47 -0
  152. package/views/config/webhooks.hbs +36 -0
  153. package/views/internals/index.hbs +8 -0
  154. package/views/partials/queue_retention_note.hbs +12 -8
  155. package/views/partials/ui/env-managed-alert.hbs +16 -7
  156. package/views/partials/webhook_form.hbs +1 -1
  157. package/views/suppression-lists/index.hbs +1 -1
  158. package/workers/api.js +840 -611
  159. package/workers/export.js +17 -632
  160. package/workers/imap.js +13 -0
  161. package/workers/smtp.js +9 -11
  162. package/workers/submit.js +1 -1
  163. package/workers/webhooks.js +18 -448
  164. package/lib/email-client/outlook-fallback-poll.js +0 -30
@@ -1,7 +1,7 @@
1
1
  msgid ""
2
2
  msgstr ""
3
3
  "Content-Type: text/plain; charset=ascii\n"
4
- "POT-Creation-Date: 2026-10-18 16:36+0000\n"
4
+ "POT-Creation-Date: 2026-10-21 21:45+0000\n"
5
5
 
6
6
  #: lib/autodetect-imap-settings.js:160
7
7
  msgid ""
@@ -11,113 +11,112 @@ msgid ""
11
11
  "connect your account."
12
12
  msgstr ""
13
13
 
14
- #: lib/tools.js:1738
14
+ #: lib/tools.js:1749
15
15
  #: lib/ui-routes/unsubscribe-routes.js:34
16
16
  #: lib/ui-routes/unsubscribe-routes.js:102
17
17
  msgid "Invalid input"
18
18
  msgstr ""
19
19
 
20
- #: lib/tools.js:2738
20
+ #: lib/tools.js:2713
21
21
  msgid "Signature validation failed"
22
22
  msgstr ""
23
23
 
24
- #: lib/tools.js:2761
25
- #: lib/tools.js:2767
26
- #: lib/tools.js:2772
27
- #: lib/ui-routes/account-routes.js:1327
24
+ #: lib/tools.js:2736
25
+ #: lib/tools.js:2742
26
+ #: lib/tools.js:2747
27
+ #: lib/ui-routes/account-setup.js:80
28
28
  msgid "Invalid or expired account setup URL"
29
29
  msgstr ""
30
30
 
31
- #: lib/ui-routes/account-routes.js:486
32
- #: lib/ui-routes/account-routes.js:530
33
- #: lib/ui-routes/account-routes.js:850
34
- #: lib/ui-routes/account-routes.js:927
35
- #: lib/ui-routes/account-routes.js:940
36
- #: lib/ui-routes/account-routes.js:987
37
- #: lib/ui-routes/account-routes.js:1203
38
- #: lib/ui-routes/account-routes.js:1394
31
+ #: lib/ui-routes/account-routes.js:229
32
+ #: lib/ui-routes/account-routes.js:787
33
+ #: lib/ui-routes/account-routes.js:939
34
+ #: lib/ui-routes/account-routes.js:952
35
+ #: lib/ui-routes/account-routes.js:999
36
+ #: lib/ui-routes/account-routes.js:1208
37
+ #: lib/ui-routes/account-routes.js:1360
39
38
  #: lib/ui-routes/route-helpers.js:350
40
- #: workers/api.js:2346
41
- #: workers/api.js:2421
39
+ #: lib/ui-routes/route-helpers.js:373
40
+ #: workers/api.js:2479
42
41
  msgid "Email Account Setup"
43
42
  msgstr ""
44
43
 
45
- #: lib/ui-routes/account-routes.js:555
46
- #: lib/ui-routes/account-routes.js:587
47
- #: lib/ui-routes/unsubscribe-routes.js:74
48
- msgid "Invalid request. Check your input and try again."
44
+ #: lib/ui-routes/account-routes.js:369
45
+ msgid "Too many attempts for this setup link. Request a new setup link to continue."
49
46
  msgstr ""
50
47
 
51
- #: lib/ui-routes/account-routes.js:731
52
- msgid "Too many attempts for this setup link. Request a new setup link to continue."
48
+ #: lib/ui-routes/account-routes.js:812
49
+ #: lib/ui-routes/account-routes.js:846
50
+ #: lib/ui-routes/unsubscribe-routes.js:74
51
+ msgid "Invalid request. Check your input and try again."
53
52
  msgstr ""
54
53
 
55
- #: lib/ui-routes/account-routes.js:974
56
- #: lib/ui-routes/account-routes.js:1377
54
+ #: lib/ui-routes/account-routes.js:986
55
+ #: lib/ui-routes/account-routes.js:1343
57
56
  msgid "Couldn't set up account. Try again."
58
57
  msgstr ""
59
58
 
60
- #: lib/ui-routes/account-routes.js:1062
61
- #: lib/ui-routes/account-routes.js:1102
62
- #: lib/ui-routes/admin-entities-routes.js:1953
59
+ #: lib/ui-routes/account-routes.js:1076
60
+ #: lib/ui-routes/account-routes.js:1116
61
+ #: lib/ui-routes/admin-entities-routes.js:1984
63
62
  msgid "Server hostname was not found"
64
63
  msgstr ""
65
64
 
66
- #: lib/ui-routes/account-routes.js:1065
67
- #: lib/ui-routes/account-routes.js:1105
68
- #: lib/ui-routes/admin-entities-routes.js:1956
65
+ #: lib/ui-routes/account-routes.js:1079
66
+ #: lib/ui-routes/account-routes.js:1119
67
+ #: lib/ui-routes/admin-entities-routes.js:1987
69
68
  msgid "Invalid username or password"
70
69
  msgstr ""
71
70
 
72
- #: lib/ui-routes/account-routes.js:1070
73
- #: lib/ui-routes/account-routes.js:1122
74
- #: lib/ui-routes/admin-entities-routes.js:1973
71
+ #: lib/ui-routes/account-routes.js:1084
72
+ #: lib/ui-routes/account-routes.js:1136
73
+ #: lib/ui-routes/admin-entities-routes.js:2004
75
74
  msgid "Connection timed out"
76
75
  msgstr ""
77
76
 
78
- #: lib/ui-routes/account-routes.js:1076
79
- #: lib/ui-routes/account-routes.js:1125
80
- #: lib/ui-routes/admin-entities-routes.js:1976
77
+ #: lib/ui-routes/account-routes.js:1090
78
+ #: lib/ui-routes/account-routes.js:1139
79
+ #: lib/ui-routes/admin-entities-routes.js:2007
81
80
  msgid "Could not connect to server"
82
81
  msgstr ""
83
82
 
84
- #: lib/ui-routes/account-routes.js:1089
85
- #: lib/ui-routes/account-routes.js:1093
86
- #: lib/ui-routes/account-routes.js:1114
87
- #: lib/ui-routes/account-routes.js:1118
88
- #: lib/ui-routes/admin-entities-routes.js:1965
89
- #: lib/ui-routes/admin-entities-routes.js:1969
83
+ #: lib/ui-routes/account-routes.js:1103
84
+ #: lib/ui-routes/account-routes.js:1107
85
+ #: lib/ui-routes/account-routes.js:1128
86
+ #: lib/ui-routes/account-routes.js:1132
87
+ #: lib/ui-routes/admin-entities-routes.js:1996
88
+ #: lib/ui-routes/admin-entities-routes.js:2000
90
89
  msgid "TLS protocol error"
91
90
  msgstr ""
92
91
 
93
- #: lib/ui-routes/account-routes.js:1108
94
- #: lib/ui-routes/admin-entities-routes.js:1959
92
+ #: lib/ui-routes/account-routes.js:1122
93
+ #: lib/ui-routes/admin-entities-routes.js:1990
95
94
  msgid "Authentication credentials were not provided"
96
95
  msgstr ""
97
96
 
98
- #: lib/ui-routes/account-routes.js:1111
99
- #: lib/ui-routes/admin-entities-routes.js:1962
97
+ #: lib/ui-routes/account-routes.js:1125
98
+ #: lib/ui-routes/admin-entities-routes.js:1993
100
99
  msgid "OAuth2 authentication failed"
101
100
  msgstr ""
102
101
 
103
- #: lib/ui-routes/account-routes.js:1128
104
- #: lib/ui-routes/admin-entities-routes.js:1979
102
+ #: lib/ui-routes/account-routes.js:1142
103
+ #: lib/ui-routes/admin-entities-routes.js:2010
105
104
  msgid "Unexpected server response"
106
105
  msgstr ""
107
106
 
108
- #: lib/ui-routes/account-routes.js:1315
107
+ #: lib/ui-routes/account-setup.js:68
109
108
  msgid "Temporary error, please try again"
110
109
  msgstr ""
111
110
 
112
- #: lib/ui-routes/admin-config-routes.js:195
111
+ #: lib/ui-routes/admin-config-routes.js:199
113
112
  msgid "Invalid API key for OpenAI"
114
113
  msgstr ""
115
114
 
116
- #: lib/ui-routes/oauth-config-routes.js:267
115
+ #: lib/ui-routes/oauth-config-routes.js:266
117
116
  msgid "Unknown"
118
117
  msgstr ""
119
118
 
120
- #: lib/ui-routes/oauth-config-routes.js:274
119
+ #: lib/ui-routes/oauth-config-routes.js:273
121
120
  #: views/config/license.hbs:20
122
121
  #: views/partials/queue_retention_note.hbs:10
123
122
  #: views/queues/index.hbs:54
@@ -127,7 +126,7 @@ msgid_plural "%d days"
127
126
  msgstr[0] ""
128
127
  msgstr[1] ""
129
128
 
130
- #: lib/ui-routes/oauth-config-routes.js:276
129
+ #: lib/ui-routes/oauth-config-routes.js:275
131
130
  msgid "Indefinite"
132
131
  msgstr ""
133
132
 
@@ -414,7 +413,7 @@ msgstr[0] ""
414
413
  msgstr[1] ""
415
414
 
416
415
  #: views/error.hbs:6
417
- #: workers/api.js:3216
416
+ #: workers/api.js:3339
418
417
  msgid "Something went wrong"
419
418
  msgstr ""
420
419
 
@@ -530,37 +529,37 @@ msgid ""
530
529
  "received."
531
530
  msgstr ""
532
531
 
533
- #: workers/api.js:2273
532
+ #: workers/api.js:2393
534
533
  msgid ""
535
534
  "The sign-in was cancelled or the requested access was not granted. Open the "
536
535
  "account setup link again to retry."
537
536
  msgstr ""
538
537
 
539
- #: workers/api.js:2282
538
+ #: workers/api.js:2402
540
539
  msgid "Sign-in with the email provider failed: %s"
541
540
  msgstr ""
542
541
 
543
- #: workers/api.js:2286
542
+ #: workers/api.js:2406
544
543
  msgid "Sign-in with the email provider failed: no authorization code was received"
545
544
  msgstr ""
546
545
 
547
- #: workers/api.js:2292
546
+ #: workers/api.js:2410
548
547
  msgid "Sign-in with the email provider failed: the request state is not valid"
549
548
  msgstr ""
550
549
 
551
- #: workers/api.js:2298
550
+ #: workers/api.js:2419
552
551
  msgid ""
553
552
  "The account setup session has expired or was already used. Open the account "
554
553
  "setup link again to retry."
555
554
  msgstr ""
556
555
 
557
- #: workers/api.js:2305
556
+ #: workers/api.js:2425
558
557
  msgid ""
559
558
  "Sign-in with the email provider failed: the stored setup session is not "
560
559
  "valid"
561
560
  msgstr ""
562
561
 
563
- #: workers/api.js:3215
564
- #: workers/api.js:3327
562
+ #: workers/api.js:3338
563
+ #: workers/api.js:3461
565
564
  msgid "Requested page not found"
566
565
  msgstr ""
@@ -106,7 +106,7 @@
106
106
 
107
107
  <div>
108
108
  <div class="text-base-content/60 float-right code-link">[<a
109
- href="https://learn.emailengine.app/docs/advanced/pre-processing" target="_blank"
109
+ href="https://learn.emailengine.app/docs/webhooks/pre-processing" target="_blank"
110
110
  rel="noopener noreferrer" referrerpolicy="no-referrer"
111
111
  class="link link-animated">documentation</a>]
112
112
 
@@ -55,6 +55,28 @@
55
55
  rel="noopener noreferrer" class="link link-animated">the token log endpoint</a>. Logging starts when enabled and adds a storage write to each authenticated request.</span>
56
56
  </div>
57
57
 
58
+ <div class="grid gap-4 sm:grid-cols-2">
59
+ <div>
60
+ {{> ui/setting-ref name="tokenLogEntries"}}
61
+ {{#> ui/form-field id="settingsTokenLogEntries" label="Requests kept per token" error=errors.tokenLogEntries}}
62
+ <input type="number" min="1" class="input{{#if errors.tokenLogEntries}} is-invalid{{/if}}"
63
+ id="settingsTokenLogEntries" name="tokenLogEntries" value="{{values.tokenLogEntries}}" data-lpignore="true"
64
+ autocomplete="off" />
65
+ <span class="helper-text">A full log of typical entries takes roughly 170KB of Redis per token.</span>
66
+ {{/ui/form-field}}
67
+ </div>
68
+
69
+ <div>
70
+ {{> ui/setting-ref name="tokenLogAge"}}
71
+ {{#> ui/form-field id="settingsTokenLogAge" label="Log retention after last use (days)" error=errors.tokenLogAge}}
72
+ <input type="number" min="0.01" step="any" class="input{{#if errors.tokenLogAge}} is-invalid{{/if}}"
73
+ id="settingsTokenLogAge" name="tokenLogAge" value="{{values.tokenLogAge}}" data-lpignore="true"
74
+ autocomplete="off" />
75
+ <span class="helper-text">A token nobody uses takes its log with it after this long.</span>
76
+ {{/ui/form-field}}
77
+ </div>
78
+ </div>
79
+
58
80
  {{/ui/card}}
59
81
 
60
82
  {{#> ui/card title="Secrets and Encryption" id="secrets" bodyClass="space-y-4"}}
@@ -70,13 +92,13 @@
70
92
  </div>
71
93
 
72
94
  <div>
73
- {{> ui/setting-ref name="EENGINE_SECRET" href="https://learn.emailengine.app/docs/advanced/encryption"}}
95
+ {{> ui/setting-ref name="EENGINE_SECRET" href="https://learn.emailengine.app/docs/deployment/encryption"}}
74
96
 
75
97
  {{#> ui/checkbox id="encryption" label="Data Encryption" checked=encryption disabled=true}}
76
98
  {{> ui/badge label=(when encryption "enabled" "disabled") variant=(when encryption "success" "error")}}
77
99
  {{/ui/checkbox}}
78
100
  <span class="helper-text">Set <code>EENGINE_SECRET</code> environment variable at startup to enable. <a
79
- href="https://learn.emailengine.app/docs/advanced/encryption" target="_blank"
101
+ href="https://learn.emailengine.app/docs/deployment/encryption" target="_blank"
80
102
  rel="noopener noreferrer" referrerpolicy="no-referrer" class="link link-animated">Learn
81
103
  more</a></span>
82
104
  </div>
@@ -33,6 +33,9 @@
33
33
  {{#> ui/form-field id="settingsServiceTimezone" label="Timezone" error=errors.timezone}}
34
34
  <select id="settingsServiceTimezone" class="select max-w-md{{#if errors.timezone}} is-invalid{{/if}}"
35
35
  name="timezone">
36
+ {{#unless values.timezone}}
37
+ <option value="" selected>Not set</option>
38
+ {{/unless}}
36
39
  {{#each timezones}}
37
40
  <option value="{{timezone}}" {{#if selected}}selected{{/if}}>{{name}}</option>
38
41
  {{/each}}
@@ -114,6 +117,50 @@
114
117
  {{/ui/form-field}}
115
118
  </div>
116
119
 
120
+ <div class="grid gap-4 sm:grid-cols-2 mt-4">
121
+ <div>
122
+ {{> ui/setting-ref name="queueKeepFailed"}}
123
+ {{#> ui/form-field id="settingsQueueKeepFailed" label="Failed job limit" error=errors.queueKeepFailed}}
124
+ <input type="number" min="1" class="input{{#if errors.queueKeepFailed}} is-invalid{{/if}}"
125
+ id="settingsQueueKeepFailed" name="queueKeepFailed" value="{{values.queueKeepFailed}}" data-lpignore="true"
126
+ autocomplete="off" />
127
+ <span class="helper-text">Failed jobs retained per queue, at least. A failed job is the only record that a
128
+ delivery was given up on.</span>
129
+ {{/ui/form-field}}
130
+ </div>
131
+
132
+ <div>
133
+ {{> ui/setting-ref name="queueKeepFailedAge"}}
134
+ {{#> ui/form-field id="settingsQueueKeepFailedAge" label="Failed job retention (days)" error=errors.queueKeepFailedAge}}
135
+ <input type="number" min="0.01" step="any" class="input{{#if errors.queueKeepFailedAge}} is-invalid{{/if}}"
136
+ id="settingsQueueKeepFailedAge" name="queueKeepFailedAge" value="{{values.queueKeepFailedAge}}" data-lpignore="true"
137
+ autocomplete="off" />
138
+ <span class="helper-text">How long failed jobs are kept.</span>
139
+ {{/ui/form-field}}
140
+ </div>
141
+
142
+ <div>
143
+ {{> ui/setting-ref name="queueKeepFailedContent"}}
144
+ {{#> ui/form-field id="settingsQueueKeepFailedContent" label="Retryable failed messages" error=errors.queueKeepFailedContent}}
145
+ <input type="number" min="0" class="input{{#if errors.queueKeepFailedContent}} is-invalid{{/if}}"
146
+ id="settingsQueueKeepFailedContent" name="queueKeepFailedContent" value="{{values.queueKeepFailedContent}}" data-lpignore="true"
147
+ autocomplete="off" />
148
+ <span class="helper-text">How many of the most recent failed messages keep their content so they can be
149
+ retried. 0 keeps none.</span>
150
+ {{/ui/form-field}}
151
+ </div>
152
+
153
+ <div>
154
+ {{> ui/setting-ref name="queueKeepFailedContentSize"}}
155
+ {{#> ui/form-field id="settingsQueueKeepFailedContentSize" label="Retryable message content (MB)" error=errors.queueKeepFailedContentSize}}
156
+ <input type="number" min="0" step="any" class="input{{#if errors.queueKeepFailedContentSize}} is-invalid{{/if}}"
157
+ id="settingsQueueKeepFailedContentSize" name="queueKeepFailedContentSize" value="{{values.queueKeepFailedContentSize}}" data-lpignore="true"
158
+ autocomplete="off" />
159
+ <span class="helper-text">Total size of the kept content. 0 keeps none.</span>
160
+ {{/ui/form-field}}
161
+ </div>
162
+ </div>
163
+
117
164
  </div>
118
165
  </div>
119
166
 
@@ -103,6 +103,34 @@ class="mb-1"}}
103
103
  </div>
104
104
  </div>
105
105
 
106
+ {{#> ui/details summary="Delivery Retries" summarySmall="(All webhooks)"
107
+ class="card bg-base-100 shadow-md mb-6" open=values.webhooksDeliveryAttempts}}
108
+
109
+ <p class="mb-4">How a failed webhook delivery is retried. The delay doubles with every attempt. Changes apply to events queued after saving.</p>
110
+
111
+ <div class="grid gap-4 md:grid-cols-2">
112
+ <div>
113
+ {{> ui/setting-ref name="webhooksDeliveryAttempts"}}
114
+ {{#> ui/form-field id="settingsWebhooksDeliveryAttempts" label="Delivery attempts" error=errors.webhooksDeliveryAttempts}}
115
+ <input type="number" min="1" max="100" class="input{{#if errors.webhooksDeliveryAttempts}} is-invalid{{/if}}"
116
+ id="settingsWebhooksDeliveryAttempts" name="webhooksDeliveryAttempts" value="{{values.webhooksDeliveryAttempts}}"
117
+ placeholder="{{defaultWebhookAttempts}}" data-lpignore="true" autocomplete="off" />
118
+ <span class="helper-text">Attempts per event, including the first. Empty uses {{defaultWebhookAttempts}}.</span>
119
+ {{/ui/form-field}}
120
+ </div>
121
+ <div>
122
+ {{> ui/setting-ref name="webhooksRetryDelay"}}
123
+ {{#> ui/form-field id="settingsWebhooksRetryDelay" label="First retry delay (seconds)" error=errors.webhooksRetryDelay}}
124
+ <input type="number" min="1" max="3600" class="input{{#if errors.webhooksRetryDelay}} is-invalid{{/if}}"
125
+ id="settingsWebhooksRetryDelay" name="webhooksRetryDelay" value="{{values.webhooksRetryDelay}}"
126
+ placeholder="{{defaultWebhookRetryDelay}}" data-lpignore="true" autocomplete="off" />
127
+ <span class="helper-text">Wait before the first retry. Empty uses {{defaultWebhookRetryDelay}} seconds.</span>
128
+ {{/ui/form-field}}
129
+ </div>
130
+ </div>
131
+
132
+ {{/ui/details}}
133
+
106
134
  {{#> ui/details summary="Custom Headers" summarySmall="(Default webhook only)"
107
135
  class="card bg-base-100 shadow-md mb-6" open=values.customHeaders}}
108
136
 
@@ -175,6 +203,14 @@ class="mb-1"}}
175
203
  hint="Remove unsafe HTML, convert plain text to HTML when needed, and collapse quoted thread history."}}
176
204
  </div>
177
205
 
206
+ <div>
207
+ {{> ui/setting-ref name="disableThreadCollapse"}}
208
+ {{> ui/checkbox id="settingsDisableThreadCollapse" name="disableThreadCollapse"
209
+ label="Keep quoted thread history expanded" class="text-list" checked=values.disableThreadCollapse
210
+ error=errors.disableThreadCollapse
211
+ hint="Do not fold quoted replies into a collapsed block in web-safe HTML, here and in API responses that ask for it."}}
212
+ </div>
213
+
178
214
  <div>
179
215
  {{> ui/setting-ref name="notifyTextSize"}}
180
216
  {{#> ui/form-field id="settingsNotifyTextSize" label="Content Size Limit" error=errors.notifyTextSize}}
@@ -58,6 +58,7 @@
58
58
  <th>ID</th>
59
59
  <th>Uptime</th>
60
60
  <th class="text-end">Memory</th>
61
+ <th class="text-end" title="Longest event loop delay over the last 15 seconds">Event loop</th>
61
62
  {{#if showAccounts}}
62
63
  <th class="text-end">Accounts</th>
63
64
  {{/if}}
@@ -99,6 +100,13 @@
99
100
  {{heapUsed}}
100
101
  {{/if}}
101
102
  </td>
103
+ <td class="text-end" data-label="Event loop">
104
+ {{#if eventLoopDelayMax includeZero=true}}
105
+ {{formatInteger eventLoopDelayMax userLocale}} ms
106
+ {{else}}
107
+ <span class="text-base-content/40">-</span>
108
+ {{/if}}
109
+ </td>
102
110
  {{#if ../showAccounts}}
103
111
  <td class="text-end" data-label="Accounts">
104
112
  {{#if accounts}}
@@ -11,20 +11,24 @@
11
11
  {{#if retention.failedCountFromSetting}}
12
12
  The count follows the completed job history limit in
13
13
  <a href="/admin/config/service#queue_settings" class="link link-animated">General settings</a>, which is above the
14
- floor of {{formatInteger retention.failedCountFloor userLocale}} set with <code>EENGINE_QUEUE_KEEP_FAILED</code>;
14
+ floor of {{formatInteger retention.failedCountFloor userLocale}} set by the failed job limit there or by
15
+ <code>EENGINE_QUEUE_KEEP_FAILED</code>;
15
16
  {{else}}
16
- The count is set with <code>EENGINE_QUEUE_KEEP_FAILED</code>, or by the completed job history limit in
17
- <a href="/admin/config/service#queue_settings" class="link link-animated">General settings</a> when that is higher;
17
+ The count is the failed job limit in
18
+ <a href="/admin/config/service#queue_settings" class="link link-animated">General settings</a> (or
19
+ <code>EENGINE_QUEUE_KEEP_FAILED</code>), or the completed job history limit there when that is higher;
18
20
  {{/if}}
19
- the age with <code>EENGINE_QUEUE_KEEP_FAILED_AGE</code>.
21
+ the age is set there too (or by <code>EENGINE_QUEUE_KEEP_FAILED_AGE</code>).
20
22
  {{#equals queue.name "submit"}}
21
23
  {{#if failedContent.limits.keepsContent}}
22
24
  The content of the {{formatInteger failedContent.limits.maxCount userLocale}} most recent failed messages is kept
23
- so they can be retried, up to {{failedContent.limits.maxBytesLabel}} in total, set with
24
- <code>EENGINE_QUEUE_KEEP_FAILED_CONTENT</code> and <code>EENGINE_QUEUE_KEEP_FAILED_CONTENT_SIZE</code>.
25
+ so they can be retried, up to {{failedContent.limits.maxBytesLabel}} in total, set in
26
+ <a href="/admin/config/service#queue_settings" class="link link-animated">General settings</a> (or with
27
+ <code>EENGINE_QUEUE_KEEP_FAILED_CONTENT</code> and <code>EENGINE_QUEUE_KEEP_FAILED_CONTENT_SIZE</code>).
25
28
  {{else}}
26
- The content of a failed message is not kept, so none can be retried from here; set
27
- <code>EENGINE_QUEUE_KEEP_FAILED_CONTENT</code> to keep some.
29
+ The content of a failed message is not kept, so none can be retried from here; raise the retained failed
30
+ message limits in <a href="/admin/config/service#queue_settings" class="link link-animated">General settings</a>
31
+ (or <code>EENGINE_QUEUE_KEEP_FAILED_CONTENT</code>) to keep some.
28
32
  {{/if}}
29
33
  {{/equals}}
30
34
  {{else}}
@@ -1,14 +1,16 @@
1
1
  {{!--
2
2
  ui/env-managed-alert - notice for the settings pages registered through
3
- lib/ui-routes/settings-page.js, naming the form fields whose values the EENGINE_SETTINGS
4
- environment variable re-applies on every boot. A value saved for one of them holds only
5
- until the next restart, and without this the page would show the save succeeding.
6
- Renders nothing when the page has no such field. The inputs stay enabled on purpose -
7
- a disabled control drops out of the POST and would silently strip its value from the
3
+ lib/ui-routes/settings-page.js, naming the form fields whose values come from the environment.
4
+ Two kinds: fields the EENGINE_SETTINGS environment variable re-applies on every boot (a value
5
+ saved for one of them holds only until the next restart), and fields whose own environment
6
+ variable overrides the setting (lib/env-setting-overrides.js: the page shows the variable's
7
+ value and a value typed there is not saved). Without this the page would show the save
8
+ succeeding. Renders nothing when the page has no such field. The inputs stay enabled on
9
+ purpose - a disabled control drops out of the POST and would silently strip its value from the
8
10
  save - so the notice is the whole treatment.
9
11
  {{> ui/env-managed-alert}}
10
- Reads `envManagedKeys` (array of field names) from the page context; registerSettingsPage
11
- sets it on every render of the page.
12
+ Reads `envManagedKeys` (array of field names) and `envOverriddenSettings` (array of
13
+ `{key, env}`) from the page context; registerSettingsPage sets both on every render of the page.
12
14
  --}}
13
15
  {{#if envManagedKeys.length}}
14
16
  {{#> ui/alert-banner variant="info" icon="icon-[tabler--info-circle]" title="Some fields are set by the environment"}}
@@ -17,3 +19,10 @@
17
19
  {{#each envManagedKeys}}<code>{{this}}</code>{{#unless @last}}, {{/unless}}{{/each}}.</div>
18
20
  {{/ui/alert-banner}}
19
21
  {{/if}}
22
+ {{#if envOverriddenSettings.length}}
23
+ {{#> ui/alert-banner variant="info" icon="icon-[tabler--info-circle]" title="Some fields are pinned by environment variables"}}
24
+ <div>These settings are set by their own environment variable, which takes precedence over the saved setting. The
25
+ form shows the environment value, and a value entered for them here is not saved while the variable is set:
26
+ {{#each envOverriddenSettings}}<code>{{key}}</code> (<code>{{env}}</code>){{#unless @last}}, {{/unless}}{{/each}}.</div>
27
+ {{/ui/alert-banner}}
28
+ {{/if}}
@@ -27,7 +27,7 @@
27
27
 
28
28
  <div>
29
29
  <div class="text-base-content/60 float-right code-link">[<a
30
- href="https://learn.emailengine.app/docs/advanced/pre-processing" target="_blank" rel="noopener noreferrer"
30
+ href="https://learn.emailengine.app/docs/webhooks/pre-processing" target="_blank" rel="noopener noreferrer"
31
31
  referrerpolicy="no-referrer" class="link link-animated">documentation</a>]</div>
32
32
  <label class="label-text" for="editor-fn">Filter function</label>
33
33
  <div class="mb-2 leading-tight">
@@ -61,7 +61,7 @@
61
61
  <em>List-Unsubscribe</em> link in emails opens. Use it to preview the page or send the
62
62
  link to a recipient who wants to re-subscribe themselves.
63
63
  </p>
64
- <p class="mb-0"><a href="https://learn.emailengine.app/docs/advanced/virtual-lists" target="_blank"
64
+ <p class="mb-0"><a href="https://learn.emailengine.app/docs/sending/deliverability/suppression-lists" target="_blank"
65
65
  rel="noopener noreferrer" referrerpolicy="no-referrer" class="link link-animated">Learn more about virtual
66
66
  lists and sending with a listId</a>.</p>
67
67
  </div>