emailengine-app 2.84.0 → 2.84.2
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/.dockerignore +6 -0
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +35 -0
- package/Dockerfile +2 -2
- package/bin/emailengine.js +15 -0
- package/data/google-crawlers.json +1 -1
- package/docker-compose.yml +1 -1
- package/lib/account/own-account-key.js +42 -0
- package/lib/account-assignment.js +1 -33
- package/lib/account.js +32 -19
- package/lib/add-trackers.js +11 -4
- package/lib/api-routes/account-routes.js +67 -14
- package/lib/api-routes/gateway-routes.js +9 -3
- package/lib/api-routes/message-routes.js +7 -1
- package/lib/api-routes/mint-bounds.js +11 -0
- package/lib/api-routes/route-helpers.js +125 -3
- package/lib/api-routes/submit-routes.js +4 -2
- package/lib/auth-token.js +23 -10
- package/lib/bounce-detect.js +17 -5
- package/lib/consts.js +34 -0
- package/lib/create-imap-client.js +41 -2
- package/lib/email-client/base-client.js +20 -10
- package/lib/email-client/gmail-client.js +21 -7
- package/lib/email-client/imap/mailbox.js +10 -4
- package/lib/email-client/imap/response-metrics.js +75 -0
- package/lib/email-client/imap-client.js +5 -2
- package/lib/email-client/message-builder.js +7 -2
- package/lib/email-client/outlook/graph-api.js +17 -2
- package/lib/email-client/outlook-client.js +6 -3
- package/lib/email-client/smtp-pool-manager.js +6 -0
- package/lib/encrypt.js +9 -0
- package/lib/export.js +3 -1
- package/lib/get-raw-email.js +4 -2
- package/lib/imap-proxy-auth.js +14 -1
- package/lib/imapproxy/imap-core/lib/commands/authenticate-plain.js +1 -0
- package/lib/imapproxy/imap-core/lib/commands/login.js +1 -0
- package/lib/imapproxy/imap-core/lib/imap-command.js +86 -43
- package/lib/imapproxy/imap-core/lib/imap-stream.js +58 -13
- package/lib/imapproxy/imap-core/lib/indexer/indexer.js +3 -1
- package/lib/mcp/listen.js +10 -1
- package/lib/oauth/external-account-config.js +3 -1
- package/lib/oauth/gmail.js +21 -48
- package/lib/oauth/mail-ru.js +5 -38
- package/lib/oauth/outlook.js +26 -44
- package/lib/pbkdf2-phc.js +18 -1
- package/lib/privileged-settings.js +6 -3
- package/lib/redis-scan-delete.js +15 -1
- package/lib/schemas.js +78 -32
- package/lib/settings.js +13 -1
- package/lib/smtp-auth.js +23 -0
- package/lib/tools.js +245 -56
- package/lib/ui-routes/account-routes.js +16 -37
- package/lib/ui-routes/admin-config-routes.js +10 -38
- package/lib/ui-routes/admin-entities-routes.js +22 -24
- package/lib/ui-routes/auth-routes.js +47 -24
- package/lib/ui-routes/connection-security-form.js +74 -0
- package/lib/ui-routes/form-lists.js +46 -0
- package/lib/ui-routes/mcp-consent-routes.js +5 -1
- package/lib/ui-routes/oauth-config-routes.js +9 -18
- package/lib/ui-routes/sign-in-helpers.js +59 -0
- package/lib/ui-routes/unsubscribe-routes.js +6 -3
- package/lib/utils/map-concurrent.js +36 -0
- package/lib/utils/network.js +28 -0
- package/lib/utils/provider-id.js +27 -0
- package/lib/utils/require-tls.js +33 -0
- package/lib/web-safe-html.js +5 -6
- package/lib/webhook-penalty.js +75 -0
- package/lib/webhook-routing.js +22 -2
- package/package.json +21 -21
- package/sbom.json +1 -1
- package/server.js +74 -38
- package/static/js/ace/ace.js +1 -1
- package/static/js/ace/mode-handlebars.js +1 -1
- package/static/js/ace/mode-html.js +1 -1
- package/static/js/ace/mode-javascript.js +1 -1
- package/static/js/ace/mode-markdown.js +1 -1
- package/static/js/ace/worker-html.js +1 -1
- package/static/js/ace/worker-javascript.js +1 -1
- package/static/js/ace/worker-json.js +1 -1
- package/static/js/ee-client.js +5 -0
- package/static/licenses.html +23 -23
- package/translations/messages.pot +66 -66
- package/views/account/security.hbs +10 -0
- package/views/accounts/account.hbs +11 -11
- package/views/accounts/edit.hbs +6 -2
- package/views/partials/gateway_form.hbs +3 -1
- package/workers/api.js +43 -3
- package/workers/webhooks.js +39 -3
- package/config/test.toml +0 -46
- package/install.sh +0 -428
- package/setup-production.sh +0 -215
- package/systemd/emailengine.service +0 -97
- package/systemd/nginx-proxy.conf +0 -77
|
@@ -10,10 +10,13 @@ const Boom = require('@hapi/boom');
|
|
|
10
10
|
const { Account } = require('../account');
|
|
11
11
|
const { redis } = require('../db');
|
|
12
12
|
const { lists } = require('../lists');
|
|
13
|
-
const { parseSignedFormData } = require('../tools');
|
|
13
|
+
const { parseSignedFormData, SIGNING_PURPOSE } = require('../tools');
|
|
14
14
|
const { isClientError } = require('./route-helpers');
|
|
15
15
|
const { signedFormBlobFields } = require('../schemas');
|
|
16
16
|
|
|
17
|
+
// the links are signed with the unsubscribe key, see verifyServiceSignature()
|
|
18
|
+
const UNSUBSCRIBE_BLOB = { purpose: SIGNING_PURPOSE.UNSUBSCRIBE };
|
|
19
|
+
|
|
17
20
|
function init(args) {
|
|
18
21
|
const { server, call } = args;
|
|
19
22
|
|
|
@@ -23,7 +26,7 @@ function init(args) {
|
|
|
23
26
|
async handler(request, h) {
|
|
24
27
|
// Verify the HMAC signature over the signed payload before acting on it, and read every
|
|
25
28
|
// field from the signed data - never from unsigned query input (security review M7).
|
|
26
|
-
let data = await parseSignedFormData(redis, { data: request.query.data, sig: request.query.sig }, request.app.gt);
|
|
29
|
+
let data = await parseSignedFormData(redis, { data: request.query.data, sig: request.query.sig }, request.app.gt, UNSUBSCRIBE_BLOB);
|
|
27
30
|
|
|
28
31
|
if (!data || typeof data !== 'object' || data.act !== 'unsub') {
|
|
29
32
|
// A validly signed blob of another type is the client's problem, not a server
|
|
@@ -92,7 +95,7 @@ function init(args) {
|
|
|
92
95
|
try {
|
|
93
96
|
// Verify the signature and read account/list/recipient from the SIGNED payload -
|
|
94
97
|
// never from client-supplied fields - so subscribe/unsubscribe cannot be forged (M7).
|
|
95
|
-
signed = await parseSignedFormData(redis, { data: request.payload.data, sig: request.payload.sig }, request.app.gt);
|
|
98
|
+
signed = await parseSignedFormData(redis, { data: request.payload.data, sig: request.payload.sig }, request.app.gt, UNSUBSCRIBE_BLOB);
|
|
96
99
|
|
|
97
100
|
if (!signed || typeof signed !== 'object' || signed.act !== 'unsub') {
|
|
98
101
|
signed = null;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Runs `fn` over `items` with at most `limit` calls in flight and resolves with the results in
|
|
5
|
+
* item order once every call has settled. Rejects with the first failure, like Promise.all, but
|
|
6
|
+
* only after the calls already in flight have settled, so a caller never has calls outstanding
|
|
7
|
+
* it does not know about. A caller that wants every item attempted regardless settles each
|
|
8
|
+
* outcome inside `fn`.
|
|
9
|
+
*
|
|
10
|
+
* @param {Array} items
|
|
11
|
+
* @param {number} limit - Calls in flight at once
|
|
12
|
+
* @param {Function} fn - async (item, index) -> result
|
|
13
|
+
* @returns {Promise<Array>}
|
|
14
|
+
*/
|
|
15
|
+
async function mapConcurrent(items, limit, fn) {
|
|
16
|
+
const results = new Array(items.length);
|
|
17
|
+
let next = 0;
|
|
18
|
+
let failure = null;
|
|
19
|
+
const runner = async () => {
|
|
20
|
+
while (next < items.length && !failure) {
|
|
21
|
+
const index = next++;
|
|
22
|
+
try {
|
|
23
|
+
results[index] = await fn(items[index], index);
|
|
24
|
+
} catch (err) {
|
|
25
|
+
failure = failure || err;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
await Promise.all(Array.from({ length: Math.max(1, Math.min(limit, items.length)) }, runner));
|
|
30
|
+
if (failure) {
|
|
31
|
+
throw failure;
|
|
32
|
+
}
|
|
33
|
+
return results;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
module.exports = { mapConcurrent };
|
package/lib/utils/network.js
CHANGED
|
@@ -54,6 +54,33 @@ function parseComparableIp(address) {
|
|
|
54
54
|
* @param {string} range - CIDR range
|
|
55
55
|
* @returns {Array} `[address, bits]` as ipaddr.js reports it, unwrapped where applicable
|
|
56
56
|
*/
|
|
57
|
+
/**
|
|
58
|
+
* The address a per-client budget (a failed-login count, a rate limit) is kept for. An IPv6
|
|
59
|
+
* client has at least a /64 to pick addresses from, so a budget keyed on the full address was a
|
|
60
|
+
* fresh budget per guess; the /64 is the unit a client controls. IPv4 and IPv4-mapped addresses
|
|
61
|
+
* are kept whole, and a value that is not an address is used as it is
|
|
62
|
+
*
|
|
63
|
+
* @param {String} remoteAddress
|
|
64
|
+
* @returns {String}
|
|
65
|
+
*/
|
|
66
|
+
function budgetAddress(remoteAddress) {
|
|
67
|
+
if (!remoteAddress) {
|
|
68
|
+
return 'unknown';
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
let addr = parseComparableIp(remoteAddress);
|
|
72
|
+
if (addr.kind() === 'ipv6') {
|
|
73
|
+
return `${addr.parts
|
|
74
|
+
.slice(0, 4)
|
|
75
|
+
.map(part => part.toString(16))
|
|
76
|
+
.join(':')}::/64`;
|
|
77
|
+
}
|
|
78
|
+
return addr.toString();
|
|
79
|
+
} catch (err) {
|
|
80
|
+
return String(remoteAddress);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
57
84
|
function parseComparableCidr(range) {
|
|
58
85
|
let [parsed, bits] = ipaddr.parseCIDR(range);
|
|
59
86
|
|
|
@@ -380,6 +407,7 @@ module.exports = {
|
|
|
380
407
|
getAccountHttpRoute,
|
|
381
408
|
parseComparableIp,
|
|
382
409
|
parseComparableCidr,
|
|
410
|
+
budgetAddress,
|
|
383
411
|
matchIp,
|
|
384
412
|
resolveClientIp,
|
|
385
413
|
detectAutomatedRequest,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Whether a provider id can become one path segment of a provider API URL.
|
|
4
|
+
//
|
|
5
|
+
// Provider ids are opaque strings the provider handed out, but the ones a request carries (a
|
|
6
|
+
// search by emailId or threadId, a reference threadId) and the ones inside a compound id
|
|
7
|
+
// (attachment and text ids are msgpack inside base64url) arrive from the API caller, and nothing
|
|
8
|
+
// above the client has looked at them. A segment of `..` walks the URL up to a sibling resource on
|
|
9
|
+
// the same token (another mailbox, on an application-credentials app), a `/` ends the segment
|
|
10
|
+
// early, and `?`, `#` and `%` change what the rest of the URL means. The joi schemas of the request
|
|
11
|
+
// ids and the clients' check of a decoded part are this one rule.
|
|
12
|
+
|
|
13
|
+
// eslint-disable-next-line no-control-regex
|
|
14
|
+
const PROVIDER_ID_SEGMENT = /^(?!\.{1,2}$)[^\s/\\?#%\u0000-\u001f\u007f]+$/;
|
|
15
|
+
|
|
16
|
+
// longer than any id a provider hands out; the regex has no cap of its own
|
|
17
|
+
const MAX_PROVIDER_ID_LENGTH = 1024;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @param {*} value - the decoded part
|
|
21
|
+
* @returns {Boolean}
|
|
22
|
+
*/
|
|
23
|
+
function isSafePathSegment(value) {
|
|
24
|
+
return typeof value === 'string' && value.length <= MAX_PROVIDER_ID_LENGTH && PROVIDER_ID_SEGMENT.test(value);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
module.exports = { PROVIDER_ID_SEGMENT, isSafePathSegment };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Whether a cleartext SMTP connection must upgrade with STARTTLS.
|
|
4
|
+
//
|
|
5
|
+
// Nodemailer's default is opportunistic: with `secure: false` it upgrades when the server
|
|
6
|
+
// advertises STARTTLS and otherwise carries on in cleartext, AUTH included, which is what an
|
|
7
|
+
// attacker on the path who strips the advertisement gets. Every SMTP transport EmailEngine builds
|
|
8
|
+
// (an account's own server, a gateway, the verification probe) therefore asks for `requireTLS`
|
|
9
|
+
// unless the stored configuration says `requireTLS: false`, the opt-out for a relay on a trusted
|
|
10
|
+
// network that has no TLS at all. A connection that is `secure: true` from the start needs no
|
|
11
|
+
// upgrade and is left alone. lib/create-imap-client.js applies the same rule to IMAP.
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Settles `requireTLS` on an SMTP transport configuration, in place.
|
|
15
|
+
*
|
|
16
|
+
* @param {Object} smtpSettings - Nodemailer transport options, carrying EmailEngine's `requireTLS`
|
|
17
|
+
* @returns {Object} the same object
|
|
18
|
+
*/
|
|
19
|
+
function applyRequireTls(smtpSettings) {
|
|
20
|
+
if (!smtpSettings || typeof smtpSettings !== 'object') {
|
|
21
|
+
return smtpSettings;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (smtpSettings.secure) {
|
|
25
|
+
delete smtpSettings.requireTLS;
|
|
26
|
+
return smtpSettings;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
smtpSettings.requireTLS = smtpSettings.requireTLS !== false;
|
|
30
|
+
return smtpSettings;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
module.exports = { applyRequireTls };
|
package/lib/web-safe-html.js
CHANGED
|
@@ -5,7 +5,7 @@ const { analyze } = require('@postalsys/email-content');
|
|
|
5
5
|
// lazy getter, and touching it loads jsdom (tens of MB of heap) into every process that merely
|
|
6
6
|
// requires this module, the main process included.
|
|
7
7
|
const textTools = require('@postalsys/email-text-tools');
|
|
8
|
-
const { getBoolean, readEnvValue } = require('./tools');
|
|
8
|
+
const { getBoolean, readEnvValue, attributeValueRegex } = require('./tools');
|
|
9
9
|
const { COLLAPSE_CLASS, COLLAPSE_TOGGLE_CLASS } = require('./consts');
|
|
10
10
|
const logger = require('./logger');
|
|
11
11
|
const he = require('he');
|
|
@@ -385,9 +385,8 @@ async function collapseThreadHistory(messageData) {
|
|
|
385
385
|
// prefix). A renderer folds whatever carries them, so they must only ever come from us.
|
|
386
386
|
const RESERVED_CLASS_NAME = /^ee-collapsed-thread/i;
|
|
387
387
|
|
|
388
|
-
// A class attribute with its value in any of the three HTML syntaxes
|
|
389
|
-
|
|
390
|
-
const CLASS_ATTRIBUTE = /([\s/]class\s*=\s*)(?:"([^"]*)"|'([^']*)'|([^\s"'>]+))/gi;
|
|
388
|
+
// A class attribute with its value in any of the three HTML syntaxes
|
|
389
|
+
const CLASS_ATTRIBUTE = attributeValueRegex(['class']);
|
|
391
390
|
|
|
392
391
|
/**
|
|
393
392
|
* Removes the collapse marker's class names from sender HTML.
|
|
@@ -405,8 +404,8 @@ function stripReservedClasses(html) {
|
|
|
405
404
|
return html;
|
|
406
405
|
}
|
|
407
406
|
|
|
408
|
-
return html.replace(CLASS_ATTRIBUTE, (match, prefix,
|
|
409
|
-
let raw =
|
|
407
|
+
return html.replace(CLASS_ATTRIBUTE, (match, prefix, value) => {
|
|
408
|
+
let raw = /^["']/.test(value) ? value.slice(1, -1) : value;
|
|
410
409
|
let tokens = he.decode(raw, { isAttributeValue: true }).split(/\s+/);
|
|
411
410
|
let kept = tokens.filter(token => token && !RESERVED_CLASS_NAME.test(token));
|
|
412
411
|
if (kept.length === tokens.filter(token => token).length) {
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// A delivery penalty per webhook target.
|
|
4
|
+
//
|
|
5
|
+
// The webhook queue is one queue with a small concurrency, and every attempt against a target
|
|
6
|
+
// that accepts the connection and never answers costs the whole attempt timeout (30 seconds by
|
|
7
|
+
// default). One account pointing its own webhook URL at such a target, and generating a dozen
|
|
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 just ran into the timeout is
|
|
10
|
+
// penalised: for a short while, deliveries to the same origin are moved back to the delayed set
|
|
11
|
+
// instead of being attempted, and the queue spends its time on targets that answer. The
|
|
12
|
+
// penalised delivery is not lost, it is tried again once the penalty is over, with its attempt
|
|
13
|
+
// count unchanged.
|
|
14
|
+
//
|
|
15
|
+
// Only the slow failures count. A refused or reset connection and a name that does not resolve
|
|
16
|
+
// fail in milliseconds, so they never hold the queue, and penalising them would defer every
|
|
17
|
+
// delivery to a receiver for a minute because it was restarting when one attempt arrived. A
|
|
18
|
+
// target answering with an HTTP status, any status, is not penalised either: it answered
|
|
19
|
+
// quickly, and the retry schedule already spaces those out. Nor is an egress or redirect
|
|
20
|
+
// refusal, which fails the job for good anyway.
|
|
21
|
+
|
|
22
|
+
const { createHash } = require('crypto');
|
|
23
|
+
const { REDIS_PREFIX } = require('./consts');
|
|
24
|
+
|
|
25
|
+
// At most this long per penalty, whatever the attempt timeout is set to
|
|
26
|
+
const MAX_PENALTY_MS = 5 * 60 * 1000;
|
|
27
|
+
|
|
28
|
+
// The failures that cost the attempt its whole timeout: lib/webhook-request.js reports its
|
|
29
|
+
// own deadline as ETIMEDOUT, undici's dispatcher deadlines carry their own codes
|
|
30
|
+
const SLOW_FAILURE_CODES = new Set(['ETIMEDOUT', 'UND_ERR_CONNECT_TIMEOUT', 'UND_ERR_HEADERS_TIMEOUT', 'UND_ERR_BODY_TIMEOUT']);
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Redis key of the penalty for a target, by its origin: a receiver is one host, whatever paths
|
|
34
|
+
* its URLs have, and the credentials in the URL are not part of what identifies it.
|
|
35
|
+
*
|
|
36
|
+
* @param {String} url - the delivery URL
|
|
37
|
+
* @returns {String|null} the key, or null for a URL that does not parse
|
|
38
|
+
*/
|
|
39
|
+
function penaltyKey(url) {
|
|
40
|
+
let origin;
|
|
41
|
+
try {
|
|
42
|
+
origin = new URL(url).origin;
|
|
43
|
+
} catch (err) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
if (!origin || origin === 'null') {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
return `${REDIS_PREFIX}webhook:penalty:${createHash('sha256').update(origin).digest('base64url').slice(0, 32)}`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* How long a target is penalised after a failed attempt, in milliseconds; 0 when the failure is
|
|
54
|
+
* not the kind that holds the queue.
|
|
55
|
+
*
|
|
56
|
+
* @param {Error} err - the failure
|
|
57
|
+
* @param {Number} attemptTimeout - the per-attempt wall clock cap, in milliseconds
|
|
58
|
+
* @returns {Number}
|
|
59
|
+
*/
|
|
60
|
+
function penaltyFor(err, attemptTimeout) {
|
|
61
|
+
if (!err || typeof err !== 'object') {
|
|
62
|
+
return 0;
|
|
63
|
+
}
|
|
64
|
+
let code = err.code || (err.cause && err.cause.code);
|
|
65
|
+
if (!code || !SLOW_FAILURE_CODES.has(code)) {
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
// twice the attempt cap: long enough that a dozen events a minute to a dead target no
|
|
69
|
+
// longer each cost a full timeout, short enough that a target that comes back is not
|
|
70
|
+
// kept waiting for long
|
|
71
|
+
let penalty = 2 * (Number(attemptTimeout) || 0);
|
|
72
|
+
return Math.min(Math.max(penalty, 1000), MAX_PENALTY_MS);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
module.exports = { penaltyKey, penaltyFor, MAX_PENALTY_MS };
|
package/lib/webhook-routing.js
CHANGED
|
@@ -59,7 +59,7 @@ function deliveryCustomHeaders(source, lists) {
|
|
|
59
59
|
let headers = {};
|
|
60
60
|
for (let level of headerLevels(source)) {
|
|
61
61
|
for (let header of [].concat(lists[level] || [])) {
|
|
62
|
-
if (header && header.key) {
|
|
62
|
+
if (header && header.key && !isReservedDeliveryHeader(header.key)) {
|
|
63
63
|
headers[header.key] = header.value;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -67,6 +67,17 @@ function deliveryCustomHeaders(source, lists) {
|
|
|
67
67
|
return headers;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
// Headers a custom header list may not set. The framing ones describe the request the worker is
|
|
71
|
+
// sending and are not the sender's to change; the X-EE-Wh-* ones are what the receiver reads to
|
|
72
|
+
// tell EmailEngine's own deliveries apart (the job id it deduplicates on, the attempt count, the
|
|
73
|
+
// custom route), so a list an account-scoped token writes must not be able to forge them
|
|
74
|
+
const RESERVED_DELIVERY_HEADERS = new Set(['host', 'content-length', 'transfer-encoding', 'connection', 'expect', 'te', 'upgrade']);
|
|
75
|
+
|
|
76
|
+
function isReservedDeliveryHeader(key) {
|
|
77
|
+
let name = String(key).trim().toLowerCase();
|
|
78
|
+
return RESERVED_DELIVERY_HEADERS.has(name) || name.startsWith('x-ee-wh-');
|
|
79
|
+
}
|
|
80
|
+
|
|
70
81
|
// Whether a queued custom-route job was meant to carry a mapped payload and does not. A route
|
|
71
82
|
// with a map script is queued with its mapping or not at all (lib/webhooks.js pushToQueue), so
|
|
72
83
|
// this only fires for jobs queued before that, which carry the result of a failed map as
|
|
@@ -130,4 +141,13 @@ function describeEffectiveRouting(opts) {
|
|
|
130
141
|
};
|
|
131
142
|
}
|
|
132
143
|
|
|
133
|
-
module.exports = {
|
|
144
|
+
module.exports = {
|
|
145
|
+
resolveTargetUrl,
|
|
146
|
+
isDeliverableRoute,
|
|
147
|
+
eventAllowed,
|
|
148
|
+
describeEffectiveRouting,
|
|
149
|
+
headerLevels,
|
|
150
|
+
deliveryCustomHeaders,
|
|
151
|
+
isReservedDeliveryHeader,
|
|
152
|
+
isRouteMappingMissing
|
|
153
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "emailengine-app",
|
|
3
|
-
"version": "2.84.
|
|
3
|
+
"version": "2.84.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"productTitle": "EmailEngine",
|
|
6
6
|
"description": "Email Sync Engine",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"scripts": {
|
|
9
9
|
"prepare": "git rev-parse --git-dir >/dev/null 2>&1 && git config core.hooksPath .githooks || true",
|
|
10
10
|
"start": "node server.js",
|
|
11
|
-
"dev": "EE_OPENAPI_VERBOSE=true EENGINE_LOG_RAW=true node
|
|
11
|
+
"dev": "EE_OPENAPI_VERBOSE=true EENGINE_LOG_RAW=true node server --dbs.redis='redis://127.0.0.1:6379/9' --api.port=7003 --api.host=0.0.0.0 | tee $HOME/ee.log.dev.txt | pino-pretty",
|
|
12
12
|
"single": "EE_OPENAPI_VERBOSE=true EENGINE_LOG_RAW=true EENGINE_SECRET=your-encryption-key EENGINE_WORKERS=1 node --inspect server --dbs.redis='redis://127.0.0.1:6379/6' --api.port=7003 --api.host=0.0.0.0 | tee $HOME/ee.log.single.txt | pino-pretty",
|
|
13
13
|
"gmail": "EE_OPENAPI_VERBOSE=true EENGINE_LOG_RAW=true EENGINE_SECRET=your-encryption-key EENGINE_WORKERS=2 EENGINE_CORS_ORIGIN='*' node --inspect server --dbs.redis='redis://127.0.0.1:6379/11' --api.port=7003 --api.host=0.0.0.0 | tee $HOME/ee.log.gmail.txt | pino-pretty",
|
|
14
14
|
"test": "npm run lint:src && npm run test:unit && npm run test:integration",
|
|
@@ -61,18 +61,18 @@
|
|
|
61
61
|
"@hapi/vision": "7.0.3",
|
|
62
62
|
"@msgpack/msgpack": "3.1.3",
|
|
63
63
|
"@postalsys/bounce-classifier": "3.0.1",
|
|
64
|
-
"@postalsys/certs": "1.4.
|
|
65
|
-
"@postalsys/email-ai-tools": "2.2.
|
|
66
|
-
"@postalsys/email-content": "0.1.
|
|
67
|
-
"@postalsys/email-text-tools": "2.4.
|
|
64
|
+
"@postalsys/certs": "1.4.6",
|
|
65
|
+
"@postalsys/email-ai-tools": "2.2.7",
|
|
66
|
+
"@postalsys/email-content": "0.1.16",
|
|
67
|
+
"@postalsys/email-text-tools": "2.4.25",
|
|
68
68
|
"@postalsys/gettext": "4.1.1",
|
|
69
69
|
"@postalsys/joi-messages": "1.3.1",
|
|
70
70
|
"@postalsys/templates": "2.0.4",
|
|
71
71
|
"@sentry/node-core": "10.76.2",
|
|
72
72
|
"@simplewebauthn/server": "14.0.3",
|
|
73
|
-
"@zone-eu/mailsplit": "5.4.
|
|
74
|
-
"@zone-eu/wild-config": "1.7.
|
|
75
|
-
"bullmq": "6.3.
|
|
73
|
+
"@zone-eu/mailsplit": "5.4.26",
|
|
74
|
+
"@zone-eu/wild-config": "1.7.9",
|
|
75
|
+
"bullmq": "6.3.16",
|
|
76
76
|
"compare-versions": "6.1.1",
|
|
77
77
|
"dotenv": "18.0.8",
|
|
78
78
|
"encoding-japanese": "2.4.0",
|
|
@@ -85,45 +85,45 @@
|
|
|
85
85
|
"html-to-text": "10.0.1",
|
|
86
86
|
"ical.js": "2.2.1",
|
|
87
87
|
"iconv-lite": "0.7.3",
|
|
88
|
-
"imapflow": "2.
|
|
88
|
+
"imapflow": "2.5.5",
|
|
89
89
|
"ioredfour": "1.4.4",
|
|
90
90
|
"ioredis": "6.0.0",
|
|
91
91
|
"ipaddr.js": "2.5.0",
|
|
92
|
-
"joi": "18.
|
|
93
|
-
"libbase64": "1.
|
|
94
|
-
"libmime": "5.
|
|
95
|
-
"libqp": "
|
|
96
|
-
"mailparser": "3.9.
|
|
92
|
+
"joi": "18.3.0",
|
|
93
|
+
"libbase64": "1.4.1",
|
|
94
|
+
"libmime": "5.5.1",
|
|
95
|
+
"libqp": "3.0.1",
|
|
96
|
+
"mailparser": "3.9.46",
|
|
97
97
|
"marked": "15.0.12",
|
|
98
98
|
"minimist": "1.2.8",
|
|
99
99
|
"murmurhash": "2.0.1",
|
|
100
100
|
"nanoid": "3.3.20",
|
|
101
|
-
"nodemailer": "10.1.
|
|
101
|
+
"nodemailer": "10.1.7",
|
|
102
102
|
"pino": "10.3.1",
|
|
103
103
|
"prom-client": "15.1.3",
|
|
104
104
|
"psl": "1.15.0",
|
|
105
105
|
"pubface": "1.1.18",
|
|
106
106
|
"punycode.js": "2.3.1",
|
|
107
107
|
"qrcode-generator": "2.0.4",
|
|
108
|
-
"smtp-server": "3.
|
|
108
|
+
"smtp-server": "3.20.2",
|
|
109
109
|
"socks": "2.8.10",
|
|
110
110
|
"timezones-list": "3.1.0",
|
|
111
|
-
"undici": "7.30.
|
|
111
|
+
"undici": "7.30.1"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@eslint/js": "10.0.1",
|
|
115
115
|
"@iconify-json/tabler": "1.2.42",
|
|
116
116
|
"@iconify/tailwind4": "1.2.3",
|
|
117
117
|
"@playwright/test": "1.63.0",
|
|
118
|
-
"@postalsys/ee-client": "1.8.
|
|
118
|
+
"@postalsys/ee-client": "1.8.2",
|
|
119
119
|
"@simplewebauthn/browser": "14.0.0",
|
|
120
120
|
"@tailwindcss/cli": "4.3.3",
|
|
121
|
-
"ace-builds": "1.
|
|
121
|
+
"ace-builds": "1.45.0",
|
|
122
122
|
"acorn": "8.19.0",
|
|
123
123
|
"acorn-walk": "8.3.5",
|
|
124
124
|
"chai": "4.5.0",
|
|
125
125
|
"eerawlog": "1.5.5",
|
|
126
|
-
"eslint": "10.
|
|
126
|
+
"eslint": "10.13.0",
|
|
127
127
|
"flyonui": "2.4.1",
|
|
128
128
|
"pino-pretty": "13.2.0",
|
|
129
129
|
"prettier": "3.9.10",
|