emailengine-app 2.87.1 → 2.88.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.
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +31 -0
- package/ENVIRONMENT.md +26 -23
- package/LICENSE_EMAILENGINE.txt +20 -12
- package/app.json +3 -3
- package/bin/emailengine.js +7 -11
- package/data/google-crawlers.json +1 -1
- package/data/public_suffix_list.dat +48 -10
- package/lib/account.js +69 -49
- package/lib/admin-password.js +85 -0
- package/lib/api-routes/license-routes.js +9 -0
- package/lib/api-token-auth.js +21 -5
- package/lib/calendar-event.js +15 -3
- package/lib/consts.js +5 -0
- package/lib/db.js +1 -0
- package/lib/dbsc/index.js +292 -0
- package/lib/dbsc/jwt.js +157 -0
- package/lib/dbsc/protocol.js +132 -0
- package/lib/dbsc/store.js +136 -0
- package/lib/email-client/base-client.js +36 -15
- package/lib/email-client/gmail-client.js +20 -6
- package/lib/email-client/imap/connection-errors.js +30 -1
- package/lib/email-client/imap/session-expiry.js +83 -0
- package/lib/email-client/imap-client.js +12 -2
- package/lib/email-client/smtp-pool-manager.js +66 -8
- package/lib/export.js +147 -22
- package/lib/graph-notifications.js +60 -0
- package/lib/imap-proxy-auth.js +52 -18
- package/lib/imapproxy/imap-core/lib/commands/id.js +4 -2
- package/lib/imapproxy/imap-core/lib/imap-command.js +44 -4
- package/lib/imapproxy/imap-server.js +10 -1
- package/lib/imapproxy/proxy-handoff.js +100 -5
- package/lib/license-subscription.js +238 -0
- package/lib/oauth/gmail.js +18 -0
- package/lib/oauth/outlook-identity.js +54 -12
- package/lib/prepared-password.js +38 -0
- package/lib/privileged-settings.js +6 -0
- package/lib/queue-browser/index.js +6 -6
- package/lib/queue-job-actions.js +59 -4
- package/lib/read-env-value.js +46 -21
- package/lib/redis-url.js +23 -0
- package/lib/response-stream.js +69 -1
- package/lib/revocation-events.js +79 -0
- package/lib/routes-ui.js +4 -1
- package/lib/schemas.js +26 -2
- package/lib/session-default.js +13 -3
- package/lib/settings.js +47 -24
- package/lib/sso.js +23 -0
- package/lib/submit-penalty.js +24 -0
- package/lib/submit-processor.js +10 -2
- package/lib/tokens.js +6 -0
- package/lib/tools.js +86 -15
- package/lib/ui-routes/admin-config-routes.js +30 -281
- package/lib/ui-routes/auth-routes.js +17 -64
- package/lib/ui-routes/dbsc-routes.js +43 -0
- package/lib/ui-routes/license-routes.js +326 -0
- package/lib/web-safe-html.js +29 -0
- package/lib/webhook-delivery.js +21 -20
- package/lib/webhook-penalty.js +18 -17
- package/lib/webhooks.js +18 -0
- package/package.json +18 -18
- package/sbom.json +294 -294
- package/scan.js +2 -0
- package/server.js +253 -80
- package/static/css/flyonui.css +2 -2
- package/static/js/ui.js +11 -4
- package/static/licenses.html +27 -27
- package/translations/messages.pot +17 -17
- package/views/config/license.hbs +43 -16
- package/views/config/security.hbs +37 -0
- package/views/partials/side_menu.hbs +1 -1
- package/workers/api.js +128 -109
- package/workers/imap.js +4 -6
package/lib/webhook-penalty.js
CHANGED
|
@@ -6,18 +6,19 @@
|
|
|
6
6
|
// that accepts the connection and never answers costs the whole attempt timeout (30 seconds by
|
|
7
7
|
// default). One account pointing its own webhook URL at such a target, and generating a dozen
|
|
8
8
|
// events a minute, kept the queue busy with timeouts and delayed every other account's
|
|
9
|
-
// deliveries behind them, indefinitely. So a target whose attempt
|
|
10
|
-
// penalised: for a short while, deliveries to the same origin are moved back to the delayed set
|
|
9
|
+
// deliveries behind them, indefinitely. So a target whose attempt held the worker for most of the
|
|
10
|
+
// timeout is penalised: for a short while, deliveries to the same origin are moved back to the delayed set
|
|
11
11
|
// instead of being attempted, and the queue spends its time on targets that answer. The
|
|
12
12
|
// penalised delivery is not lost, it is tried again once the penalty is over, with its attempt
|
|
13
13
|
// count unchanged.
|
|
14
14
|
//
|
|
15
|
-
// Only the slow
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
15
|
+
// Only the slow attempts count: one that ran into a deadline, and one that held the worker for at
|
|
16
|
+
// least half the attempt timeout before it ended, whatever the receiver answered. The receiver
|
|
17
|
+
// chooses its answer, so keying on it let a target hold every attempt just short of the timeout
|
|
18
|
+
// and answer 500, or 200, and never be penalised. A refused or reset connection and a name that
|
|
19
|
+
// does not resolve fail in milliseconds, so they never hold the queue, and penalising them would
|
|
20
|
+
// defer every delivery to a receiver for a minute because it was restarting when one attempt
|
|
21
|
+
// arrived. Nor is an egress or redirect refusal penalised, which fails the job for good anyway.
|
|
21
22
|
|
|
22
23
|
const { createHash } = require('crypto');
|
|
23
24
|
const { REDIS_PREFIX } = require('./consts');
|
|
@@ -50,19 +51,19 @@ function penaltyKey(url) {
|
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
/**
|
|
53
|
-
* How long a target is penalised after
|
|
54
|
-
*
|
|
54
|
+
* How long a target is penalised after an attempt, in milliseconds; 0 when the attempt is not the
|
|
55
|
+
* kind that holds the queue.
|
|
55
56
|
*
|
|
56
|
-
* @param {Error} err - the failure
|
|
57
|
+
* @param {Error|null} err - the failure, or null for a delivered attempt
|
|
57
58
|
* @param {Number} attemptTimeout - the per-attempt wall clock cap, in milliseconds
|
|
59
|
+
* @param {Number} [duration] - how long the attempt took, in milliseconds
|
|
58
60
|
* @returns {Number}
|
|
59
61
|
*/
|
|
60
|
-
function penaltyFor(err, attemptTimeout) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (!code || !SLOW_FAILURE_CODES.has(code)) {
|
|
62
|
+
function penaltyFor(err, attemptTimeout, duration) {
|
|
63
|
+
let code = err && typeof err === 'object' && (err.code || (err.cause && err.cause.code));
|
|
64
|
+
let timedOut = !!code && SLOW_FAILURE_CODES.has(code);
|
|
65
|
+
let slow = Number(attemptTimeout) > 0 && Number(duration) >= Number(attemptTimeout) / 2;
|
|
66
|
+
if (!timedOut && !slow) {
|
|
66
67
|
return 0;
|
|
67
68
|
}
|
|
68
69
|
// twice the attempt cap: long enough that a dozen events a minute to a dead target no
|
package/lib/webhooks.js
CHANGED
|
@@ -631,6 +631,13 @@ class WebhooksHandler {
|
|
|
631
631
|
} else if (data.text && truncateTextContents(data.text, notifyTextSize)) {
|
|
632
632
|
data.text.hasMore = true;
|
|
633
633
|
}
|
|
634
|
+
|
|
635
|
+
// The web-safe copy replaces the HTML below, after this limit was applied to the HTML,
|
|
636
|
+
// so it is held to the same limit: with inline images embedded it can be far larger
|
|
637
|
+
if (data.text && notifyText && notifyTextSize && typeof data.text._generatedHtml === 'string' && data.text._generatedHtml.length > notifyTextSize) {
|
|
638
|
+
data.text._generatedHtml = data.text._generatedHtml.substr(0, notifyTextSize);
|
|
639
|
+
data.text.hasMore = true;
|
|
640
|
+
}
|
|
634
641
|
}
|
|
635
642
|
|
|
636
643
|
if (data.headers) {
|
|
@@ -655,6 +662,17 @@ class WebhooksHandler {
|
|
|
655
662
|
delete data.otp;
|
|
656
663
|
}
|
|
657
664
|
|
|
665
|
+
// Calendar files are attachments too, and their description is message text: both used to
|
|
666
|
+
// be copied in whole whatever the two limits said
|
|
667
|
+
for (let calendarEvent of data.calendarEvents || []) {
|
|
668
|
+
if (calendarEvent.content && !withinNotifyAttachmentSize(calendarEvent, notifyAttachmentSize)) {
|
|
669
|
+
delete calendarEvent.content;
|
|
670
|
+
}
|
|
671
|
+
if (notifyTextSize && typeof calendarEvent.description === 'string' && calendarEvent.description.length > notifyTextSize) {
|
|
672
|
+
calendarEvent.description = calendarEvent.description.substr(0, notifyTextSize);
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
|
|
658
676
|
// remove attachment contents
|
|
659
677
|
if (data.attachments) {
|
|
660
678
|
for (let attachment of data.attachments) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "emailengine-app",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.88.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"productTitle": "EmailEngine",
|
|
6
6
|
"description": "Email Sync Engine",
|
|
@@ -65,26 +65,26 @@
|
|
|
65
65
|
"@hapi/vision": "7.0.3",
|
|
66
66
|
"@msgpack/msgpack": "3.1.3",
|
|
67
67
|
"@postalsys/bounce-classifier": "3.1.0",
|
|
68
|
-
"@postalsys/certs": "2.0.
|
|
69
|
-
"@postalsys/email-ai-tools": "2.4.
|
|
70
|
-
"@postalsys/email-content": "0.1.
|
|
71
|
-
"@postalsys/email-text-tools": "2.6.
|
|
68
|
+
"@postalsys/certs": "2.0.5",
|
|
69
|
+
"@postalsys/email-ai-tools": "2.4.3",
|
|
70
|
+
"@postalsys/email-content": "0.1.21",
|
|
71
|
+
"@postalsys/email-text-tools": "2.6.4",
|
|
72
72
|
"@postalsys/gettext": "4.3.0",
|
|
73
73
|
"@postalsys/joi-messages": "1.4.1",
|
|
74
74
|
"@postalsys/templates": "2.1.1",
|
|
75
75
|
"@sentry/node-core": "10.78.0",
|
|
76
|
-
"@simplewebauthn/server": "14.0
|
|
76
|
+
"@simplewebauthn/server": "14.1.0",
|
|
77
77
|
"@zone-eu/mailsplit": "5.4.30",
|
|
78
78
|
"@zone-eu/wild-config": "1.7.10",
|
|
79
|
-
"bullmq": "6.7.
|
|
80
|
-
"dotenv": "18.0.
|
|
79
|
+
"bullmq": "6.7.3",
|
|
80
|
+
"dotenv": "18.0.10",
|
|
81
81
|
"fast-xml-parser": "5.12.0",
|
|
82
82
|
"handlebars": "4.7.10",
|
|
83
83
|
"he": "1.2.0",
|
|
84
84
|
"html-to-text": "10.0.1",
|
|
85
85
|
"ical.js": "2.2.1",
|
|
86
86
|
"iconv-lite": "0.7.3",
|
|
87
|
-
"imapflow": "2.
|
|
87
|
+
"imapflow": "2.11.0",
|
|
88
88
|
"ioredfour": "2.2.0",
|
|
89
89
|
"ioredis": "6.0.0",
|
|
90
90
|
"ipaddr.js": "2.5.0",
|
|
@@ -92,27 +92,27 @@
|
|
|
92
92
|
"libbase64": "1.4.1",
|
|
93
93
|
"libmime": "5.6.4",
|
|
94
94
|
"libqp": "3.0.1",
|
|
95
|
-
"mailparser": "3.14.
|
|
95
|
+
"mailparser": "3.14.3",
|
|
96
96
|
"marked": "15.0.12",
|
|
97
97
|
"minimist": "1.2.8",
|
|
98
|
-
"nodemailer": "10.
|
|
98
|
+
"nodemailer": "10.5.0",
|
|
99
99
|
"pino": "10.3.1",
|
|
100
100
|
"prom-client": "15.1.3",
|
|
101
101
|
"pubface": "1.2.0",
|
|
102
102
|
"punycode.js": "2.3.1",
|
|
103
103
|
"qrcode-generator": "2.0.4",
|
|
104
|
-
"smtp-server": "3.21.
|
|
104
|
+
"smtp-server": "3.21.4",
|
|
105
105
|
"socks": "2.8.10",
|
|
106
|
-
"undici": "7.30.
|
|
106
|
+
"undici": "7.30.2"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@eslint/js": "10.0.1",
|
|
110
|
-
"@iconify-json/tabler": "1.2.
|
|
110
|
+
"@iconify-json/tabler": "1.2.44",
|
|
111
111
|
"@iconify/tailwind4": "1.2.3",
|
|
112
112
|
"@playwright/test": "1.63.0",
|
|
113
113
|
"@postalsys/ee-client": "1.10.0",
|
|
114
114
|
"@simplewebauthn/browser": "14.0.0",
|
|
115
|
-
"@tailwindcss/cli": "4.3.
|
|
115
|
+
"@tailwindcss/cli": "4.3.5",
|
|
116
116
|
"ace-builds": "1.45.2",
|
|
117
117
|
"acorn": "8.19.0",
|
|
118
118
|
"acorn-walk": "8.3.5",
|
|
@@ -125,9 +125,9 @@
|
|
|
125
125
|
"pino-pretty": "13.2.0",
|
|
126
126
|
"prettier": "3.9.10",
|
|
127
127
|
"resedit": "3.1.0",
|
|
128
|
-
"spdx-satisfies": "6.0.
|
|
129
|
-
"supertest": "7.3.
|
|
130
|
-
"tailwindcss": "4.3.
|
|
128
|
+
"spdx-satisfies": "6.0.1",
|
|
129
|
+
"supertest": "7.3.2",
|
|
130
|
+
"tailwindcss": "4.3.5",
|
|
131
131
|
"xgettext-template": "5.0.0"
|
|
132
132
|
},
|
|
133
133
|
"overrides": {
|