emailengine-app 2.89.0 → 2.91.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/.ncurc.js +19 -8
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +73 -0
- package/Dockerfile +7 -3
- package/ENVIRONMENT.md +24 -23
- package/README.md +1 -1
- package/bin/healthcheck.js +1 -1
- package/copy-static-files.sh +0 -8
- package/data/google-crawlers.json +1 -1
- package/encrypt.js +1 -4
- package/lib/account/field-codec.js +396 -0
- package/lib/account-assignment.js +26 -9
- package/lib/account.js +196 -462
- package/lib/api-routes/account-routes.js +49 -6
- package/lib/api-routes/route-metadata.js +5 -2
- package/lib/api-routes/submit-routes.js +15 -2
- package/lib/api-token-auth.js +342 -274
- package/lib/arf-detect.js +174 -149
- package/lib/attachment-size.js +29 -0
- package/lib/autodetect-imap-settings.js +482 -296
- package/lib/consts.js +5 -5
- package/lib/db.js +1 -4
- package/lib/email-client/base-client.js +907 -780
- package/lib/email-client/gmail-client.js +557 -450
- package/lib/email-client/imap/cid-parts.js +61 -0
- package/lib/email-client/imap/mailbox.js +376 -422
- package/lib/email-client/imap/sync-operations.js +239 -178
- package/lib/email-client/imap-client.js +5 -5
- package/lib/email-client/message-builder.js +4 -5
- package/lib/email-client/new-message-steps.js +168 -2
- package/lib/email-client/outlook/graph-message.js +266 -0
- package/lib/email-client/outlook/subscription-expiry.js +30 -0
- package/lib/email-client/outlook-client.js +652 -808
- package/lib/get-raw-email.js +338 -232
- package/lib/get-secret.js +1 -4
- package/lib/imapproxy/imap-server.js +5 -5
- package/lib/license-subscription.js +60 -0
- package/lib/load-env.js +48 -0
- package/lib/logger-consts.js +37 -1
- package/lib/logger.js +1 -4
- package/lib/mail-probe.js +157 -0
- package/lib/mcp/tools.js +244 -207
- package/lib/metric-values.js +76 -0
- package/lib/metrics.js +320 -0
- package/lib/oauth/gmail.js +39 -120
- package/lib/oauth/http-request.js +195 -0
- package/lib/oauth/mail-ru.js +33 -60
- package/lib/oauth/outlook.js +37 -137
- package/lib/oauth/pubsub/google.js +176 -117
- package/lib/oauth2-apps.js +440 -463
- package/lib/openapi/build-document.js +10 -10
- package/lib/read-env-value.js +31 -7
- package/lib/redis-backend-warnings.js +70 -0
- package/lib/route-descriptors.js +78 -0
- package/lib/schemas.js +10 -1
- package/lib/sentry-integrations.js +299 -0
- package/lib/sentry.js +75 -27
- package/lib/sso-routes.js +249 -0
- package/lib/sso.js +29 -6
- package/lib/tools.js +17 -28
- package/lib/ui-routes/account-edit-form.js +198 -0
- package/lib/ui-routes/account-page.js +241 -0
- package/lib/ui-routes/account-routes.js +46 -349
- package/lib/ui-routes/account-setup.js +1 -1
- package/lib/ui-routes/auth-routes.js +10 -10
- package/lib/ui-routes/provider-signin.js +187 -0
- package/lib/ui-routes/route-helpers.js +1 -1
- package/lib/ui-routes/unsubscribe-routes.js +2 -2
- package/lib/ui-view-context.js +328 -0
- package/lib/utils/public-suffix.js +22 -101
- package/lib/web-safe-html.js +20 -7
- package/lib/worker-metrics.js +82 -0
- package/list-generate.js +2 -5
- package/package.json +28 -24
- package/sbom.json +360 -1030
- package/scripts/refresh-test-tokens.js +1 -1
- package/server.js +400 -677
- package/static/css/flyonui.css +1 -1
- package/static/css/public.css +55 -1
- package/static/css/src/app.tailwind.css +18 -0
- package/static/js/ee-client.js +2619 -645
- package/static/js/ui.js +12 -2
- package/static/licenses.html +224 -764
- package/translations/de.mo +0 -0
- package/translations/de.po +429 -390
- package/translations/en.mo +0 -0
- package/translations/en.po +342 -257
- package/translations/es.mo +0 -0
- package/translations/es.po +440 -395
- package/translations/et.mo +0 -0
- package/translations/et.po +425 -375
- package/translations/fr.mo +0 -0
- package/translations/fr.po +425 -383
- package/translations/it.mo +0 -0
- package/translations/it.po +441 -394
- package/translations/ja.mo +0 -0
- package/translations/ja.po +408 -335
- package/translations/messages.pot +188 -130
- package/translations/nl.mo +0 -0
- package/translations/nl.po +419 -382
- package/translations/pl.mo +0 -0
- package/translations/pl.po +425 -379
- package/translations/sv.mo +0 -0
- package/translations/sv.po +440 -388
- package/translations/tr.mo +0 -0
- package/translations/tr.po +441 -387
- package/views/account-identity-error.hbs +1 -1
- package/views/account-workspace-error.hbs +2 -2
- package/views/accounts/browse.hbs +19 -1
- package/views/accounts/register/imap-server.hbs +22 -7
- package/views/accounts/register/imap.hbs +3 -0
- package/views/accounts/register/index.hbs +1 -27
- package/views/accounts/register/provider-signin.hbs +58 -0
- package/views/oauth-scope-error.hbs +1 -1
- package/views/partials/provider_signin_button.hbs +30 -0
- package/views/queues/index.hbs +1 -1
- package/views/redirect.hbs +1 -1
- package/views/unsubscribe.hbs +6 -6
- package/workers/api.js +20 -451
- package/data/public_suffix_list.dat +0 -16698
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Which attachments of an IMAP message its html shows inline, and which body parts have to be
|
|
4
|
+
// downloaded to embed them. Shared by Mailbox.getMessage() (embedAttachedImages) and
|
|
5
|
+
// Mailbox.processNew() (the web-safe copy of a new message), which carried copies of this loop.
|
|
6
|
+
|
|
7
|
+
const { collectCidReferences } = require('../../tools');
|
|
8
|
+
const { MAX_INLINE_ATTACHMENT_SIZE } = require('../../consts');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Collects the attachments the html of a message refers to by content id. Each one that has to be
|
|
12
|
+
* downloaded gets its IMAP body part as a non-enumerable `part` property (read off the attachment
|
|
13
|
+
* id, which carries it after an 8 byte prefix), so it never reaches a serialized message.
|
|
14
|
+
*
|
|
15
|
+
* @param {Object} messageInfo - Message with text.html and attachments
|
|
16
|
+
* @param {Object} [opts]
|
|
17
|
+
* @param {boolean} [opts.reuseLoaded] - Keep content an attachment already carries, and do not
|
|
18
|
+
* download such an attachment or one larger than MAX_INLINE_ATTACHMENT_SIZE
|
|
19
|
+
* @returns {{attachmentList: Map<string, {attachment: Object, content: *}>, partList: string[]}}
|
|
20
|
+
* the referenced attachments by content id, and the distinct body parts to download
|
|
21
|
+
*/
|
|
22
|
+
function collectCidParts(messageInfo, opts) {
|
|
23
|
+
opts = opts || {};
|
|
24
|
+
|
|
25
|
+
let attachmentList = new Map();
|
|
26
|
+
let partList = [];
|
|
27
|
+
let cidReferences = collectCidReferences(messageInfo.text.html);
|
|
28
|
+
|
|
29
|
+
for (let attachment of messageInfo.attachments || []) {
|
|
30
|
+
let contentId = attachment.contentId && attachment.contentId.replace(/^<|>$/g, '');
|
|
31
|
+
if (!contentId || !cidReferences.has(contentId)) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
attachmentList.set(contentId, {
|
|
36
|
+
attachment,
|
|
37
|
+
content: (opts.reuseLoaded && attachment.content) || null
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
if (opts.reuseLoaded && (attachment.content || (attachment.encodedSize && attachment.encodedSize > MAX_INLINE_ATTACHMENT_SIZE))) {
|
|
41
|
+
// already loaded by notifyAttachments, or too large to inline
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let buf = Buffer.from(attachment.id, 'base64url');
|
|
46
|
+
let part = buf.subarray(8).toString();
|
|
47
|
+
|
|
48
|
+
Object.defineProperty(attachment, 'part', {
|
|
49
|
+
value: part,
|
|
50
|
+
enumerable: false
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
if (!partList.includes(part)) {
|
|
54
|
+
partList.push(part);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return { attachmentList, partList };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
module.exports = { collectCidParts };
|