emailengine-app 2.81.2 → 2.82.1
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 +33 -10
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +71 -0
- package/DOCKER_DEPLOYMENT.md +13 -12
- package/Dockerfile +2 -0
- package/bin/emailengine.js +105 -25
- package/config/default.toml +0 -5
- package/config/test.toml +0 -5
- package/data/google-crawlers.json +1 -1
- package/encrypt.js +70 -42
- package/getswagger.sh +0 -4
- package/lib/account/account-state.js +2 -110
- package/lib/account/expected-identity.js +1 -1
- package/lib/account-assignment.js +138 -1
- package/lib/account.js +289 -869
- package/lib/api-reference/index.js +2 -3
- package/lib/api-reference/schema-tree.js +53 -3
- package/lib/api-routes/account-binding.js +58 -0
- package/lib/api-routes/account-routes.js +65 -37
- package/lib/api-routes/behavior-notes.js +4 -0
- package/lib/api-routes/blocklist-routes.js +2 -2
- package/lib/api-routes/bull-board-routes.js +1 -6
- package/lib/api-routes/export-routes.js +2 -22
- package/lib/api-routes/gateway-routes.js +15 -16
- package/lib/api-routes/index.js +1 -13
- package/lib/api-routes/mailbox-routes.js +2 -7
- package/lib/api-routes/mcp-oauth-routes.js +2 -1
- package/lib/api-routes/mcp-routes.js +7 -7
- package/lib/api-routes/message-routes.js +50 -238
- package/lib/api-routes/mint-bounds.js +110 -0
- package/lib/api-routes/oauth2-app-routes.js +23 -32
- package/lib/api-routes/operation-impact.js +1 -1
- package/lib/api-routes/outbox-routes.js +3 -3
- package/lib/api-routes/permission-map.js +1 -7
- package/lib/api-routes/route-helpers.js +11 -5
- package/lib/api-routes/settings-routes.js +20 -21
- package/lib/api-routes/stats-routes.js +1 -1
- package/lib/api-routes/submit-routes.js +17 -18
- package/lib/api-routes/template-routes.js +4 -9
- package/lib/api-routes/token-routes.js +28 -6
- package/lib/api-token-scheme.js +71 -0
- package/lib/arf-detect.js +33 -6
- package/lib/auth-token.js +44 -24
- package/lib/autodetect-imap-settings.js +305 -123
- package/lib/bounce-detect.js +25 -16
- package/lib/calendar-event.js +78 -0
- package/lib/consts.js +54 -5
- package/lib/create-imap-client.js +24 -0
- package/lib/db.js +77 -30
- package/lib/delivery-error.js +70 -2
- package/lib/egress-fetch.js +54 -3
- package/lib/egress-filter.js +11 -0
- package/lib/email-client/api-retry.js +147 -0
- package/lib/email-client/base-client.js +383 -536
- package/lib/email-client/credential-errors.js +21 -5
- package/lib/email-client/gmail/gmail-api.js +38 -125
- package/lib/email-client/gmail/send-request.js +1 -1
- package/lib/email-client/gmail-client.js +77 -51
- package/lib/email-client/imap/mailbox.js +158 -324
- package/lib/email-client/imap/stale-view.js +109 -0
- package/lib/email-client/imap/subconnection.js +46 -9
- package/lib/email-client/imap/sync-operations.js +5 -37
- package/lib/email-client/imap-client.js +190 -65
- package/lib/email-client/message-builder.js +50 -25
- package/lib/email-client/notification-handler.js +5 -219
- package/lib/email-client/outlook/graph-api.js +147 -126
- package/lib/email-client/outlook/send-request.js +10 -4
- package/lib/email-client/outlook-client.js +389 -463
- package/lib/email-client/smtp-pool-manager.js +3 -2
- package/lib/encrypt.js +184 -19
- package/lib/enum-descriptions.js +6 -3
- package/lib/export.js +141 -41
- package/lib/gateway.js +25 -6
- package/lib/get-raw-email.js +26 -44
- package/lib/get-secret.js +1 -21
- package/lib/handlebars-helpers.js +31 -10
- package/lib/imap-proxy-auth.js +13 -29
- package/lib/imapproxy/imap-core/README.md +1 -0
- package/lib/imapproxy/imap-core/lib/handler/imap-parser.js +12 -0
- package/lib/imapproxy/imap-core/lib/imap-command.js +74 -10
- package/lib/imapproxy/imap-core/lib/imap-connection.js +9 -1
- package/lib/imapproxy/imap-core/lib/imap-server.js +112 -26
- package/lib/imapproxy/imap-core/lib/imap-stream.js +41 -1
- package/lib/imapproxy/imap-core/lib/imap-tools.js +10 -2
- package/lib/imapproxy/imap-core/lib/indexer/indexer.js +4 -2
- package/lib/imapproxy/imap-server.js +17 -177
- package/lib/imapproxy/proxy-handoff.js +235 -0
- package/lib/imapproxy/response-error.js +33 -0
- package/lib/imapproxy/upstream-client.js +2 -2
- package/lib/license-beacon.js +3 -9
- package/lib/llm-pre-process.js +182 -43
- package/lib/logger.js +1 -1
- package/lib/lua/ee-export-queue-add.lua +39 -0
- package/lib/lua/ee-get-idempotency.lua +15 -3
- package/lib/lua/ee-release-attempts.lua +23 -0
- package/lib/lua/ee-reserve-attempts.lua +42 -0
- package/lib/lua/h-set-bigger.lua +12 -2
- package/lib/lua/s-list-accounts.lua +6 -3
- package/lib/mcp/index.js +1 -2
- package/lib/mcp/listen.js +221 -18
- package/lib/mcp/oauth.js +44 -5
- package/lib/mcp/resources.js +8 -2
- package/lib/mcp/tools.js +108 -36
- package/lib/message-port-stream.js +64 -6
- package/lib/oauth/external-account-signer.js +16 -13
- package/lib/oauth/gmail.js +64 -32
- package/lib/oauth/mail-ru.js +24 -17
- package/lib/oauth/outlook.js +53 -40
- package/lib/oauth/pubsub/google.js +38 -2
- package/lib/oauth/scope-checker.js +39 -8
- package/lib/oauth/scope-list.js +55 -0
- package/lib/oauth/token-fetch.js +47 -0
- package/lib/oauth/verify-app.js +2 -2
- package/lib/oauth2-apps.js +154 -90
- package/lib/openapi/build-document.js +1 -1
- package/lib/openapi/joi-schema.js +78 -9
- package/lib/outbox.js +2 -7
- package/lib/parse-message.js +21 -0
- package/lib/payload-examples-webhooks.json +4 -7
- package/lib/pbkdf2-phc.js +101 -0
- package/lib/privileged-settings.js +0 -14
- package/lib/queue-retention.js +4 -2
- package/lib/rate-limit.js +54 -15
- package/lib/read-env-value.js +33 -2
- package/lib/redis-scan-delete.js +56 -29
- package/lib/redis-url.js +3 -1
- package/lib/respawn-backoff.js +5 -4
- package/lib/response-stream.js +25 -4
- package/lib/rewrite-text-nodes.js +27 -40
- package/lib/routes-ui.js +0 -5
- package/lib/schemas.js +180 -253
- package/lib/sentry.js +21 -5
- package/lib/settings.js +58 -59
- package/lib/smtp-auth.js +6 -2
- package/lib/smtp-message-processor.js +28 -7
- package/lib/sso.js +7 -3
- package/lib/stream-encrypt.js +14 -13
- package/lib/swagger-options.js +3 -1
- package/lib/tls/provision.js +69 -3
- package/lib/tls/store.js +14 -1
- package/lib/token-audit-log.js +3 -2
- package/lib/tools.js +114 -53
- package/lib/totp.js +16 -1
- package/lib/ui-routes/account-routes.js +67 -70
- package/lib/ui-routes/admin-config-routes.js +111 -134
- package/lib/ui-routes/admin-entities-routes.js +101 -191
- package/lib/ui-routes/ai-options.js +104 -0
- package/lib/ui-routes/auth-routes.js +98 -18
- package/lib/ui-routes/export-routes.js +3 -23
- package/lib/ui-routes/internals-routes.js +12 -9
- package/lib/ui-routes/network-config-routes.js +8 -18
- package/lib/ui-routes/oauth-config-routes.js +83 -228
- package/lib/ui-routes/route-helpers.js +63 -67
- package/lib/ui-routes/special-use-paths.js +33 -0
- package/lib/ui-routes/unsubscribe-routes.js +2 -2
- package/lib/utils/decode-headers.js +32 -5
- package/lib/utils/header-map.js +62 -1
- package/lib/utils/network.js +11 -17
- package/lib/web-safe-html.js +77 -4
- package/lib/webhook-request.js +9 -1
- package/lib/webhook-routing.js +27 -1
- package/lib/webhooks.js +120 -43
- package/lib/worker-rpc-error.js +43 -2
- package/list-generate.js +13 -2
- package/package.json +38 -46
- package/sbom.json +1 -1
- package/scripts/refresh-test-tokens.js +42 -14
- package/server.js +338 -292
- package/setup-production.sh +16 -7
- package/static/css/flyonui.css +1 -1
- package/static/css/src/app.tailwind.css +7 -8
- package/static/js/ee-client.js +145 -70
- package/static/js/ui.js +350 -154
- package/static/licenses.html +349 -1740
- package/translations/messages.pot +129 -111
- package/views/account-workspace-error.hbs +30 -0
- package/views/accounts/account.hbs +9 -4
- package/views/accounts/browse.hbs +10 -4
- package/views/accounts/edit.hbs +11 -2
- package/views/config/ai.hbs +49 -41
- package/views/config/oauth/app.hbs +2 -1
- package/views/dashboard.hbs +18 -16
- package/views/internals/index.hbs +1 -1
- package/views/layout/app.hbs +0 -22
- package/views/layout/login.hbs +2 -1
- package/views/partials/filter_editor_js.hbs +4 -3
- package/views/partials/gmail_api_scopes.hbs +16 -0
- package/views/partials/oauth_form.hbs +67 -94
- package/views/partials/oauth_pubsub_app_select.hbs +43 -0
- package/views/partials/scope_info.hbs +14 -23
- package/views/partials/side_menu.hbs +0 -4
- package/views/partials/ui/account-picker.hbs +6 -32
- package/views/partials/ui/model-picker.hbs +31 -0
- package/views/partials/ui/pagination.hbs +6 -1
- package/views/partials/ui/picker.hbs +47 -0
- package/views/unsubscribe.hbs +1 -1
- package/workers/api.js +82 -47
- package/workers/export.js +55 -60
- package/workers/imap.js +132 -49
- package/workers/submit.js +5 -6
- package/workers/webhooks.js +46 -27
- package/.githooks/pre-commit +0 -80
- package/.github/CODE_OF_CONDUCT.md +0 -76
- package/.github/contributing.md +0 -17
- package/.github/dependabot.yml +0 -22
- package/.github/docker-smoke-test.sh +0 -61
- package/.github/workflows/deploy.yml +0 -215
- package/.github/workflows/e2e.yml +0 -55
- package/.github/workflows/release.yaml +0 -217
- package/.github/workflows/test.yml +0 -307
- package/lib/api-routes/chat-routes.js +0 -535
- package/lib/document-store.js +0 -75
- package/lib/es.js +0 -757
- package/lib/generate-text-preview.js +0 -61
- package/lib/imapproxy/imap-core/memory-notifier.js +0 -129
- package/lib/pre-process.js +0 -196
- package/lib/threads.js +0 -155
- package/lib/ui-routes/document-store-routes.js +0 -806
- package/playwright.config.js +0 -47
- package/views/config/document-store/chat.hbs +0 -286
- package/views/config/document-store/index.hbs +0 -146
- package/views/config/document-store/mappings/index.hbs +0 -108
- package/views/config/document-store/mappings/new.hbs +0 -68
- package/views/config/document-store/pre-processing/index.hbs +0 -103
- package/views/partials/document_store_header.hbs +0 -30
- package/workers/documents.js +0 -1128
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
{{> document_store_header}}
|
|
2
|
-
|
|
3
|
-
<form method="post" action="/admin/config/document-store/pre-processing" id="edit-form">
|
|
4
|
-
{{!-- no id: the layout already renders the #crumb element scripts read --}}
|
|
5
|
-
<input type="hidden" name="crumb" value="{{crumb}}" />
|
|
6
|
-
|
|
7
|
-
<input type="hidden" id="fn-content-element" name="contentFnJson" value="{{values.contentFnJson}}">
|
|
8
|
-
<input type="hidden" id="map-content-element" name="contentMapJson" value="{{values.contentMapJson}}">
|
|
9
|
-
|
|
10
|
-
<div class="card bg-base-100 shadow-md mb-6">
|
|
11
|
-
<div class="px-6 py-4 border-b border-base-content/10 ee-toggle-row flex items-start justify-between gap-4">
|
|
12
|
-
<div>
|
|
13
|
-
{{> ui/checkbox id="enabled" name="enabled" label="Enable pre-processing"
|
|
14
|
-
checked=values.enabled error=errors.enabled
|
|
15
|
-
hint="Filter emails and transform their data before saving them to the Document Store."}}
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
<div class="text-end space-y-1">
|
|
19
|
-
{{> ui/setting-ref name="documentStorePreProcessingEnabled" class="whitespace-nowrap"}}
|
|
20
|
-
|
|
21
|
-
{{#if values.enabled}}
|
|
22
|
-
{{> ui/badge label="enabled" variant="success"}}
|
|
23
|
-
{{else}}
|
|
24
|
-
{{> ui/badge label="disabled" variant="warning"}}
|
|
25
|
-
{{/if}}
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
<div class="card-body space-y-4">
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<div>
|
|
33
|
-
<div class="text-base-content/60 float-right code-link">[<a
|
|
34
|
-
href="https://learn.emailengine.app/docs/advanced/pre-processing" target="_blank"
|
|
35
|
-
rel="noopener noreferrer" referrerpolicy="no-referrer"
|
|
36
|
-
class="link link-animated">documentation</a>]
|
|
37
|
-
|
|
38
|
-
[<a href="/admin/reference/settings#postV1Settings" target="_blank" rel="noopener noreferrer"
|
|
39
|
-
referrerpolicy="no-referrer" class="link link-animated">documentStorePreProcessingFn</a>]
|
|
40
|
-
</div>
|
|
41
|
-
<label class="label-text" for="editor-fn">Filter function</label>
|
|
42
|
-
<div class="mb-2 leading-tight">
|
|
43
|
-
<small>JavaScript code to determine if the email should be stored. If the code evaluates to
|
|
44
|
-
<code>true</code> then the email is synced to the document store, otherwise it is skipped. The
|
|
45
|
-
script includes <code>payload</code> as a global variable that contains the email data.
|
|
46
|
-
Use <code>env</code> to access <a href="/admin/config/webhooks#scriptEnv"
|
|
47
|
-
class="link link-animated">script variables</a>.</small>
|
|
48
|
-
</div>
|
|
49
|
-
{{#> ui/code-editor id="editor-fn" title="Filter function"}}
|
|
50
|
-
<div class="editor-embed-content editor-embed-content-left editor-embed-content-right">
|
|
51
|
-
<a href="#" id="test-payload-btn">Set test payload</a>
|
|
52
|
-
</div>
|
|
53
|
-
|
|
54
|
-
<div class="editor-embed-content editor-embed-content-right editor-embed-content-left">
|
|
55
|
-
Evaluation result:
|
|
56
|
-
<span id="filter-res" class="text-info">no match</span>
|
|
57
|
-
</div>
|
|
58
|
-
|
|
59
|
-
<div class="editor-embed-content editor-embed-content-right">
|
|
60
|
-
{{> editor_scope_info}}
|
|
61
|
-
</div>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
{{/ui/code-editor}}
|
|
65
|
-
|
|
66
|
-
</div>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<div>
|
|
70
|
-
{{> ui/setting-ref name="documentStorePreProcessingMap"}}
|
|
71
|
-
<label class="label-text" for="editor-map">Map function</label>
|
|
72
|
-
<div class="mb-2 leading-tight">
|
|
73
|
-
<small>JavaScript code to modify email payload structure. Protected fields <code>id</code>,
|
|
74
|
-
<code>account</code>, <code>path</code>, <code>uid</code>, <code>specialUse</code>, and
|
|
75
|
-
<code>messageId</code> cannot be modified.
|
|
76
|
-
Use <code>env</code> to access <a href="/admin/config/webhooks#scriptEnv"
|
|
77
|
-
class="link link-animated">script variables</a>.</small>
|
|
78
|
-
</div>
|
|
79
|
-
|
|
80
|
-
<div class="grid grid-cols-1 gap-4 sm:grid-cols-12">
|
|
81
|
-
<div class="sm:col-span-7">
|
|
82
|
-
{{#> ui/code-editor id="editor-map" title="Mapping function"}}
|
|
83
|
-
<div class="editor-embed-content editor-embed-content-right">
|
|
84
|
-
{{> editor_scope_info}}
|
|
85
|
-
</div>
|
|
86
|
-
|
|
87
|
-
{{/ui/code-editor}}
|
|
88
|
-
</div>
|
|
89
|
-
<div class="sm:col-span-5">
|
|
90
|
-
{{> ui/code-editor id="editor-map-preview" title="Mapping preview"}}
|
|
91
|
-
</div>
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
|
|
98
|
-
<div class="mb-6">
|
|
99
|
-
{{> ui/btn label="Save changes" type="submit" icon="icon-[tabler--settings]"}}
|
|
100
|
-
</div>
|
|
101
|
-
</form>
|
|
102
|
-
|
|
103
|
-
{{> filter_editor_js hasMap=true defaultTestPayload='{"account":"test","path":"INBOX","subject":"test email"}'}}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{{> ui/page-header title="Document Store" icon="icon-[tabler--database]" class="mb-1"}}
|
|
2
|
-
|
|
3
|
-
<p class="mb-6">
|
|
4
|
-
EmailEngine can sync emails to a document store for caching and local processing.
|
|
5
|
-
</p>
|
|
6
|
-
|
|
7
|
-
{{#> ui/stat-card variant="error" title="Deprecation Notice" icon="icon-[tabler--alert-circle]" class="mb-6"}}
|
|
8
|
-
<p class="mb-2">The Document Store feature in EmailEngine has been deprecated. This decision was made due
|
|
9
|
-
to ongoing challenges in maintaining consistent synchronization between email accounts and their
|
|
10
|
-
mirrored content on the ElasticSearch server.</p>
|
|
11
|
-
<ul class="list-disc ps-6">
|
|
12
|
-
<li>Starting <strong>October 1, 2026</strong>, the Document Store will be removed from EmailEngine
|
|
13
|
-
releases. After that, syncing emails to ElasticSearch and the related endpoints (chat with email,
|
|
14
|
-
unified search) will no longer be available.</li>
|
|
15
|
-
<li>As a deprecated feature, it no longer receives new updates or enhancements.</li>
|
|
16
|
-
<li>If you want to keep using the Document Store, do not upgrade this EmailEngine instance beyond the
|
|
17
|
-
last release that still includes it. Be aware that such a frozen version will not receive security
|
|
18
|
-
updates, so continuing to run it is entirely at your own risk.</li>
|
|
19
|
-
</ul>
|
|
20
|
-
{{/ui/stat-card}}
|
|
21
|
-
|
|
22
|
-
<nav class="tabs tabs-bordered mb-6" aria-label="Document store sections">
|
|
23
|
-
<a class="tab{{#if documentStoreSettings}} tab-active{{/if}}" href="/admin/config/document-store">Settings</a>
|
|
24
|
-
<a class="tab{{#if documentStorePreProcessing}} tab-active{{/if}}"
|
|
25
|
-
href="/admin/config/document-store/pre-processing">Pre-processing</a>
|
|
26
|
-
<a class="tab{{#if documentStoreChat}} tab-active{{/if}}" href="/admin/config/document-store/chat">Chat with
|
|
27
|
-
emails {{> ui/badge label="beta" class="badge-sm ms-1"}}</a>
|
|
28
|
-
<a class="tab{{#if documentStoreMappings}} tab-active{{/if}}"
|
|
29
|
-
href="/admin/config/document-store/mappings">Field mappings</a>
|
|
30
|
-
</nav>
|