emailengine-app 2.79.8 → 2.80.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/dependabot.yml +22 -0
- package/.github/workflows/test.yml +39 -0
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +69 -0
- package/DOCKER_DEPLOYMENT.md +6 -7
- package/Dockerfile +35 -11
- package/config/default.toml +7 -2
- package/copy-static-files.sh +23 -5
- package/data/google-crawlers.json +1 -1
- package/encrypt.js +43 -0
- package/lib/account/account-state.js +62 -0
- package/lib/account.js +60 -3
- package/lib/api-routes/account-routes.js +20 -0
- package/lib/api-routes/bull-board-routes.js +3 -2
- package/lib/api-routes/index.js +1 -1
- package/lib/api-routes/route-helpers.js +8 -0
- package/lib/api-routes/settings-routes.js +17 -2
- package/lib/auth-token.js +73 -2
- package/lib/autodetect-imap-settings.js +379 -69
- package/lib/cert-handler.js +62 -0
- package/lib/consts.js +58 -7
- package/lib/db.js +12 -0
- package/lib/egress-fetch.js +145 -0
- package/lib/email-client/base-client.js +234 -66
- package/lib/email-client/credential-errors.js +118 -0
- package/lib/email-client/gmail/gmail-api.js +2 -1
- package/lib/email-client/gmail-client.js +70 -64
- package/lib/email-client/imap/connection-errors.js +52 -0
- package/lib/email-client/imap/listing-diff.js +47 -6
- package/lib/email-client/imap/mailbox.js +457 -379
- package/lib/email-client/imap/subconnection.js +15 -11
- package/lib/email-client/imap/sync-operations.js +46 -59
- package/lib/email-client/imap-client.js +136 -95
- package/lib/email-client/message-builder.js +11 -11
- package/lib/email-client/outlook/graph-api.js +2 -1
- package/lib/email-client/outlook-client.js +219 -106
- package/lib/export.js +35 -2
- package/lib/handlebars-helpers.js +129 -0
- package/lib/imap-proxy-auth.js +96 -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 +56 -66
- package/lib/lua/h-del-if-equals.lua +39 -0
- package/lib/lua/h-set-if-equals.lua +39 -0
- package/lib/openapi/index.js +3 -0
- package/lib/outbox.js +28 -3
- package/lib/rate-limit.js +23 -4
- package/lib/routes-ui.js +4 -34
- package/lib/schemas.js +42 -3
- package/lib/security-headers.js +411 -0
- package/lib/sentry.js +36 -4
- package/lib/smtp-auth.js +86 -7
- package/lib/tls/context.js +376 -0
- package/lib/tls/der.js +223 -0
- package/lib/tls/provision.js +555 -0
- package/lib/tls/self-signed.js +282 -0
- package/lib/tls/status.js +431 -0
- package/lib/tls/store.js +666 -0
- package/lib/tools.js +337 -147
- package/lib/ui-routes/account-routes.js +47 -33
- package/lib/ui-routes/admin-config-routes.js +22 -1
- package/lib/ui-routes/auth-routes.js +16 -1
- package/lib/ui-routes/export-routes.js +4 -0
- package/lib/ui-routes/internals-routes.js +3 -5
- package/lib/ui-routes/mcp-consent-routes.js +7 -0
- package/lib/ui-routes/network-config-routes.js +58 -48
- package/lib/ui-routes/route-helpers.js +24 -8
- package/lib/ui-routes/smtp-test-routes.js +7 -0
- package/lib/ui-routes/tls-config-routes.js +581 -0
- package/lib/utils/mailbox-path.js +51 -0
- package/lib/utils/severity.js +31 -0
- package/lib/webhook-egress.js +5 -0
- package/package.json +21 -24
- package/sbom.json +1 -1
- package/server.js +53 -36
- package/static/css/flyonui.css +1 -1
- package/static/css/src/app.tailwind.css +11 -0
- 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/app.js +34 -0
- package/static/js/ee-client.js +256 -102
- package/static/js/public.js +13 -2
- package/static/js/ui.js +40 -25
- package/static/licenses.html +393 -1282
- package/static/vendor/simplewebauthn/browser.min.js +2 -2
- package/translations/messages.pot +203 -157
- package/views/account/login-redirect.hbs +22 -0
- 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 -4
- 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 -4
- package/views/config/tls-upload.hbs +81 -0
- package/views/config/tls.hbs +492 -0
- 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/side_menu.hbs +1 -0
- 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/tls_security_card.hbs +25 -53
- package/views/partials/ui/alert-banner.hbs +3 -2
- package/views/partials/ui/badge.hbs +6 -2
- package/views/partials/ui/btn.hbs +5 -2
- 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 +131 -242
- package/workers/export.js +1 -5
- package/workers/imap-proxy.js +4 -1
- package/workers/imap.js +1 -3
- package/workers/smtp.js +59 -83
- 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
- package/views/partials/tls_security_js.hbs +0 -64
- package/views/partials/tls_security_modal.hbs +0 -22
package/static/js/ui.js
CHANGED
|
@@ -293,29 +293,6 @@ window.uiEditorFullscreen = editors => {
|
|
|
293
293
|
}
|
|
294
294
|
};
|
|
295
295
|
|
|
296
|
-
// Repaint the #tls-label certificate badge (config/smtp and config/imap-proxy
|
|
297
|
-
// pages) from a certificate-check response: badge color, label text and the
|
|
298
|
-
// FlyonUI tooltip body that carries the status details
|
|
299
|
-
window.paintCertData = certData => {
|
|
300
|
-
let tlsLabelElm = document.getElementById('tls-label');
|
|
301
|
-
|
|
302
|
-
if (!certData || !certData.label || !tlsLabelElm) {
|
|
303
|
-
return;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
tlsLabelElm.classList.remove(`badge-${tlsLabelElm.dataset.labeltype}`);
|
|
307
|
-
tlsLabelElm.classList.add(`badge-${certData.label.type}`);
|
|
308
|
-
tlsLabelElm.dataset.labeltype = certData.label.type;
|
|
309
|
-
|
|
310
|
-
tlsLabelElm.textContent = certData.label.text;
|
|
311
|
-
|
|
312
|
-
let tooltipBodyElm = tlsLabelElm.closest('.tooltip');
|
|
313
|
-
tooltipBodyElm = tooltipBodyElm && tooltipBodyElm.querySelector('.tooltip-body');
|
|
314
|
-
if (tooltipBodyElm) {
|
|
315
|
-
tooltipBodyElm.textContent = certData.label.title;
|
|
316
|
-
}
|
|
317
|
-
};
|
|
318
|
-
|
|
319
296
|
// Keyboard hints that spell a modifier differently on macOS (ui/search-input
|
|
320
297
|
// renders `shortcut` with an optional `shortcutMac`). The server cannot know
|
|
321
298
|
// the platform, so it emits the Ctrl form and the Mac spelling rides along in
|
|
@@ -620,13 +597,19 @@ const uiFormBusy = new Map();
|
|
|
620
597
|
// this guard by not being POST forms.)
|
|
621
598
|
document.addEventListener('submit', event => {
|
|
622
599
|
const form = event.target;
|
|
623
|
-
|
|
600
|
+
// Attributes rather than properties throughout: a form control named `method` or `target`
|
|
601
|
+
// shadows the same-named property on HTMLFormElement, and this handler runs on every form.
|
|
602
|
+
if (event.defaultPrevented || !form || (form.getAttribute('method') || 'get').toLowerCase() !== 'post') {
|
|
624
603
|
return;
|
|
625
604
|
}
|
|
626
605
|
|
|
627
606
|
// A form aimed at another browsing context leaves this page in place, so
|
|
628
607
|
// there is no navigation to end the busy state and nothing to latch.
|
|
629
|
-
|
|
608
|
+
//
|
|
609
|
+
// Read the attribute, not the property: a form control named `target` shadows
|
|
610
|
+
// HTMLFormElement.target, so form.target can be an <input> element. That threw here and took
|
|
611
|
+
// every busy button on the page down with it.
|
|
612
|
+
const target = (form.getAttribute('target') || '').trim().toLowerCase();
|
|
630
613
|
if (target && target !== '_self') {
|
|
631
614
|
return;
|
|
632
615
|
}
|
|
@@ -719,11 +702,41 @@ window.uiBusyAction = (btn, run) => {
|
|
|
719
702
|
// creation and re-applied whenever the admin theme changes. The theme files
|
|
720
703
|
// must exist under static/js/ace/ - they are copied from ace-builds by
|
|
721
704
|
// copy-static-files.sh and ship in the pkg binary via the static/**/* asset glob.
|
|
705
|
+
// Their stylesheets are linked by views/partials/ace_assets.hbs, which also puts
|
|
706
|
+
// ACE in strict-CSP mode so it injects none of its own.
|
|
722
707
|
const uiAceThemes = {
|
|
723
708
|
editor: { light: 'ace/theme/xcode', dark: 'ace/theme/tomorrow_night' },
|
|
724
709
|
preview: { light: 'ace/theme/kuroir', dark: 'ace/theme/tomorrow_night_eighties' }
|
|
725
710
|
};
|
|
726
711
|
|
|
712
|
+
// ACE keeps its stylesheets inside its JavaScript and injects them as elements the admin
|
|
713
|
+
// Content-Security-Policy refuses (it accepts a stylesheet only with the request nonce, which
|
|
714
|
+
// ACE cannot set). Strict mode stops the injection and the sheets are linked instead:
|
|
715
|
+
// views/partials/ace_assets.hbs carries them in the markup for the pages that always have an
|
|
716
|
+
// editor, and this adds whatever is missing for the one that loads ACE lazily from script (the
|
|
717
|
+
// try-it panels in static/js/reference.js). Both paths reach ACE through the two helpers below,
|
|
718
|
+
// so this is the one place that has to know. The hrefs come from uiAceThemes, so a theme added
|
|
719
|
+
// there needs no second edit.
|
|
720
|
+
const uiAceEnsureAssets = () => {
|
|
721
|
+
ace.config.set('useStrictCSP', true);
|
|
722
|
+
|
|
723
|
+
let sheets = ['/static/js/ace/css/ace.css'];
|
|
724
|
+
for (let kind of Object.values(uiAceThemes)) {
|
|
725
|
+
for (let theme of Object.values(kind)) {
|
|
726
|
+
sheets.push(`/static/js/ace/css/theme/${theme.split('/').pop()}.css`);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
for (let href of sheets) {
|
|
731
|
+
if (!document.querySelector(`link[href="${href}"]`)) {
|
|
732
|
+
let link = document.createElement('link');
|
|
733
|
+
link.rel = 'stylesheet';
|
|
734
|
+
link.href = href;
|
|
735
|
+
document.head.appendChild(link);
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
};
|
|
739
|
+
|
|
727
740
|
// container element -> { editor, kind }; also the lookup the .copy-btn
|
|
728
741
|
// handler uses to read the full session value of a targeted editor
|
|
729
742
|
const uiAceInstances = new Map();
|
|
@@ -744,6 +757,7 @@ const uiAceRegister = (editor, kind) => {
|
|
|
744
757
|
// the initial value loaded into the session. Extra ace options pass through
|
|
745
758
|
// via opts.
|
|
746
759
|
window.uiAceEditor = (id, mode, value, opts) => {
|
|
760
|
+
uiAceEnsureAssets();
|
|
747
761
|
const editor = opts ? ace.edit(id, opts) : ace.edit(id);
|
|
748
762
|
uiAceRegister(editor, 'editor');
|
|
749
763
|
editor.session.setMode(`ace/mode/${mode}`);
|
|
@@ -756,6 +770,7 @@ window.uiAceEditor = (id, mode, value, opts) => {
|
|
|
756
770
|
// Read-only preview pane variant: gutter, no print margin or active-line
|
|
757
771
|
// highlight, with its own theme pair to keep previews visually distinct
|
|
758
772
|
window.uiAcePreview = (id, mode, opts) => {
|
|
773
|
+
uiAceEnsureAssets();
|
|
759
774
|
const editor = ace.edit(id, Object.assign({ showGutter: true }, opts));
|
|
760
775
|
editor.setReadOnly(true);
|
|
761
776
|
editor.setShowPrintMargin(false);
|