emailengine-app 2.79.8 → 2.79.9
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/.github/dependabot.yml +22 -0
- package/.github/workflows/test.yml +39 -0
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +20 -0
- package/DOCKER_DEPLOYMENT.md +6 -7
- package/Dockerfile +35 -11
- package/config/default.toml +2 -1
- package/copy-static-files.sh +23 -5
- package/data/google-crawlers.json +1 -1
- package/lib/account.js +26 -1
- package/lib/api-routes/bull-board-routes.js +3 -2
- package/lib/api-routes/route-helpers.js +8 -0
- package/lib/auth-token.js +73 -2
- package/lib/autodetect-imap-settings.js +33 -25
- package/lib/consts.js +8 -1
- package/lib/egress-fetch.js +133 -0
- package/lib/export.js +35 -2
- package/lib/handlebars-helpers.js +129 -0
- package/lib/imap-proxy-auth.js +41 -21
- package/lib/imapproxy/imap-core/README.md +1 -0
- package/lib/imapproxy/imap-core/lib/tls-options.js +5 -46
- package/lib/imapproxy/imap-server.js +9 -10
- package/lib/openapi/index.js +3 -0
- package/lib/outbox.js +28 -3
- package/lib/rate-limit.js +23 -4
- package/lib/schemas.js +10 -3
- package/lib/security-headers.js +396 -0
- package/lib/sentry.js +36 -4
- package/lib/smtp-auth.js +86 -7
- package/lib/tools.js +265 -120
- package/lib/ui-routes/account-routes.js +4 -3
- package/lib/ui-routes/export-routes.js +4 -0
- package/lib/ui-routes/mcp-consent-routes.js +7 -0
- package/lib/ui-routes/network-config-routes.js +4 -3
- package/lib/ui-routes/route-helpers.js +24 -8
- package/lib/ui-routes/smtp-test-routes.js +7 -0
- package/lib/webhook-egress.js +5 -0
- package/package.json +21 -24
- package/sbom.json +1 -1
- package/server.js +37 -36
- package/static/js/ace/css/ace.css +1462 -0
- package/static/js/ace/css/kuroir-1.png +0 -0
- package/static/js/ace/css/kuroir-2.png +0 -0
- package/static/js/ace/css/main-1.png +0 -0
- package/static/js/ace/css/main-10.svg +4 -0
- package/static/js/ace/css/main-11.svg +5 -0
- package/static/js/ace/css/main-12.svg +4 -0
- package/static/js/ace/css/main-13.png +0 -0
- package/static/js/ace/css/main-14.png +0 -0
- package/static/js/ace/css/main-15.png +0 -0
- package/static/js/ace/css/main-16.png +0 -0
- package/static/js/ace/css/main-17.png +0 -0
- package/static/js/ace/css/main-18.png +0 -0
- package/static/js/ace/css/main-19.png +0 -0
- package/static/js/ace/css/main-2.png +0 -0
- package/static/js/ace/css/main-20.png +0 -0
- package/static/js/ace/css/main-21.png +0 -0
- package/static/js/ace/css/main-22.png +0 -0
- package/static/js/ace/css/main-23.png +0 -0
- package/static/js/ace/css/main-24.png +0 -0
- package/static/js/ace/css/main-25.svg +1 -0
- package/static/js/ace/css/main-26.png +0 -0
- package/static/js/ace/css/main-3.png +0 -0
- package/static/js/ace/css/main-4.png +0 -0
- package/static/js/ace/css/main-5.svg +7 -0
- package/static/js/ace/css/main-6.svg +9 -0
- package/static/js/ace/css/main-7.svg +7 -0
- package/static/js/ace/css/main-8.svg +9 -0
- package/static/js/ace/css/main-9.svg +6 -0
- package/static/js/ace/css/theme/kuroir.css +78 -0
- package/static/js/ace/css/theme/tomorrow_night.css +128 -0
- package/static/js/ace/css/theme/tomorrow_night_eighties.css +128 -0
- package/static/js/ace/css/theme/xcode.css +106 -0
- package/static/js/ace/css/tomorrow_night-1.png +0 -0
- package/static/js/ace/css/tomorrow_night-2.png +0 -0
- package/static/js/ace/css/tomorrow_night_eighties-1.png +0 -0
- package/static/js/ace/css/tomorrow_night_eighties-2.png +0 -0
- package/static/js/ace/css/xcode-1.png +0 -0
- package/static/js/ace/css/xcode-2.png +0 -0
- package/static/js/ee-client.js +256 -102
- package/static/js/public.js +7 -0
- package/static/js/ui.js +32 -0
- package/static/licenses.html +331 -291
- package/static/vendor/simplewebauthn/browser.min.js +2 -2
- package/translations/messages.pot +203 -157
- package/views/accounts/account.hbs +15 -37
- package/views/accounts/browse.hbs +3 -1
- package/views/accounts/edit.hbs +1 -1
- package/views/accounts/register/imap-server.hbs +1 -1
- package/views/config/ai.hbs +1 -1
- package/views/config/branding.hbs +2 -2
- package/views/config/document-store/chat.hbs +1 -1
- package/views/config/document-store/index.hbs +1 -1
- package/views/config/imap-proxy.hbs +1 -1
- package/views/config/license.hbs +1 -1
- package/views/config/mcp.hbs +1 -1
- package/views/config/network.hbs +14 -16
- package/views/config/oauth/app.hbs +2 -2
- package/views/config/service.hbs +1 -1
- package/views/config/smtp.hbs +1 -1
- package/views/config/webhooks.hbs +2 -2
- package/views/error.hbs +4 -2
- package/views/internals/index.hbs +1 -1
- package/views/layout/app.hbs +3 -11
- package/views/mcp/authorize.hbs +1 -1
- package/views/partials/ace_assets.hbs +13 -0
- package/views/partials/add_account_modal.hbs +1 -1
- package/views/partials/address_list.hbs +4 -4
- package/views/partials/filter_editor_js.hbs +2 -2
- package/views/partials/gateway_js.hbs +1 -1
- package/views/partials/oauth_form.hbs +1 -1
- package/views/partials/public_theme_init.hbs +1 -1
- package/views/partials/template_form.hbs +2 -2
- package/views/partials/test_send.hbs +7 -4
- package/views/partials/theme_init.hbs +1 -1
- package/views/partials/ui/details.hbs +2 -2
- package/views/partials/webhooks_editor_functions.hbs +1 -1
- package/views/reference/redirect.hbs +1 -1
- package/views/templates/template.hbs +2 -2
- package/views/tokens/new.hbs +1 -1
- package/views/unsubscribe.hbs +1 -1
- package/views/webhooks/webhook.hbs +2 -2
- package/workers/api.js +42 -112
- package/workers/export.js +1 -5
- package/workers/imap.js +1 -3
- package/workers/smtp.js +12 -43
- package/workers/submit.js +6 -12
- package/workers/webhooks.js +6 -17
- package/static/front/EmailEngine_logo_horiz.png +0 -0
- package/static/front/EmailEngine_logo_vert.png +0 -0
- package/static/front/index.html +0 -57
- package/static/front/logo.png +0 -0
- package/static/vendor/handlebars/handlebars.min-v4.7.9.js +0 -29
|
@@ -16,7 +16,7 @@ const { REDIS_PREFIX } = require('../consts');
|
|
|
16
16
|
const { failAction, getServiceHostname, reloadTlsServers } = require('../tools');
|
|
17
17
|
const { ADDRESS_STRATEGIES, settingsSchema } = require('../schemas');
|
|
18
18
|
const { updatePublicInterfaces } = require('../utils/network');
|
|
19
|
-
const { getServerStatus,
|
|
19
|
+
const { getServerStatus, compiledFragments } = require('./route-helpers');
|
|
20
20
|
const { registerSettingsPage } = require('./settings-page');
|
|
21
21
|
|
|
22
22
|
const configSmtpSchema = {
|
|
@@ -146,7 +146,6 @@ function init(args) {
|
|
|
146
146
|
imapStrategies: ADDRESS_STRATEGIES.map(entry => Object.assign({ selected: values.imapStrategy === entry.key }, entry)),
|
|
147
147
|
|
|
148
148
|
addresses: await listPublicInterfaces([].concat(values.localAddresses || [])),
|
|
149
|
-
addressListTemplate: cachedTemplates.addressList,
|
|
150
149
|
defaultSmtpEhloName: await getServiceHostname()
|
|
151
150
|
};
|
|
152
151
|
},
|
|
@@ -186,7 +185,9 @@ function init(args) {
|
|
|
186
185
|
|
|
187
186
|
return {
|
|
188
187
|
success: true,
|
|
189
|
-
|
|
188
|
+
// The page swaps its table body for this: the same partial the page was
|
|
189
|
+
// rendered with, so a rescan cannot drift from first paint
|
|
190
|
+
html: compiledFragments.addressList({ addresses: await listPublicInterfaces(localAddresses) })
|
|
190
191
|
};
|
|
191
192
|
} catch (err) {
|
|
192
193
|
request.logger.error({ msg: 'Failed loading public IP addresses', err });
|
|
@@ -6,20 +6,20 @@
|
|
|
6
6
|
// be extracted without stranding a helper its sibling groups still need. Pure functions
|
|
7
7
|
// and cached data only - this module registers no routes.
|
|
8
8
|
//
|
|
9
|
-
// Every symbol below was moved verbatim from lib/routes-ui.js
|
|
10
|
-
//
|
|
11
|
-
// lives one directory deeper (lib/ui-routes/) than the original (lib/).
|
|
9
|
+
// Every symbol below was moved verbatim from lib/routes-ui.js, apart from compiledFragments,
|
|
10
|
+
// which replaced the raw template sources the monolith handed to the browser.
|
|
12
11
|
|
|
13
12
|
const Boom = require('@hapi/boom');
|
|
14
13
|
const util = require('util');
|
|
15
14
|
const fs = require('fs');
|
|
16
15
|
const pathlib = require('path');
|
|
17
16
|
const psl = require('psl');
|
|
17
|
+
const handlebars = require('handlebars');
|
|
18
18
|
|
|
19
19
|
const settings = require('../settings');
|
|
20
20
|
const { redis } = require('../db');
|
|
21
21
|
const { toolGrants } = require('../mcp/tools');
|
|
22
|
-
const { Account, accountsExist, accountSummary, isAuthFailureDisabled } = require('../account');
|
|
22
|
+
const { Account, accountsExist, accountSummary, isAuthFailureDisabled, isAccessTokenInvalidated } = require('../account');
|
|
23
23
|
const { REDIS_PREFIX, DEFAULT_PAGE_SIZE } = require('../consts');
|
|
24
24
|
const { oauth2ProviderData } = require('../oauth2-apps');
|
|
25
25
|
const exampleDocumentsPayloads = require('../payload-examples-documents.json');
|
|
@@ -44,9 +44,22 @@ const OPEN_AI_MODELS = [
|
|
|
44
44
|
}
|
|
45
45
|
];
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
// Partials a page renders again after it has loaded: the delivery-test results and the address
|
|
48
|
+
// list after an IP rescan. They used to be shipped to the browser as source and compiled there,
|
|
49
|
+
// which runs `new Function` and would need 'unsafe-eval' in the Content-Security-Policy the
|
|
50
|
+
// admin surface sends. Compiled once here instead, outside vision but on the same handlebars
|
|
51
|
+
// instance it renders with, so the helpers and partials registered on it resolve at render
|
|
52
|
+
// time; the JSON endpoints return the rendered HTML. Not going through vision is deliberate: its
|
|
53
|
+
// per-request view context consumes the pending flash messages. What a fragment therefore lacks
|
|
54
|
+
// is that context - no `cspNonce`, so a fragment can never carry an inline <script>.
|
|
55
|
+
const FRAGMENT_COMPILE_OPTIONS = { preventIndent: true }; // matches the vision compileOptions in workers/api.js
|
|
56
|
+
|
|
57
|
+
const compiledFragments = {
|
|
58
|
+
addressList: handlebars.compile(
|
|
59
|
+
fs.readFileSync(pathlib.join(__dirname, '..', '..', 'views', 'partials', 'address_list.hbs'), 'utf-8'),
|
|
60
|
+
FRAGMENT_COMPILE_OPTIONS
|
|
61
|
+
),
|
|
62
|
+
testSend: handlebars.compile(fs.readFileSync(pathlib.join(__dirname, '..', '..', 'views', 'partials', 'test_send.hbs'), 'utf-8'), FRAGMENT_COMPILE_OPTIONS)
|
|
50
63
|
};
|
|
51
64
|
|
|
52
65
|
const getOpenAiModels = async (models, selectedModel) => {
|
|
@@ -244,6 +257,9 @@ function formatAccountData(account, gt) {
|
|
|
244
257
|
account.oauth2.expiresStr = account.oauth2.expires ? account.oauth2.expires.toISOString() : false;
|
|
245
258
|
account.oauth2.generatedStr = account.oauth2.generated ? account.oauth2.generated.toISOString() : false;
|
|
246
259
|
|
|
260
|
+
// the view names the state instead of printing the inverted range the invalidation leaves
|
|
261
|
+
account.oauth2.accessTokenInvalidated = isAccessTokenInvalidated(account.oauth2);
|
|
262
|
+
|
|
247
263
|
if (account.outlookSubscription) {
|
|
248
264
|
account.outlookSubscription.subscriptionExpiresStr = account.outlookSubscription.expirationDateTime
|
|
249
265
|
? account.outlookSubscription.expirationDateTime.toISOString()
|
|
@@ -593,7 +609,7 @@ module.exports = {
|
|
|
593
609
|
accountPickerSelection,
|
|
594
610
|
identityErrorView,
|
|
595
611
|
OPEN_AI_MODELS,
|
|
596
|
-
|
|
612
|
+
compiledFragments,
|
|
597
613
|
getOpenAiModels,
|
|
598
614
|
closedAfterConnectMessage,
|
|
599
615
|
accountStateLabel,
|
|
@@ -13,6 +13,7 @@ const getSecret = require('../get-secret');
|
|
|
13
13
|
const { failAction, httpAgent } = require('../tools');
|
|
14
14
|
const { accountIdSchema } = require('../schemas');
|
|
15
15
|
const { REDIS_PREFIX } = require('../consts');
|
|
16
|
+
const { compiledFragments } = require('./route-helpers');
|
|
16
17
|
const packageData = require('../../package.json');
|
|
17
18
|
|
|
18
19
|
const SMTP_TEST_HOST = 'https://api.nodemailer.com';
|
|
@@ -207,6 +208,12 @@ ${now}`,
|
|
|
207
208
|
if (testResponse.spf && testResponse.spf.status && testResponse.spf.status.comment) {
|
|
208
209
|
testResponse.spf.status.comment = testResponse.spf.status.comment.replace(/^[^:\s]+:s*/, '');
|
|
209
210
|
}
|
|
211
|
+
|
|
212
|
+
if (testResponse.status === 'success') {
|
|
213
|
+
// The page shows the results through this fragment rather than
|
|
214
|
+
// compiling the template in the browser, which the admin CSP forbids
|
|
215
|
+
testResponse.html = compiledFragments.testSend(testResponse);
|
|
216
|
+
}
|
|
210
217
|
}
|
|
211
218
|
|
|
212
219
|
return testResponse;
|
package/lib/webhook-egress.js
CHANGED
|
@@ -13,6 +13,11 @@ const { assertAllowedUrl, createEgressLookup, normalizePolicy, POLICY_OFF } = re
|
|
|
13
13
|
// system can aim EmailEngine at anything its host can route to. Defaults to blocking the
|
|
14
14
|
// link-local range (cloud instance metadata); `private` also blocks RFC1918 and friends, `off`
|
|
15
15
|
// disables the check and restores redirect following. See lib/egress-filter.js
|
|
16
|
+
//
|
|
17
|
+
// The autodiscovery lookups (lib/autodetect-imap-settings.js) apply the same policy: their
|
|
18
|
+
// destinations are derived from the domain of a caller-supplied email address, which a DNS record
|
|
19
|
+
// can point anywhere. One policy rather than two because they guard the same thing, the host's
|
|
20
|
+
// network position, and an operator who tuned it for webhooks meant the tuning for all egress.
|
|
16
21
|
const WEBHOOK_EGRESS_POLICY = normalizePolicy(readEnvValue('EENGINE_WEBHOOK_EGRESS_POLICY'));
|
|
17
22
|
|
|
18
23
|
const policyEnabled = WEBHOOK_EGRESS_POLICY !== POLICY_OFF;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "emailengine-app",
|
|
3
|
-
"version": "2.79.
|
|
3
|
+
"version": "2.79.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"productTitle": "EmailEngine",
|
|
6
6
|
"description": "Email Sync Engine",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
},
|
|
52
52
|
"homepage": "https://emailengine.app/",
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@bull-board/api": "9.
|
|
55
|
-
"@bull-board/hapi": "9.
|
|
54
|
+
"@bull-board/api": "9.8.0",
|
|
55
|
+
"@bull-board/hapi": "9.8.0",
|
|
56
56
|
"@elastic/elasticsearch": "8.15.3",
|
|
57
57
|
"@hapi/accept": "6.0.3",
|
|
58
58
|
"@hapi/bell": "13.1.0",
|
|
@@ -65,17 +65,17 @@
|
|
|
65
65
|
"@msgpack/msgpack": "3.1.3",
|
|
66
66
|
"@phc/pbkdf2": "1.1.14",
|
|
67
67
|
"@postalsys/bounce-classifier": "3.0.0",
|
|
68
|
-
"@postalsys/certs": "1.
|
|
69
|
-
"@postalsys/ee-client": "1.
|
|
70
|
-
"@postalsys/email-ai-tools": "1.
|
|
71
|
-
"@postalsys/email-content": "0.1.
|
|
72
|
-
"@postalsys/email-text-tools": "2.4.
|
|
68
|
+
"@postalsys/certs": "1.1.1",
|
|
69
|
+
"@postalsys/ee-client": "1.8.0",
|
|
70
|
+
"@postalsys/email-ai-tools": "1.14.3",
|
|
71
|
+
"@postalsys/email-content": "0.1.5",
|
|
72
|
+
"@postalsys/email-text-tools": "2.4.16",
|
|
73
73
|
"@postalsys/gettext": "4.1.1",
|
|
74
74
|
"@postalsys/joi-messages": "1.0.5",
|
|
75
75
|
"@postalsys/templates": "2.0.2",
|
|
76
76
|
"@sentry/node": "10.73.0",
|
|
77
|
-
"@simplewebauthn/browser": "
|
|
78
|
-
"@simplewebauthn/server": "
|
|
77
|
+
"@simplewebauthn/browser": "14.0.0",
|
|
78
|
+
"@simplewebauthn/server": "14.0.1",
|
|
79
79
|
"@zone-eu/mailsplit": "5.4.16",
|
|
80
80
|
"@zone-eu/wild-config": "1.7.6",
|
|
81
81
|
"ace-builds": "1.44.0",
|
|
@@ -93,42 +93,42 @@
|
|
|
93
93
|
"html-to-text": "10.0.1",
|
|
94
94
|
"ical.js": "1.5.0",
|
|
95
95
|
"iconv-lite": "0.7.3",
|
|
96
|
-
"imapflow": "
|
|
96
|
+
"imapflow": "2.0.0",
|
|
97
97
|
"ioredfour": "1.4.3",
|
|
98
98
|
"ioredis": "6.0.0",
|
|
99
99
|
"ipaddr.js": "2.5.0",
|
|
100
|
-
"joi": "18.2.
|
|
100
|
+
"joi": "18.2.8",
|
|
101
101
|
"libbase64": "1.3.0",
|
|
102
102
|
"libmime": "5.4.3",
|
|
103
103
|
"libqp": "2.1.1",
|
|
104
|
-
"mailparser": "3.9.
|
|
104
|
+
"mailparser": "3.9.23",
|
|
105
105
|
"marked": "15.0.12",
|
|
106
106
|
"minimist": "1.2.8",
|
|
107
107
|
"murmurhash": "2.0.1",
|
|
108
108
|
"nanoid": "3.3.18",
|
|
109
|
-
"nodemailer": "
|
|
109
|
+
"nodemailer": "10.0.1",
|
|
110
110
|
"pino": "10.3.1",
|
|
111
111
|
"prom-client": "15.1.3",
|
|
112
112
|
"psl": "1.15.0",
|
|
113
|
-
"pubface": "1.1.
|
|
113
|
+
"pubface": "1.1.12",
|
|
114
114
|
"punycode.js": "2.3.1",
|
|
115
115
|
"qrcode": "1.5.4",
|
|
116
|
-
"smtp-server": "3.19.
|
|
117
|
-
"socks": "2.8.
|
|
116
|
+
"smtp-server": "3.19.9",
|
|
117
|
+
"socks": "2.8.10",
|
|
118
118
|
"timezones-list": "3.1.0",
|
|
119
|
-
"undici": "7.29.
|
|
119
|
+
"undici": "7.29.1"
|
|
120
120
|
},
|
|
121
121
|
"devDependencies": {
|
|
122
122
|
"@eslint/js": "10.0.1",
|
|
123
123
|
"@iconify-json/tabler": "1.2.38",
|
|
124
124
|
"@iconify/tailwind4": "1.2.3",
|
|
125
|
-
"@playwright/test": "1.
|
|
125
|
+
"@playwright/test": "1.63.0",
|
|
126
126
|
"@tailwindcss/cli": "4.3.3",
|
|
127
127
|
"acorn": "8.18.0",
|
|
128
128
|
"acorn-walk": "8.3.5",
|
|
129
129
|
"chai": "4.5.0",
|
|
130
130
|
"eerawlog": "1.5.5",
|
|
131
|
-
"eslint": "10.
|
|
131
|
+
"eslint": "10.10.0",
|
|
132
132
|
"flyonui": "2.4.1",
|
|
133
133
|
"pino-pretty": "13.1.3",
|
|
134
134
|
"prettier": "3.9.6",
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"deepmerge-ts": "^8.0.1"
|
|
144
144
|
},
|
|
145
145
|
"engines": {
|
|
146
|
-
"node": ">=20.
|
|
146
|
+
"node": ">=20.0.0"
|
|
147
147
|
},
|
|
148
148
|
"pkg": {
|
|
149
149
|
"scripts": [
|
|
@@ -157,14 +157,11 @@
|
|
|
157
157
|
"static/**/*",
|
|
158
158
|
"views/**/*",
|
|
159
159
|
"lib/lua/**/*",
|
|
160
|
-
"node_modules/bull/lib/commands/**/*",
|
|
161
160
|
"translations/**/*",
|
|
162
161
|
"node_modules/@postalsys/joi-messages/translations/*",
|
|
163
162
|
"node_modules/@postalsys/bounce-classifier/model/**/*",
|
|
164
163
|
"node_modules/@postalsys/email-content/dist/detect/patterns/*.json",
|
|
165
164
|
"node_modules/jsdom/lib/jsdom/browser/default-stylesheet.css",
|
|
166
|
-
"node_modules/nodemailer/lib/well-known/*.json",
|
|
167
|
-
"node_modules/nodemailer/package.json",
|
|
168
165
|
"LICENSE_EMAILENGINE.txt",
|
|
169
166
|
"version-info.json",
|
|
170
167
|
"sbom.json"
|