emailengine-app 2.79.6 → 2.79.8

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 (109) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +32 -0
  3. package/DOCKER_DEPLOYMENT.md +2 -0
  4. package/bin/emailengine.js +29 -13
  5. package/config/default.toml +13 -3
  6. package/data/google-crawlers.json +7 -1
  7. package/docker-compose.yml +12 -3
  8. package/install.sh +2 -0
  9. package/lib/api-routes/account-routes.js +14 -3
  10. package/lib/api-routes/mailbox-routes.js +4 -1
  11. package/lib/api-routes/message-routes.js +6 -5
  12. package/lib/api-routes/outbox-routes.js +7 -4
  13. package/lib/api-routes/settings-routes.js +34 -25
  14. package/lib/api-routes/stats-routes.js +8 -1
  15. package/lib/api-routes/submit-routes.js +2 -1
  16. package/lib/api-routes/template-routes.js +3 -2
  17. package/lib/bounce-detect.js +45 -0
  18. package/lib/consts.js +9 -3
  19. package/lib/egress-filter.js +39 -4
  20. package/lib/email-client/base-client.js +274 -24
  21. package/lib/email-client/gmail/gmail-api.js +15 -7
  22. package/lib/email-client/gmail-client.js +121 -64
  23. package/lib/email-client/imap/mailbox.js +18 -59
  24. package/lib/email-client/imap-client.js +53 -29
  25. package/lib/email-client/notification-handler.js +11 -2
  26. package/lib/email-client/outlook/graph-api.js +106 -90
  27. package/lib/email-client/outlook-client.js +222 -106
  28. package/lib/generate-text-preview.js +10 -5
  29. package/lib/headers-rewriter.js +1 -1
  30. package/lib/llm-pre-process.js +4 -1
  31. package/lib/mcp/json-schema.js +50 -2
  32. package/lib/outbox.js +22 -5
  33. package/lib/passkeys.js +39 -7
  34. package/lib/pre-process.js +4 -1
  35. package/lib/rewrite-text-nodes.js +12 -1
  36. package/lib/schemas.js +27 -5
  37. package/lib/settings.js +19 -1
  38. package/lib/sso.js +60 -7
  39. package/lib/submit-progress.js +29 -0
  40. package/lib/templates.js +11 -0
  41. package/lib/tools.js +115 -53
  42. package/lib/ui-routes/account-routes.js +79 -12
  43. package/lib/ui-routes/admin-config-routes.js +7 -21
  44. package/lib/ui-routes/admin-entities-routes.js +42 -12
  45. package/lib/ui-routes/auth-routes.js +242 -87
  46. package/lib/ui-routes/dashboard-routes.js +1 -1
  47. package/lib/ui-routes/internals-routes.js +2 -0
  48. package/lib/ui-routes/mcp-consent-routes.js +5 -2
  49. package/lib/ui-routes/network-config-routes.js +12 -3
  50. package/lib/ui-routes/oauth-config-routes.js +12 -1
  51. package/lib/ui-routes/route-helpers.js +41 -6
  52. package/lib/ui-routes/settings-page.js +10 -0
  53. package/lib/ui-routes/suppression-list-routes.js +16 -5
  54. package/lib/ui-routes/unsubscribe-routes.js +22 -3
  55. package/lib/webhooks.js +14 -2
  56. package/package.json +17 -17
  57. package/sbom.json +1 -1
  58. package/server.js +63 -35
  59. package/static/css/flyonui.css +1 -1
  60. package/static/css/src/app.tailwind.css +55 -0
  61. package/static/js/app.js +4 -35
  62. package/static/js/passkey-register.js +50 -1
  63. package/static/js/public.js +128 -0
  64. package/static/js/ui.js +183 -6
  65. package/static/licenses.html +371 -770
  66. package/translations/messages.pot +66 -66
  67. package/views/account/passkeys.hbs +141 -0
  68. package/views/account/password.hbs +11 -0
  69. package/views/account/security.hbs +318 -326
  70. package/views/accounts/account.hbs +90 -115
  71. package/views/accounts/register/imap-server.hbs +18 -12
  72. package/views/config/ai.hbs +2 -0
  73. package/views/config/branding.hbs +2 -0
  74. package/views/config/document-store/index.hbs +6 -6
  75. package/views/config/email-processing.hbs +2 -0
  76. package/views/config/imap-proxy.hbs +2 -0
  77. package/views/config/license.hbs +4 -1
  78. package/views/config/logging.hbs +3 -1
  79. package/views/config/mcp.hbs +2 -0
  80. package/views/config/network.hbs +2 -0
  81. package/views/config/oauth/app.hbs +3 -3
  82. package/views/config/oauth/edit.hbs +1 -1
  83. package/views/config/oauth/new.hbs +1 -1
  84. package/views/config/security.hbs +2 -0
  85. package/views/config/service.hbs +2 -0
  86. package/views/config/smtp.hbs +2 -0
  87. package/views/config/webhooks.hbs +9 -6
  88. package/views/error.hbs +6 -0
  89. package/views/layout/app.hbs +6 -3
  90. package/views/layout/login.hbs +1 -1
  91. package/views/layout/prompt.hbs +1 -1
  92. package/views/layout/public.hbs +1 -1
  93. package/views/legal.hbs +1 -1
  94. package/views/partials/filter_editor_js.hbs +1 -1
  95. package/views/partials/gateway_js.hbs +7 -6
  96. package/views/partials/oauth_form.hbs +5 -5
  97. package/views/partials/ui/btn.hbs +8 -2
  98. package/views/partials/ui/confirm-modal.hbs +2 -3
  99. package/views/partials/ui/empty-state.hbs +25 -0
  100. package/views/partials/ui/env-managed-alert.hbs +19 -0
  101. package/views/partials/webhook_form.hbs +1 -1
  102. package/views/partials/webhooks_editor_functions.hbs +5 -5
  103. package/views/unsubscribe.hbs +6 -0
  104. package/workers/api.js +193 -81
  105. package/workers/imap.js +32 -3
  106. package/workers/smtp.js +7 -0
  107. package/workers/submit.js +25 -1
  108. package/workers/webhooks.js +13 -17
  109. package/lib/reconnection-manager.js +0 -106
