emailengine-app 2.84.1 → 2.85.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/.dockerignore +6 -0
- package/.ncurc.js +5 -3
- package/.prettierignore +5 -1
- package/.prettierrc.js +2 -0
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +61 -0
- package/Dockerfile +8 -2
- package/README.md +1 -1
- package/bin/emailengine.js +444 -403
- package/copy-static-files.sh +39 -14
- package/data/google-crawlers.json +1 -1
- package/data/public_suffix_list.dat +16562 -0
- package/docker-compose.yml +1 -1
- package/eslint.config.js +81 -99
- package/lib/account/own-account-key.js +42 -0
- package/lib/account-assignment.js +1 -33
- package/lib/account.js +68 -24
- package/lib/add-trackers.js +11 -4
- package/lib/api-reference/format.js +4 -3
- package/lib/api-routes/account-routes.js +244 -26
- package/lib/api-routes/blocklist-routes.js +23 -2
- package/lib/api-routes/delivery-test-routes.js +26 -3
- package/lib/api-routes/export-routes.js +28 -2
- package/lib/api-routes/gateway-routes.js +37 -5
- package/lib/api-routes/mailbox-routes.js +41 -2
- package/lib/api-routes/message-routes.js +104 -4
- package/lib/api-routes/mint-bounds.js +11 -0
- package/lib/api-routes/oauth2-app-routes.js +48 -15
- package/lib/api-routes/outbox-routes.js +45 -11
- package/lib/api-routes/permission-map.js +12 -1
- package/lib/api-routes/route-helpers.js +125 -3
- package/lib/api-routes/settings-routes.js +23 -2
- package/lib/api-routes/submit-routes.js +338 -309
- package/lib/api-routes/template-routes.js +38 -2
- package/lib/api-routes/token-routes.js +142 -96
- package/lib/api-routes/webhook-route-routes.js +13 -2
- package/lib/auth-token.js +23 -10
- package/lib/bounce-detect.js +414 -210
- package/lib/consts.js +39 -4
- package/lib/create-imap-client.js +41 -2
- package/lib/email-client/base-client.js +30 -41
- package/lib/email-client/gmail-client.js +30 -18
- package/lib/email-client/imap/mailbox.js +13 -23
- package/lib/email-client/imap/response-metrics.js +75 -0
- package/lib/email-client/imap/subconnection.js +1 -1
- package/lib/email-client/imap-client.js +6 -3
- package/lib/email-client/message-builder.js +7 -2
- package/lib/email-client/notification-handler.js +1 -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/gateway.js +2 -3
- package/lib/get-raw-email.js +4 -2
- package/lib/hapi-request-logger.js +107 -0
- package/lib/imap-proxy-auth.js +14 -1
- package/lib/imapproxy/imap-core/README.md +6 -5
- 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/mcp/tools.js +37 -8
- package/lib/notify-attachments.js +17 -0
- 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-mailbox.js +35 -0
- package/lib/oauth/outlook.js +26 -44
- package/lib/oauth/state.js +24 -0
- package/lib/oauth2-apps.js +1 -1
- package/lib/pbkdf2-phc.js +19 -2
- package/lib/privileged-settings.js +6 -3
- package/lib/redis-scan-delete.js +15 -1
- package/lib/schemas.js +79 -33
- package/lib/settings.js +13 -1
- package/lib/smtp-auth.js +23 -0
- package/lib/sso.js +1 -1
- package/lib/swagger-options.js +1 -1
- package/lib/thread-diagnostics.js +46 -0
- package/lib/timezones.js +109 -0
- package/lib/token-permission-view.js +3 -3
- package/lib/tools.js +285 -66
- package/lib/totp.js +2 -5
- package/lib/translations.js +1 -2
- package/lib/ui-routes/account-routes.js +491 -491
- package/lib/ui-routes/account-setup.js +99 -0
- package/lib/ui-routes/admin-config-routes.js +98 -48
- package/lib/ui-routes/admin-entities-routes.js +113 -31
- package/lib/ui-routes/auth-routes.js +137 -62
- package/lib/ui-routes/connection-security-form.js +74 -0
- package/lib/ui-routes/form-lists.js +46 -0
- package/lib/ui-routes/internals-routes.js +5 -0
- package/lib/ui-routes/mcp-consent-routes.js +5 -1
- package/lib/ui-routes/oauth-config-routes.js +133 -100
- package/lib/ui-routes/route-helpers.js +19 -3
- package/lib/ui-routes/sign-in-helpers.js +59 -0
- package/lib/ui-routes/tls-config-routes.js +58 -15
- package/lib/ui-routes/unsubscribe-routes.js +6 -3
- package/lib/utils/back-off.js +82 -0
- package/lib/utils/map-concurrent.js +36 -0
- package/lib/utils/murmurhash3.js +66 -0
- package/lib/utils/network.js +28 -0
- package/lib/utils/provider-id.js +27 -0
- package/lib/utils/public-suffix.js +122 -0
- package/lib/utils/random-id.js +26 -0
- package/lib/utils/require-tls.js +33 -0
- package/lib/utils/version.js +74 -0
- package/lib/web-safe-html.js +5 -6
- package/lib/webhook-penalty.js +75 -0
- package/lib/webhook-routing.js +49 -2
- package/lib/webhooks.js +41 -6
- package/package.json +37 -39
- package/sbom.json +7980 -1
- package/server.js +659 -455
- 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 +191 -1016
- package/translations/messages.pot +70 -71
- package/views/account/security.hbs +10 -0
- package/views/accounts/account.hbs +11 -11
- package/views/accounts/edit.hbs +6 -2
- package/views/config/ai.hbs +1 -1
- package/views/config/security.hbs +2 -2
- package/views/config/service.hbs +3 -0
- package/views/internals/index.hbs +8 -0
- package/views/partials/gateway_form.hbs +3 -1
- package/views/partials/webhook_form.hbs +1 -1
- package/views/suppression-lists/index.hbs +1 -1
- package/workers/api.js +780 -585
- package/workers/export.js +1 -1
- package/workers/submit.js +1 -1
- package/workers/webhooks.js +54 -34
- 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
package/copy-static-files.sh
CHANGED
|
@@ -51,32 +51,57 @@ cp node_modules/flyonui/flyonui.js static/js/flyonui.js
|
|
|
51
51
|
# Rebuild the compiled admin UI stylesheet (Tailwind v4 + FlyonUI)
|
|
52
52
|
npm run build:css
|
|
53
53
|
|
|
54
|
-
#
|
|
54
|
+
# The artifacts below are regenerated (mostly from the network) and are committed, so a failed fetch
|
|
55
55
|
# must not be allowed to damage the copy already in the tree. A plain `> file` redirect truncates
|
|
56
56
|
# before the command runs, which is how a GitHub 500 once left a zero-byte sbom.json behind - and
|
|
57
57
|
# under `set -e` it also aborts the rest of this script, silently skipping the licence and gettext
|
|
58
58
|
# regeneration that npm run update chains after it. Each fetch therefore lands in a sibling temp
|
|
59
|
-
# file, is checked for being valid JSON,
|
|
60
|
-
# is created next to its target rather than in $TMPDIR
|
|
61
|
-
# filesystem, never a copy that could be interrupted
|
|
62
|
-
|
|
59
|
+
# file, is checked for being complete (valid JSON, or a format-specific check), and only then
|
|
60
|
+
# replaces the committed one. The temp file is created next to its target rather than in $TMPDIR
|
|
61
|
+
# so the move is a rename within the same filesystem, never a copy that could be interrupted
|
|
62
|
+
# half-written.
|
|
63
|
+
#
|
|
64
|
+
# fetch_checked TARGET CHECK COMMAND...: CHECK is a node script that throws unless the file named
|
|
65
|
+
# by process.argv[1] is a complete copy of what TARGET (process.argv[2]) should hold. A CHECK that
|
|
66
|
+
# exits with status 3 instead says the new copy changes nothing that matters, and the committed one
|
|
67
|
+
# is kept without a warning.
|
|
68
|
+
fetch_checked() {
|
|
63
69
|
local target="$1"
|
|
64
|
-
|
|
65
|
-
|
|
70
|
+
local check="$2"
|
|
71
|
+
shift 2
|
|
72
|
+
local tmp status
|
|
66
73
|
tmp=$(mktemp "${target}.XXXXXX")
|
|
67
|
-
if "$@" > "$tmp" && node -e
|
|
74
|
+
if "$@" > "$tmp" && node -e "$check" "$tmp" "$target"; then
|
|
75
|
+
# mktemp creates the file 0600
|
|
76
|
+
chmod 644 "$tmp"
|
|
68
77
|
mv "$tmp" "$target"
|
|
69
78
|
else
|
|
79
|
+
status=$?
|
|
70
80
|
rm -f "$tmp"
|
|
71
|
-
|
|
81
|
+
if [ "$status" -ne 3 ]; then
|
|
82
|
+
echo "WARNING: failed to refresh ${target}, keeping the previous copy" >&2
|
|
83
|
+
fi
|
|
72
84
|
fi
|
|
73
85
|
}
|
|
74
86
|
|
|
87
|
+
fetch_json() {
|
|
88
|
+
local target="$1"
|
|
89
|
+
shift
|
|
90
|
+
fetch_checked "$target" 'JSON.parse(require("fs").readFileSync(process.argv[1], "utf8"))' "$@"
|
|
91
|
+
}
|
|
92
|
+
|
|
75
93
|
fetch_json data/google-crawlers.json wget -q -O - https://developers.google.com/static/crawling/ipranges/special-crawlers.json
|
|
76
94
|
node -e 'console.log("Google crawlers updated: "+require("./data/google-crawlers.json").creationTime);'
|
|
77
95
|
|
|
78
|
-
#
|
|
79
|
-
#
|
|
80
|
-
#
|
|
81
|
-
|
|
82
|
-
|
|
96
|
+
# The Public Suffix List, read by lib/utils/public-suffix.js. Kept verbatim (it is MPL-2.0 and carries
|
|
97
|
+
# its own licence header), and only accepted when both sections arrived whole: a truncated list would
|
|
98
|
+
# not fail to parse, it would just quietly know fewer suffixes.
|
|
99
|
+
fetch_checked data/public_suffix_list.dat 'const t=require("fs").readFileSync(process.argv[1],"utf8");for(const m of ["===BEGIN ICANN DOMAINS===","===END ICANN DOMAINS===","===BEGIN PRIVATE DOMAINS===","===END PRIVATE DOMAINS==="])if(!t.includes(m))throw new Error("missing "+m)' wget -q -O - https://publicsuffix.org/list/public_suffix_list.dat
|
|
100
|
+
grep -m1 '^// VERSION:' data/public_suffix_list.dat || true
|
|
101
|
+
|
|
102
|
+
# The SBOM shipped in the binary and served at /sbom.json, generated from the installed tree by npm
|
|
103
|
+
# (SPDX 2.3). Runtime dependencies only: dev tooling never reaches an instance. It used to come
|
|
104
|
+
# from GitHub's dependency graph (gh sbom), which only knows a lockfile once it has been pushed, so
|
|
105
|
+
# every dependency bump needed a second update after the push to catch up. npm stamps each run with
|
|
106
|
+
# a new creation time and document namespace, so a copy that differs in nothing else is not taken.
|
|
107
|
+
fetch_checked sbom.json 'const fs=require("fs");const strip=f=>{const d=JSON.parse(fs.readFileSync(f,"utf8"));delete d.documentNamespace;delete d.creationInfo.created;return JSON.stringify(d)};const next=strip(process.argv[1]);let prev=null;try{prev=strip(process.argv[2])}catch{}if(next===prev)process.exit(3)' npm sbom --sbom-format spdx --omit dev
|