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.
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +32 -0
- package/DOCKER_DEPLOYMENT.md +2 -0
- package/bin/emailengine.js +29 -13
- package/config/default.toml +13 -3
- package/data/google-crawlers.json +7 -1
- package/docker-compose.yml +12 -3
- package/install.sh +2 -0
- package/lib/api-routes/account-routes.js +14 -3
- package/lib/api-routes/mailbox-routes.js +4 -1
- package/lib/api-routes/message-routes.js +6 -5
- package/lib/api-routes/outbox-routes.js +7 -4
- package/lib/api-routes/settings-routes.js +34 -25
- package/lib/api-routes/stats-routes.js +8 -1
- package/lib/api-routes/submit-routes.js +2 -1
- package/lib/api-routes/template-routes.js +3 -2
- package/lib/bounce-detect.js +45 -0
- package/lib/consts.js +9 -3
- package/lib/egress-filter.js +39 -4
- package/lib/email-client/base-client.js +274 -24
- package/lib/email-client/gmail/gmail-api.js +15 -7
- package/lib/email-client/gmail-client.js +121 -64
- package/lib/email-client/imap/mailbox.js +18 -59
- package/lib/email-client/imap-client.js +53 -29
- package/lib/email-client/notification-handler.js +11 -2
- package/lib/email-client/outlook/graph-api.js +106 -90
- package/lib/email-client/outlook-client.js +222 -106
- package/lib/generate-text-preview.js +10 -5
- package/lib/headers-rewriter.js +1 -1
- package/lib/llm-pre-process.js +4 -1
- package/lib/mcp/json-schema.js +50 -2
- package/lib/outbox.js +22 -5
- package/lib/passkeys.js +39 -7
- package/lib/pre-process.js +4 -1
- package/lib/rewrite-text-nodes.js +12 -1
- package/lib/schemas.js +27 -5
- package/lib/settings.js +19 -1
- package/lib/sso.js +60 -7
- package/lib/submit-progress.js +29 -0
- package/lib/templates.js +11 -0
- package/lib/tools.js +115 -53
- package/lib/ui-routes/account-routes.js +79 -12
- package/lib/ui-routes/admin-config-routes.js +7 -21
- package/lib/ui-routes/admin-entities-routes.js +42 -12
- package/lib/ui-routes/auth-routes.js +242 -87
- package/lib/ui-routes/dashboard-routes.js +1 -1
- package/lib/ui-routes/internals-routes.js +2 -0
- package/lib/ui-routes/mcp-consent-routes.js +5 -2
- package/lib/ui-routes/network-config-routes.js +12 -3
- package/lib/ui-routes/oauth-config-routes.js +12 -1
- package/lib/ui-routes/route-helpers.js +41 -6
- package/lib/ui-routes/settings-page.js +10 -0
- package/lib/ui-routes/suppression-list-routes.js +16 -5
- package/lib/ui-routes/unsubscribe-routes.js +22 -3
- package/lib/webhooks.js +14 -2
- package/package.json +17 -17
- package/sbom.json +1 -1
- package/server.js +63 -35
- package/static/css/flyonui.css +1 -1
- package/static/css/src/app.tailwind.css +55 -0
- package/static/js/app.js +4 -35
- package/static/js/passkey-register.js +50 -1
- package/static/js/public.js +128 -0
- package/static/js/ui.js +183 -6
- package/static/licenses.html +371 -770
- package/translations/messages.pot +66 -66
- package/views/account/passkeys.hbs +141 -0
- package/views/account/password.hbs +11 -0
- package/views/account/security.hbs +318 -326
- package/views/accounts/account.hbs +90 -115
- package/views/accounts/register/imap-server.hbs +18 -12
- package/views/config/ai.hbs +2 -0
- package/views/config/branding.hbs +2 -0
- package/views/config/document-store/index.hbs +6 -6
- package/views/config/email-processing.hbs +2 -0
- package/views/config/imap-proxy.hbs +2 -0
- package/views/config/license.hbs +4 -1
- package/views/config/logging.hbs +3 -1
- package/views/config/mcp.hbs +2 -0
- package/views/config/network.hbs +2 -0
- package/views/config/oauth/app.hbs +3 -3
- package/views/config/oauth/edit.hbs +1 -1
- package/views/config/oauth/new.hbs +1 -1
- package/views/config/security.hbs +2 -0
- package/views/config/service.hbs +2 -0
- package/views/config/smtp.hbs +2 -0
- package/views/config/webhooks.hbs +9 -6
- package/views/error.hbs +6 -0
- package/views/layout/app.hbs +6 -3
- package/views/layout/login.hbs +1 -1
- package/views/layout/prompt.hbs +1 -1
- package/views/layout/public.hbs +1 -1
- package/views/legal.hbs +1 -1
- package/views/partials/filter_editor_js.hbs +1 -1
- package/views/partials/gateway_js.hbs +7 -6
- package/views/partials/oauth_form.hbs +5 -5
- package/views/partials/ui/btn.hbs +8 -2
- package/views/partials/ui/confirm-modal.hbs +2 -3
- package/views/partials/ui/empty-state.hbs +25 -0
- package/views/partials/ui/env-managed-alert.hbs +19 -0
- package/views/partials/webhook_form.hbs +1 -1
- package/views/partials/webhooks_editor_functions.hbs +5 -5
- package/views/unsubscribe.hbs +6 -0
- package/workers/api.js +193 -81
- package/workers/imap.js +32 -3
- package/workers/smtp.js +7 -0
- package/workers/submit.js +25 -1
- package/workers/webhooks.js +13 -17
- 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 };
|