@@ -1,106 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * ReconnectionManager - Helper class for consistent reconnection behavior
5
- * Provides capped exponential backoff with jitter for reconnection attempts
6
- */
7
- class ReconnectionManager {
8
- constructor(options = {}) {
9
- this.baseDelay = options.baseDelay || 2000;
10
- this.maxDelay = options.maxDelay || 30000;
11
- this.backoffMultiplier = options.backoffMultiplier || 1.5;
12
- this.jitterMs = options.jitterMs || 1000;
13
- this.attempts = 0;
14
- this.currentDelay = this.baseDelay;
15
- this.logger = options.logger;
16
- }
17
-
18
- /**
19
- * Calculate the next reconnection delay with exponential backoff and jitter
20
- * @returns {number} Delay in milliseconds before next reconnection attempt
21
- */
22
- getNextDelay() {
23
- // Calculate delay with exponential backoff, capped at maxDelay
24
- this.currentDelay = Math.min(this.maxDelay, this.baseDelay * Math.pow(this.backoffMultiplier, Math.min(this.attempts, 10)));
25
-
26
- // Add jitter to prevent synchronized reconnection storms
27
- const jitter = Math.random() * this.jitterMs;
28
- const totalDelay = this.currentDelay + jitter;
29
-
30
- this.attempts++;
31
-
32
- if (this.logger) {
33
- this.logger.debug({
34
- msg: 'Calculated reconnection delay',
35
- attempt: this.attempts,
36
- delay: totalDelay,
37
- baseDelay: this.currentDelay
38
- });
39
- }
40
-
41
- return totalDelay;
42
- }
43
-
44
- /**
45
- * Reset the reconnection manager state (typically called on successful connection)
46
- */
47
- reset() {
48
- this.attempts = 0;
49
- this.currentDelay = this.baseDelay;
50
-
51
- if (this.logger) {
52
- this.logger.debug({
53
- msg: 'Reconnection manager reset'
54
- });
55
- }
56
- }
57
-
58
- /**
59
- * Wait for the calculated delay and then execute the reconnection function
60
- * @param {Function} reconnectFn - The async function to execute for reconnection
61
- * @returns {Promise} Result of the reconnection function
62
- */
63
- async waitAndReconnect(reconnectFn) {
64
- const delay = this.getNextDelay();
65
-
66
- if (this.logger) {
67
- this.logger.debug({
68
- msg: 'Waiting before reconnection attempt',
69
- delay,
70
- attempt: this.attempts
71
- });
72
- }
73
-
74
- await new Promise(resolve => setTimeout(resolve, delay));
75
-
76
- try {
77
- const result = await reconnectFn();
78
- this.reset(); // Reset on success
79
- return result;
80
- } catch (err) {
81
- // Don't reset, keep incrementing delay
82
- if (this.logger) {
83
- this.logger.warn({
84
- msg: 'Reconnection attempt failed',
85
- attempt: this.attempts,
86
- err
87
- });
88
- }
89
- throw err;
90
- }
91
- }
92
-
93
- /**
94
- * Get current state of the manager
95
- * @returns {Object} Current state including attempts and delay
96
- */
97
- getState() {
98
- return {
99
- attempts: this.attempts,
100
- currentDelay: this.currentDelay,
101
- nextDelay: this.getNextDelay()
102
- };
103
- }
104
- }
105
-
106
- module.exports = { ReconnectionManager };