emailengine-app 2.76.0 → 2.78.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/.github/workflows/release.yaml +24 -19
- package/.github/workflows/test.yml +80 -0
- package/.ncurc.js +14 -2
- package/.release-please-manifest.json +3 -0
- package/CHANGELOG.md +54 -0
- package/README.md +1 -1
- package/bin/emailengine.js +1 -1
- package/data/google-crawlers.json +1 -1
- package/encrypt.js +72 -5
- package/lib/account/expected-identity.js +88 -0
- package/lib/account.js +75 -26
- package/lib/address-strategies.js +18 -0
- package/lib/api-reference/code-samples.js +194 -0
- package/lib/api-reference/format.js +193 -0
- package/lib/api-reference/index.js +222 -0
- package/lib/api-reference/model.js +338 -0
- package/lib/api-reference/schema-tree.js +366 -0
- package/lib/api-routes/account-routes.js +136 -39
- package/lib/api-routes/behavior-notes.js +57 -0
- package/lib/api-routes/blocklist-routes.js +9 -9
- package/lib/api-routes/changes-routes.js +6 -4
- package/lib/api-routes/chat-routes.js +3 -3
- package/lib/api-routes/delivery-test-routes.js +24 -6
- package/lib/api-routes/export-routes.js +14 -12
- package/lib/api-routes/gateway-routes.js +11 -11
- package/lib/api-routes/license-routes.js +7 -7
- package/lib/api-routes/mailbox-routes.js +18 -9
- package/lib/api-routes/message-routes.js +55 -35
- package/lib/api-routes/oauth2-app-routes.js +22 -16
- package/lib/api-routes/outbox-routes.js +7 -7
- package/lib/api-routes/pubsub-routes.js +3 -3
- package/lib/api-routes/settings-routes.js +10 -9
- package/lib/api-routes/stats-routes.js +3 -3
- package/lib/api-routes/submit-routes.js +58 -8
- package/lib/api-routes/template-routes.js +13 -13
- package/lib/api-routes/token-routes.js +15 -10
- package/lib/api-routes/webhook-route-routes.js +5 -5
- package/lib/append-list.js +3 -14
- package/lib/arf-detect.js +23 -1
- package/lib/autodetect-imap-settings.js +40 -16
- package/lib/base32.js +30 -0
- package/lib/bounce-detect.js +182 -62
- package/lib/consts.js +7 -0
- package/lib/egress-filter.js +89 -8
- package/lib/email-client/base-client.js +72 -82
- package/lib/email-client/gmail-client.js +3 -3
- package/lib/email-client/imap/listing-diff.js +3 -3
- package/lib/email-client/imap/mailbox.js +5 -69
- package/lib/email-client/imap-client.js +3 -2
- package/lib/email-client/message-builder.js +13 -13
- package/lib/email-client/outlook-client.js +1 -1
- package/lib/enum-descriptions.js +130 -0
- package/lib/export.js +1 -1
- package/lib/gateway.js +1 -1
- package/lib/get-raw-email.js +1 -1
- package/lib/imapproxy/imap-core/lib/imap-connection.js +2 -2
- package/lib/imapproxy/imap-core/lib/imap-server.js +2 -2
- package/lib/imapproxy/imap-server.js +42 -28
- package/lib/imapproxy/upstream-client.js +38 -0
- package/lib/license-beacon.js +1 -1
- package/lib/llm-pre-process.js +1 -1
- package/lib/msgpack.js +62 -0
- package/lib/oauth/decode-jwt-payload.js +39 -0
- package/lib/oauth/outlook-identity.js +61 -0
- package/lib/oauth/retry-setup.js +38 -0
- package/lib/oauth2-apps.js +10 -4
- package/lib/openapi/build-document.js +318 -0
- package/lib/openapi/index.js +95 -0
- package/lib/openapi/joi-schema.js +523 -0
- package/lib/outbox.js +66 -3
- package/lib/pre-process.js +1 -1
- package/lib/read-env-value.js +37 -0
- package/lib/routes-ui.js +5 -1
- package/lib/schemas.js +88 -17
- package/lib/swagger-options.js +173 -0
- package/lib/templates.js +1 -1
- package/lib/tokens.js +70 -6
- package/lib/tools.js +117 -48
- package/lib/totp.js +67 -0
- package/lib/ui-routes/account-routes.js +91 -15
- package/lib/ui-routes/admin-config-routes.js +2 -7
- package/lib/ui-routes/admin-entities-routes.js +3 -0
- package/lib/ui-routes/auth-routes.js +6 -24
- package/lib/ui-routes/dashboard-routes.js +2 -26
- package/lib/ui-routes/reference-routes.js +198 -0
- package/lib/ui-routes/route-helpers.js +39 -0
- package/lib/utils/is-email.js +34 -0
- package/lib/utils/to-camel-case.js +17 -0
- package/lib/webhook-egress.js +37 -0
- package/lib/webhooks.js +1 -1
- package/package.json +27 -31
- package/prepare-bundle-deps.sh +28 -0
- package/release-please-config.json +11 -0
- package/sbom.json +1 -1
- package/server.js +11 -3
- package/static/css/flyonui.css +1 -1
- package/static/css/public.css +3 -0
- package/static/css/src/app.tailwind.css +113 -0
- package/static/js/app.js +69 -0
- package/static/js/ee-client.js +238 -8
- package/static/js/reference.js +1021 -0
- package/static/js/ui.js +61 -33
- package/static/licenses.html +658 -1560
- package/translations/README.md +64 -0
- package/translations/de.mo +0 -0
- package/translations/de.po +164 -120
- package/translations/en.po +200 -161
- package/translations/et.mo +0 -0
- package/translations/et.po +163 -120
- package/translations/fr.mo +0 -0
- package/translations/fr.po +163 -120
- package/translations/ja.mo +0 -0
- package/translations/ja.po +163 -120
- package/translations/messages.pot +84 -54
- package/translations/nl.mo +0 -0
- package/translations/nl.po +164 -120
- package/translations/pl.mo +0 -0
- package/translations/pl.po +163 -120
- package/views/account-identity-error.hbs +34 -0
- package/views/accounts/edit.hbs +1 -0
- package/views/accounts/register/imap.hbs +12 -2
- package/views/config/ai.hbs +1 -1
- package/views/config/document-store/chat.hbs +5 -5
- package/views/config/document-store/index.hbs +2 -2
- package/views/config/document-store/pre-processing/index.hbs +1 -1
- package/views/config/email-processing.hbs +1 -1
- package/views/config/imap-proxy.hbs +1 -1
- package/views/config/license.hbs +1 -1
- package/views/config/oauth/index.hbs +3 -3
- package/views/config/security.hbs +1 -1
- package/views/config/smtp.hbs +2 -2
- package/views/dashboard.hbs +1 -1
- package/views/layout/app.hbs +43 -8
- package/views/oauth-scope-error.hbs +1 -1
- package/views/partials/oauth_form.hbs +4 -4
- package/views/partials/reference/anchor-link.hbs +20 -0
- package/views/partials/reference/disclosure.hbs +37 -0
- package/views/partials/reference/nav.hbs +120 -0
- package/views/partials/reference/operation.hbs +127 -0
- package/views/partials/reference/params.hbs +20 -0
- package/views/partials/reference/schema-node.hbs +99 -0
- package/views/partials/reference/schema.hbs +19 -0
- package/views/partials/reference/section-heading.hbs +16 -0
- package/views/partials/reference/token-alert.hbs +49 -0
- package/views/partials/reference/try-field.hbs +31 -0
- package/views/partials/reference/try-it.hbs +78 -0
- package/views/partials/side_menu.hbs +1 -1
- package/views/partials/ui/badge.hbs +4 -2
- package/views/partials/ui/page-header.hbs +1 -1
- package/views/partials/ui/search-input.hbs +31 -0
- package/views/partials/ui/setting-ref.hbs +1 -1
- package/views/partials/ui/stat-card.hbs +4 -2
- package/views/partials/ui/tab.hbs +6 -1
- package/views/partials/ui/tabs.hbs +2 -2
- package/views/reference/index.hbs +76 -0
- package/views/reference/redirect.hbs +49 -0
- package/views/reference/tag.hbs +28 -0
- package/views/reference/token.hbs +49 -0
- package/views/tokens/index.hbs +9 -1
- package/views/webhooks/index.hbs +3 -3
- package/workers/api.js +194 -302
- package/workers/imap.js +1 -1
- package/workers/submit.js +1 -1
- package/workers/webhooks.js +2 -13
- package/views/swagger/index.hbs +0 -82
package/workers/imap.js
CHANGED
|
@@ -23,7 +23,7 @@ const { MessagePortWritable, pipeToMessagePort } = require('../lib/message-port-
|
|
|
23
23
|
const { packRpcError, unpackRpcError } = require('../lib/worker-rpc-error');
|
|
24
24
|
const { getESClient } = require('../lib/document-store');
|
|
25
25
|
const settings = require('../lib/settings');
|
|
26
|
-
const msgpack = require('
|
|
26
|
+
const msgpack = require('../lib/msgpack');
|
|
27
27
|
|
|
28
28
|
const getSecret = require('../lib/get-secret');
|
|
29
29
|
|
package/workers/submit.js
CHANGED
|
@@ -19,7 +19,7 @@ const { redis, queueConf, submitQueue } = require('../lib/db');
|
|
|
19
19
|
const { Worker } = require('bullmq');
|
|
20
20
|
const { Account } = require('../lib/account');
|
|
21
21
|
const getSecret = require('../lib/get-secret');
|
|
22
|
-
const msgpack = require('
|
|
22
|
+
const msgpack = require('../lib/msgpack');
|
|
23
23
|
|
|
24
24
|
const { EMAIL_FAILED_NOTIFY } = require('../lib/consts');
|
|
25
25
|
|
package/workers/webhooks.js
CHANGED
|
@@ -12,7 +12,7 @@ const { GooglePubSub } = require('../lib/oauth/pubsub/google');
|
|
|
12
12
|
|
|
13
13
|
const { readEnvValue, threadStats, getDuration, httpAgent, getServiceSecret, maybeReloadHttpProxyAgent } = require('../lib/tools');
|
|
14
14
|
const { sendWebhookRequest } = require('../lib/webhook-request');
|
|
15
|
-
const {
|
|
15
|
+
const { validateWebhookTarget } = require('../lib/webhook-egress');
|
|
16
16
|
|
|
17
17
|
const { initSentry } = require('../lib/sentry');
|
|
18
18
|
initSentry('webhooks');
|
|
@@ -40,17 +40,6 @@ const NOTIFY_QC = (readEnvValue('EENGINE_NOTIFY_QC') && Number(readEnvValue('EEN
|
|
|
40
40
|
// DEFAULT_WEBHOOK_REQUEST_TIMEOUT baked into sendWebhookRequest when unset
|
|
41
41
|
const WEBHOOK_TIMEOUT = getDuration(readEnvValue('EENGINE_WEBHOOK_TIMEOUT')) || false;
|
|
42
42
|
|
|
43
|
-
// Which destinations webhook deliveries may reach. An account-scoped API token can set both the
|
|
44
|
-
// webhook URL and its custom headers, so without this the least-privileged credential in the
|
|
45
|
-
// system can aim EmailEngine at anything its host can route to. Defaults to blocking the
|
|
46
|
-
// link-local range (cloud instance metadata); `private` also blocks RFC1918 and friends, `off`
|
|
47
|
-
// disables the check and restores redirect following. See lib/egress-filter.js
|
|
48
|
-
const WEBHOOK_EGRESS_POLICY = normalizePolicy(readEnvValue('EENGINE_WEBHOOK_EGRESS_POLICY'));
|
|
49
|
-
|
|
50
|
-
// Built once rather than per delivery. Null when the policy is off, which also restores fetch's
|
|
51
|
-
// own redirect following in sendWebhookRequest().
|
|
52
|
-
const validateWebhookTarget = WEBHOOK_EGRESS_POLICY === POLICY_OFF ? null : target => assertAllowedUrl(target, { policy: WEBHOOK_EGRESS_POLICY });
|
|
53
|
-
|
|
54
43
|
let callQueue = new Map();
|
|
55
44
|
let mids = 0;
|
|
56
45
|
|
|
@@ -424,7 +413,7 @@ const notifyWorker = new Worker(
|
|
|
424
413
|
method: 'post',
|
|
425
414
|
body,
|
|
426
415
|
headers,
|
|
427
|
-
dispatcher: httpAgent.
|
|
416
|
+
dispatcher: httpAgent.webhook,
|
|
428
417
|
timeout: WEBHOOK_TIMEOUT,
|
|
429
418
|
validateTarget: validateWebhookTarget
|
|
430
419
|
});
|
package/views/swagger/index.hbs
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
{{!-- swagger-ui has no dark mode of its own (its stylesheet assumes a light
|
|
2
|
-
page), so the reference renders as a light island: data-theme pins the
|
|
3
|
-
FlyonUI tokens and color-scheme to light for this subtree even while
|
|
4
|
-
the admin chrome around it is dark --}}
|
|
5
|
-
<div data-theme="light" class="rounded-box bg-white" style="color-scheme: light">
|
|
6
|
-
<div id="swagger-ui"></div>
|
|
7
|
-
</div>
|
|
8
|
-
|
|
9
|
-
<script src="/admin/swagger/resources/swagger-ui-bundle.js"></script>
|
|
10
|
-
<script src="/admin/swagger/resources/swagger-ui-standalone-preset.js"></script>
|
|
11
|
-
<script src="/admin/swagger/resources/extend.js" type="text/javascript"></script>
|
|
12
|
-
<script>
|
|
13
|
-
function getUrlVars() {
|
|
14
|
-
const vars = [];
|
|
15
|
-
let hash;
|
|
16
|
-
const hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
|
17
|
-
for (let i = 0; i < hashes.length; i++) {
|
|
18
|
-
hash = hashes[i].split('=');
|
|
19
|
-
vars.push(hash[0]);
|
|
20
|
-
vars[hash[0]] = hash[1];
|
|
21
|
-
}
|
|
22
|
-
return vars;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
document.addEventListener('DOMContentLoaded', function () {
|
|
26
|
-
|
|
27
|
-
let url = window.location.search.match(/url=([^&]+)/);
|
|
28
|
-
if (url && url.length > 1) {
|
|
29
|
-
url = decodeURIComponent(url[1]);
|
|
30
|
-
} else {
|
|
31
|
-
url = "/swagger.json";
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// pull validatorUrl string or null form server
|
|
35
|
-
let validatorUrl = null;
|
|
36
|
-
validatorUrl: '//online.swagger.io/validator';
|
|
37
|
-
|
|
38
|
-
const ACCESS_TOKEN_QUERY_PARAM_NAME = 'access_token';
|
|
39
|
-
const accessToken = getUrlVars()[ACCESS_TOKEN_QUERY_PARAM_NAME];
|
|
40
|
-
|
|
41
|
-
fetch(url)
|
|
42
|
-
.then(function (response) {
|
|
43
|
-
return response.json()
|
|
44
|
-
})
|
|
45
|
-
.then(function (json) {
|
|
46
|
-
|
|
47
|
-
if (json.openapi && json.openapi.startsWith('3.')) {
|
|
48
|
-
json.servers = [{
|
|
49
|
-
url: window.location.protocol + '//' + window.location.host,
|
|
50
|
-
description: 'Current server'
|
|
51
|
-
}];
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const swaggerOptions = {
|
|
55
|
-
|
|
56
|
-
// url: url + (accessToken ? (url.indexOf('?') < 0 ? '?' : '&') + ACCESS_TOKEN_QUERY_PARAM_NAME + '=' + accessToken : ''),
|
|
57
|
-
spec: json,
|
|
58
|
-
validatorUrl: validatorUrl,
|
|
59
|
-
dom_id: '#swagger-ui',
|
|
60
|
-
deepLinking: true,
|
|
61
|
-
presets: [SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset],
|
|
62
|
-
plugins: [SwaggerUIBundle.plugins.DownloadUrl],
|
|
63
|
-
layout: 'StandaloneLayout',
|
|
64
|
-
docExpansion: "list",
|
|
65
|
-
tagsSorter: apisSorter.unsorted,
|
|
66
|
-
operationsSorter: operationsSorter.method,
|
|
67
|
-
|
|
68
|
-
// patch: uiCompleteScript -- Rendering
|
|
69
|
-
onComplete: function () {
|
|
70
|
-
|
|
71
|
-
},
|
|
72
|
-
tryItOutEnabled: true,
|
|
73
|
-
defaultModelsExpandDepth: 0,
|
|
74
|
-
defaultModelExpandDepth: -1
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const ui = SwaggerUIBundle(swaggerOptions);
|
|
78
|
-
|
|
79
|
-
window.ui = ui;
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
</script>
|