emailengine-app 2.84.2 → 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/.ncurc.js +5 -3
- package/.prettierignore +5 -1
- package/.prettierrc.js +2 -0
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +33 -0
- package/Dockerfile +6 -0
- package/README.md +1 -1
- package/bin/emailengine.js +434 -408
- package/copy-static-files.sh +39 -14
- package/data/google-crawlers.json +1 -1
- package/data/public_suffix_list.dat +16562 -0
- package/eslint.config.js +81 -99
- package/lib/account.js +36 -5
- package/lib/api-reference/format.js +4 -3
- package/lib/api-routes/account-routes.js +177 -12
- 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 +28 -2
- package/lib/api-routes/mailbox-routes.js +41 -2
- package/lib/api-routes/message-routes.js +97 -3
- 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/settings-routes.js +23 -2
- package/lib/api-routes/submit-routes.js +336 -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/bounce-detect.js +397 -205
- package/lib/consts.js +5 -4
- package/lib/email-client/base-client.js +10 -31
- package/lib/email-client/gmail-client.js +9 -11
- package/lib/email-client/imap/mailbox.js +3 -19
- package/lib/email-client/imap/subconnection.js +1 -1
- package/lib/email-client/imap-client.js +1 -1
- package/lib/email-client/notification-handler.js +1 -2
- package/lib/gateway.js +2 -3
- package/lib/hapi-request-logger.js +107 -0
- package/lib/imapproxy/imap-core/README.md +6 -5
- package/lib/mcp/tools.js +37 -8
- package/lib/notify-attachments.js +17 -0
- package/lib/oauth/outlook-mailbox.js +35 -0
- package/lib/oauth/state.js +24 -0
- package/lib/oauth2-apps.js +1 -1
- package/lib/pbkdf2-phc.js +1 -1
- package/lib/schemas.js +1 -1
- 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 +40 -10
- package/lib/totp.js +2 -5
- package/lib/translations.js +1 -2
- package/lib/ui-routes/account-routes.js +475 -454
- package/lib/ui-routes/account-setup.js +99 -0
- package/lib/ui-routes/admin-config-routes.js +88 -10
- package/lib/ui-routes/admin-entities-routes.js +91 -7
- package/lib/ui-routes/auth-routes.js +90 -38
- package/lib/ui-routes/internals-routes.js +5 -0
- package/lib/ui-routes/oauth-config-routes.js +124 -82
- package/lib/ui-routes/route-helpers.js +19 -3
- package/lib/ui-routes/tls-config-routes.js +58 -15
- package/lib/utils/back-off.js +82 -0
- package/lib/utils/murmurhash3.js +66 -0
- package/lib/utils/public-suffix.js +122 -0
- package/lib/utils/random-id.js +26 -0
- package/lib/utils/version.js +74 -0
- package/lib/webhook-routing.js +27 -0
- package/lib/webhooks.js +41 -6
- package/package.json +27 -29
- package/sbom.json +7980 -1
- package/server.js +634 -441
- package/static/licenses.html +181 -1006
- package/translations/messages.pot +62 -63
- 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/webhook_form.hbs +1 -1
- package/views/suppression-lists/index.hbs +1 -1
- package/workers/api.js +738 -583
- package/workers/export.js +1 -1
- package/workers/submit.js +1 -1
- package/workers/webhooks.js +16 -32
|
@@ -10,17 +10,8 @@ const { outboxEntrySchema, apiResponses, apiBoolean } = require('../schemas');
|
|
|
10
10
|
const { IMPACT } = require('./operation-impact');
|
|
11
11
|
const { MCP_MAX_PAGE_SIZE } = require('../consts');
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
const {
|
|
15
|
-
|
|
16
|
-
// The queue ID of a message, as every per-message outbox route takes it
|
|
17
|
-
const outboxEntryParams = Joi.object({
|
|
18
|
-
queueId: Joi.string().max(100).example('d41f0423195f271f').description('Queue identifier for scheduled email').required()
|
|
19
|
-
}).label('OutboxEntryParams');
|
|
20
|
-
|
|
21
|
-
// What every per-message route answers for an unknown queue ID. The state refusals the
|
|
22
|
-
// outbox module throws (code NotFailed, ContentGone, NotDelayed) carry a 409 of their own
|
|
23
|
-
const notFound = () => Boom.boomify(new Error('Requested queue entry was not found'), { statusCode: 404 });
|
|
13
|
+
function registerListOutbox(server, ctx) {
|
|
14
|
+
const { CORS_CONFIG } = ctx;
|
|
24
15
|
|
|
25
16
|
server.route({
|
|
26
17
|
method: 'GET',
|
|
@@ -98,6 +89,10 @@ async function init(args) {
|
|
|
98
89
|
}
|
|
99
90
|
}
|
|
100
91
|
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function registerGetOutboxEntry(server, ctx) {
|
|
95
|
+
const { CORS_CONFIG, outboxEntryParams, notFound } = ctx;
|
|
101
96
|
|
|
102
97
|
server.route({
|
|
103
98
|
method: 'GET',
|
|
@@ -121,6 +116,12 @@ async function init(args) {
|
|
|
121
116
|
tags: ['api', 'Outbox'],
|
|
122
117
|
|
|
123
118
|
plugins: {
|
|
119
|
+
mcp: {
|
|
120
|
+
name: 'get_queued_message',
|
|
121
|
+
title: 'Get queued message',
|
|
122
|
+
description:
|
|
123
|
+
'Get one message in the sending queue by the queue id that send_message, send_draft or get_outbox returned: its recipients, scheduled time, delivery attempts and the last delivery error.'
|
|
124
|
+
},
|
|
124
125
|
openapi: {
|
|
125
126
|
responses: apiResponses('Returns the queued message, including its delivery attempts and last error.', 400, 401, 403, 404, 429, 500)
|
|
126
127
|
}
|
|
@@ -149,6 +150,10 @@ async function init(args) {
|
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
152
|
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function registerRetryOutboxEntry(server, ctx) {
|
|
156
|
+
const { CORS_CONFIG, outboxEntryParams, notFound } = ctx;
|
|
152
157
|
|
|
153
158
|
server.route({
|
|
154
159
|
method: 'POST',
|
|
@@ -209,6 +214,10 @@ async function init(args) {
|
|
|
209
214
|
}
|
|
210
215
|
}
|
|
211
216
|
});
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function registerPromoteOutboxEntry(server, ctx) {
|
|
220
|
+
const { CORS_CONFIG, outboxEntryParams, notFound } = ctx;
|
|
212
221
|
|
|
213
222
|
server.route({
|
|
214
223
|
method: 'POST',
|
|
@@ -269,6 +278,10 @@ async function init(args) {
|
|
|
269
278
|
}
|
|
270
279
|
}
|
|
271
280
|
});
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function registerDeleteOutboxEntry(server, ctx) {
|
|
284
|
+
const { CORS_CONFIG, outboxEntryParams } = ctx;
|
|
272
285
|
|
|
273
286
|
server.route({
|
|
274
287
|
method: 'DELETE',
|
|
@@ -331,4 +344,25 @@ async function init(args) {
|
|
|
331
344
|
});
|
|
332
345
|
}
|
|
333
346
|
|
|
347
|
+
async function init(args) {
|
|
348
|
+
const { server, CORS_CONFIG } = args;
|
|
349
|
+
|
|
350
|
+
// The queue ID of a message, as every per-message outbox route takes it
|
|
351
|
+
const outboxEntryParams = Joi.object({
|
|
352
|
+
queueId: Joi.string().max(100).example('d41f0423195f271f').description('Queue identifier for scheduled email').required()
|
|
353
|
+
}).label('OutboxEntryParams');
|
|
354
|
+
|
|
355
|
+
// What every per-message route answers for an unknown queue ID. The state refusals the
|
|
356
|
+
// outbox module throws (code NotFailed, ContentGone, NotDelayed) carry a 409 of their own
|
|
357
|
+
const notFound = () => Boom.boomify(new Error('Requested queue entry was not found'), { statusCode: 404 });
|
|
358
|
+
|
|
359
|
+
const ctx = { CORS_CONFIG, outboxEntryParams, notFound };
|
|
360
|
+
|
|
361
|
+
registerListOutbox(server, ctx);
|
|
362
|
+
registerGetOutboxEntry(server, ctx);
|
|
363
|
+
registerRetryOutboxEntry(server, ctx);
|
|
364
|
+
registerPromoteOutboxEntry(server, ctx);
|
|
365
|
+
registerDeleteOutboxEntry(server, ctx);
|
|
366
|
+
}
|
|
367
|
+
|
|
334
368
|
module.exports = init;
|
|
@@ -215,7 +215,14 @@ const SURFACE_GRANTS = {
|
|
|
215
215
|
{ action: ACTION.DESTRUCTIVE, group: GROUP.MESSAGE },
|
|
216
216
|
{ action: ACTION.SEND, group: GROUP.SUBMIT },
|
|
217
217
|
{ action: ACTION.READ, group: GROUP.OUTBOX },
|
|
218
|
-
{ action: ACTION.READ, group: GROUP.TEMPLATE }
|
|
218
|
+
{ action: ACTION.READ, group: GROUP.TEMPLATE },
|
|
219
|
+
// Folder create and rename (the Mail agent level) and folder delete (Full access), added
|
|
220
|
+
// 2026-10-20 by explicit operator decision. Unlike the pairs above, these widened tokens
|
|
221
|
+
// already issued: an mcp-scoped token without a permissions record is bounded by this
|
|
222
|
+
// table alone, and those - including every one minted from the "Full access" consent in
|
|
223
|
+
// 2.79.2 to 2.80.0 - gained folder create, rename and delete with them
|
|
224
|
+
{ action: ACTION.WRITE, group: GROUP.MAILBOX },
|
|
225
|
+
{ action: ACTION.DESTRUCTIVE, group: GROUP.MAILBOX }
|
|
219
226
|
],
|
|
220
227
|
|
|
221
228
|
// The management half of the MCP endpoint: the same door, checked per request the same way,
|
|
@@ -428,6 +435,10 @@ const GROUP_ROUTES = {
|
|
|
428
435
|
'DELETE /v1/account/{account}',
|
|
429
436
|
'PUT /v1/account/{account}/flush',
|
|
430
437
|
'PUT /v1/account/{account}/reconnect',
|
|
438
|
+
// Lifts the auth-failure park and reconnects: operating the connection like the reconnect
|
|
439
|
+
// above, and no more than that - it never touches the stored credentials or where they
|
|
440
|
+
// are sent, and an operator's own send-only switch is not lifted by it
|
|
441
|
+
'PUT /v1/account/{account}/resume',
|
|
431
442
|
'PUT /v1/account/{account}/sync',
|
|
432
443
|
'GET /v1/account/{account}/server-signatures'
|
|
433
444
|
],
|
|
@@ -43,8 +43,8 @@ settingsOutputSchema.eventTypes = Joi.array()
|
|
|
43
43
|
// agree.
|
|
44
44
|
const MCP_SETTINGS_KEYS = Object.keys(settingsSchema).filter(key => !settings.privilegedKeys.includes(key) && !isHiddenSetting(key));
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
const {
|
|
46
|
+
function registerGetSettings(server, args) {
|
|
47
|
+
const { CORS_CONFIG } = args;
|
|
48
48
|
|
|
49
49
|
server.route({
|
|
50
50
|
method: 'GET',
|
|
@@ -135,6 +135,10 @@ async function init(args) {
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function registerUpdateSettings(server, args) {
|
|
141
|
+
const { call, notify, CORS_CONFIG } = args;
|
|
138
142
|
|
|
139
143
|
server.route({
|
|
140
144
|
method: 'POST',
|
|
@@ -256,6 +260,10 @@ async function init(args) {
|
|
|
256
260
|
}
|
|
257
261
|
}
|
|
258
262
|
});
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
function registerGetQueueSettings(server, args) {
|
|
266
|
+
const { CORS_CONFIG } = args;
|
|
259
267
|
|
|
260
268
|
server.route({
|
|
261
269
|
method: 'GET',
|
|
@@ -360,6 +368,10 @@ async function init(args) {
|
|
|
360
368
|
}
|
|
361
369
|
}
|
|
362
370
|
});
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
function registerUpdateQueueSettings(server, args) {
|
|
374
|
+
const { CORS_CONFIG } = args;
|
|
363
375
|
|
|
364
376
|
server.route({
|
|
365
377
|
method: 'PUT',
|
|
@@ -452,4 +464,13 @@ async function init(args) {
|
|
|
452
464
|
});
|
|
453
465
|
}
|
|
454
466
|
|
|
467
|
+
async function init(args) {
|
|
468
|
+
const { server } = args;
|
|
469
|
+
|
|
470
|
+
registerGetSettings(server, args);
|
|
471
|
+
registerUpdateSettings(server, args);
|
|
472
|
+
registerGetQueueSettings(server, args);
|
|
473
|
+
registerUpdateQueueSettings(server, args);
|
|
474
|
+
}
|
|
475
|
+
|
|
455
476
|
module.exports = init;
|