emailengine-app 2.81.0 → 2.81.2
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 +6 -1
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +32 -0
- package/Dockerfile +2 -2
- package/data/google-crawlers.json +1 -1
- package/lib/account/bounce-store-sweep.js +63 -0
- package/lib/account-assignment.js +70 -0
- package/lib/account.js +123 -22
- package/lib/api-routes/message-routes.js +4 -1
- package/lib/arf-detect.js +8 -1
- package/lib/consts.js +9 -0
- package/lib/db.js +0 -6
- package/lib/email-client/base-client.js +253 -94
- package/lib/email-client/gmail-client.js +95 -35
- package/lib/email-client/imap/mailbox.js +105 -230
- package/lib/email-client/outlook-client.js +325 -220
- package/lib/export.js +11 -2
- package/lib/msgpack.js +1 -6
- package/lib/schemas.js +7 -20
- package/package.json +21 -21
- package/sbom.json +1 -1
- package/server.js +25 -49
- package/static/licenses.html +70 -46
- package/translations/messages.pot +30 -30
- package/workers/api.js +13 -3
- package/workers/imap.js +8 -1
- package/lib/append-list.js +0 -63
- package/lib/lua/h-push.lua +0 -32
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
msgid ""
|
|
2
2
|
msgstr ""
|
|
3
3
|
"Content-Type: text/plain; charset=ascii\n"
|
|
4
|
-
"POT-Creation-Date: 2026-09-
|
|
4
|
+
"POT-Creation-Date: 2026-09-27 19:09+0000\n"
|
|
5
5
|
|
|
6
6
|
#: views/error.hbs:6
|
|
7
|
-
#: workers/api.js:
|
|
7
|
+
#: workers/api.js:3140
|
|
8
8
|
msgid "Something went wrong"
|
|
9
9
|
msgstr ""
|
|
10
10
|
|
|
@@ -27,6 +27,16 @@ msgid_plural "%d days"
|
|
|
27
27
|
msgstr[0] ""
|
|
28
28
|
msgstr[1] ""
|
|
29
29
|
|
|
30
|
+
#: views/config/tls.hbs:416
|
|
31
|
+
msgid "%d certificate"
|
|
32
|
+
msgid_plural "%d certificates"
|
|
33
|
+
msgstr[0] ""
|
|
34
|
+
msgstr[1] ""
|
|
35
|
+
|
|
36
|
+
#: views/redirect.hbs:1
|
|
37
|
+
msgid "Click <a href=\"%s\">here</a> to continue…"
|
|
38
|
+
msgstr ""
|
|
39
|
+
|
|
30
40
|
#: views/oauth-scope-error.hbs:5
|
|
31
41
|
msgid "Insufficient Permissions"
|
|
32
42
|
msgstr ""
|
|
@@ -104,16 +114,6 @@ msgid ""
|
|
|
104
114
|
"received."
|
|
105
115
|
msgstr ""
|
|
106
116
|
|
|
107
|
-
#: views/redirect.hbs:1
|
|
108
|
-
msgid "Click <a href=\"%s\">here</a> to continue…"
|
|
109
|
-
msgstr ""
|
|
110
|
-
|
|
111
|
-
#: views/config/tls.hbs:416
|
|
112
|
-
msgid "%d certificate"
|
|
113
|
-
msgid_plural "%d certificates"
|
|
114
|
-
msgstr[0] ""
|
|
115
|
-
msgstr[1] ""
|
|
116
|
-
|
|
117
117
|
#: views/accounts/register/imap.hbs:13
|
|
118
118
|
msgid "Your name"
|
|
119
119
|
msgstr ""
|
|
@@ -145,14 +145,6 @@ msgstr ""
|
|
|
145
145
|
msgid "Continue"
|
|
146
146
|
msgstr ""
|
|
147
147
|
|
|
148
|
-
#: views/accounts/register/index.hbs:6
|
|
149
|
-
msgid "Choose your email account provider"
|
|
150
|
-
msgstr ""
|
|
151
|
-
|
|
152
|
-
#: views/accounts/register/index.hbs:19
|
|
153
|
-
msgid "Standard IMAP"
|
|
154
|
-
msgstr ""
|
|
155
|
-
|
|
156
148
|
#: views/accounts/register/validating.hbs:35
|
|
157
149
|
msgid "Checking your mail server"
|
|
158
150
|
msgstr ""
|
|
@@ -289,6 +281,14 @@ msgstr ""
|
|
|
289
281
|
msgid "We couldn't connect with these settings. Check the errors below."
|
|
290
282
|
msgstr ""
|
|
291
283
|
|
|
284
|
+
#: views/accounts/register/index.hbs:6
|
|
285
|
+
msgid "Choose your email account provider"
|
|
286
|
+
msgstr ""
|
|
287
|
+
|
|
288
|
+
#: views/accounts/register/index.hbs:19
|
|
289
|
+
msgid "Standard IMAP"
|
|
290
|
+
msgstr ""
|
|
291
|
+
|
|
292
292
|
#: views/partials/public_test_labels.hbs:9
|
|
293
293
|
msgid "Error"
|
|
294
294
|
msgstr ""
|
|
@@ -371,8 +371,8 @@ msgstr ""
|
|
|
371
371
|
#: lib/ui-routes/account-routes.js:1212
|
|
372
372
|
#: lib/ui-routes/account-routes.js:1404
|
|
373
373
|
#: lib/ui-routes/route-helpers.js:403
|
|
374
|
-
#: workers/api.js:
|
|
375
|
-
#: workers/api.js:
|
|
374
|
+
#: workers/api.js:2312
|
|
375
|
+
#: workers/api.js:2382
|
|
376
376
|
msgid "Email Account Setup"
|
|
377
377
|
msgstr ""
|
|
378
378
|
|
|
@@ -497,37 +497,37 @@ msgstr ""
|
|
|
497
497
|
msgid "Couldn't process request. Try again."
|
|
498
498
|
msgstr ""
|
|
499
499
|
|
|
500
|
-
#: workers/api.js:
|
|
500
|
+
#: workers/api.js:2241
|
|
501
501
|
msgid ""
|
|
502
502
|
"The sign-in was cancelled or the requested access was not granted. Open the "
|
|
503
503
|
"account setup link again to retry."
|
|
504
504
|
msgstr ""
|
|
505
505
|
|
|
506
|
-
#: workers/api.js:
|
|
506
|
+
#: workers/api.js:2250
|
|
507
507
|
msgid "Sign-in with the email provider failed: %s"
|
|
508
508
|
msgstr ""
|
|
509
509
|
|
|
510
|
-
#: workers/api.js:
|
|
510
|
+
#: workers/api.js:2254
|
|
511
511
|
msgid "Sign-in with the email provider failed: no authorization code was received"
|
|
512
512
|
msgstr ""
|
|
513
513
|
|
|
514
|
-
#: workers/api.js:
|
|
514
|
+
#: workers/api.js:2260
|
|
515
515
|
msgid "Sign-in with the email provider failed: the request state is not valid"
|
|
516
516
|
msgstr ""
|
|
517
517
|
|
|
518
|
-
#: workers/api.js:
|
|
518
|
+
#: workers/api.js:2266
|
|
519
519
|
msgid ""
|
|
520
520
|
"The account setup session has expired or was already used. Open the account "
|
|
521
521
|
"setup link again to retry."
|
|
522
522
|
msgstr ""
|
|
523
523
|
|
|
524
|
-
#: workers/api.js:
|
|
524
|
+
#: workers/api.js:2273
|
|
525
525
|
msgid ""
|
|
526
526
|
"Sign-in with the email provider failed: the stored setup session is not "
|
|
527
527
|
"valid"
|
|
528
528
|
msgstr ""
|
|
529
529
|
|
|
530
|
-
#: workers/api.js:
|
|
531
|
-
#: workers/api.js:
|
|
530
|
+
#: workers/api.js:3139
|
|
531
|
+
#: workers/api.js:3254
|
|
532
532
|
msgid "Requested page not found"
|
|
533
533
|
msgstr ""
|
package/workers/api.js
CHANGED
|
@@ -2027,6 +2027,7 @@ const init = async () => {
|
|
|
2027
2027
|
|
|
2028
2028
|
const outlookSubscription = accountData.outlookSubscription;
|
|
2029
2029
|
|
|
2030
|
+
const events = [];
|
|
2030
2031
|
for (let entry of notificationEntries) {
|
|
2031
2032
|
// enumerate and queue all entries
|
|
2032
2033
|
const subscriptionIdMatch = entry.subscriptionId === outlookSubscription.id;
|
|
@@ -2046,12 +2047,14 @@ const init = async () => {
|
|
|
2046
2047
|
continue;
|
|
2047
2048
|
}
|
|
2048
2049
|
|
|
2049
|
-
|
|
2050
|
+
events.push({
|
|
2050
2051
|
type: entry.changeType,
|
|
2051
2052
|
message: entry.resourceData && entry.resourceData.id
|
|
2052
|
-
};
|
|
2053
|
+
});
|
|
2054
|
+
}
|
|
2053
2055
|
|
|
2054
|
-
|
|
2056
|
+
if (events.length) {
|
|
2057
|
+
await accountObject.pushQueueEvents(events);
|
|
2055
2058
|
}
|
|
2056
2059
|
|
|
2057
2060
|
return h.response(Buffer.alloc(0)).code(202);
|
|
@@ -2179,6 +2182,13 @@ const init = async () => {
|
|
|
2179
2182
|
account: request.query.account
|
|
2180
2183
|
});
|
|
2181
2184
|
|
|
2185
|
+
if (entry.lifecycleEvent === 'missed') {
|
|
2186
|
+
// Stored before answering, one quick write: the worker call below may find
|
|
2187
|
+
// no worker for the account, and the lost changes are not reported again.
|
|
2188
|
+
// A failed write is answered with an error, so Graph delivers it again
|
|
2189
|
+
await accountObject.queueMissedRecovery();
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2182
2192
|
// Fire-and-forget: return HTTP 202 immediately so Microsoft
|
|
2183
2193
|
// does not time out the lifecycle webhook delivery
|
|
2184
2194
|
call({
|
package/workers/imap.js
CHANGED
|
@@ -21,6 +21,7 @@ const { oauth2Apps, isApiBasedApp } = require('../lib/oauth2-apps');
|
|
|
21
21
|
const { redis, notifyQueue, submitQueue, documentsQueue, getFlowProducer } = require('../lib/db');
|
|
22
22
|
const { sendToMessagePort, MessagePortWritable } = require('../lib/message-port-stream');
|
|
23
23
|
const { packRpcError, unpackRpcError } = require('../lib/worker-rpc-error');
|
|
24
|
+
const { ImapFlowErrorCode } = require('imapflow');
|
|
24
25
|
const { getESClient } = require('../lib/document-store');
|
|
25
26
|
const settings = require('../lib/settings');
|
|
26
27
|
const msgpack = require('../lib/msgpack');
|
|
@@ -709,8 +710,9 @@ class ConnectionHandler {
|
|
|
709
710
|
return true;
|
|
710
711
|
|
|
711
712
|
case 'missed':
|
|
713
|
+
// the API worker already stored the recovery request, see Account.queueMissedRecovery()
|
|
712
714
|
logger.info({ msg: 'Handling missed notification lifecycle event', account: message.account });
|
|
713
|
-
return
|
|
715
|
+
return connection.recoverMissedNotifications();
|
|
714
716
|
|
|
715
717
|
default:
|
|
716
718
|
logger.warn({ msg: 'Unknown subscription lifecycle event', event: message.event, account: message.account });
|
|
@@ -1056,6 +1058,11 @@ parentPort.on('message', message => {
|
|
|
1056
1058
|
// 503 is excluded from the error branch on purpose: both "no active handler" and
|
|
1057
1059
|
// IMAPConnectionClosing carry it, and a worker taking over accounts answers every
|
|
1058
1060
|
// in-flight command with one until the reassignment settles.
|
|
1061
|
+
if (err.code === ImapFlowErrorCode.ETHROTTLE && !err.statusCode) {
|
|
1062
|
+
// ImapFlow gave up after the server throttled every retry: the caller should
|
|
1063
|
+
// back off, the same answer a throttled Gmail or Graph request gets
|
|
1064
|
+
err.statusCode = 429;
|
|
1065
|
+
}
|
|
1059
1066
|
let isServerFault = !err.statusCode || (err.statusCode >= 500 && err.statusCode !== 503);
|
|
1060
1067
|
logger[isServerFault ? 'error' : 'debug'](Object.assign({ msg: 'Command failed' }, message, { err }));
|
|
1061
1068
|
parentPort.postMessage(Object.assign({ cmd: 'resp', mid: message.mid }, packRpcError(err)));
|
package/lib/append-list.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const msgpack = require('./msgpack');
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Pushes an object to the end of a list where that list is stored in a hash field
|
|
7
|
-
*
|
|
8
|
-
* @async
|
|
9
|
-
* @param {Object} redis Redis client
|
|
10
|
-
* @param {String} list Hash key
|
|
11
|
-
* @param {String} key Hash field
|
|
12
|
-
* @param {Object} obj Data to serialize and append to the list
|
|
13
|
-
* @returns {Number} either 1 if this was the first element or 2
|
|
14
|
-
*/
|
|
15
|
-
async function append(redis, list, key, obj) {
|
|
16
|
-
if (!obj) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
let encoded;
|
|
20
|
-
|
|
21
|
-
try {
|
|
22
|
-
encoded = msgpack.encode(obj);
|
|
23
|
-
} catch (err) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
let result = await redis.hPush(list, key, encoded);
|
|
28
|
-
return result;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Retrieves all stored entries of a list
|
|
33
|
-
*
|
|
34
|
-
* @async
|
|
35
|
-
* @param {Object} redis Redis client
|
|
36
|
-
* @param {String} list Hash key
|
|
37
|
-
* @param {String} key Hash field
|
|
38
|
-
* @returns {Array} Stored objects as an array
|
|
39
|
-
*/
|
|
40
|
-
async function list(redis, list, key) {
|
|
41
|
-
let contents = await redis.hgetBuffer(list, key);
|
|
42
|
-
if (!contents) {
|
|
43
|
-
return [];
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// the hash field holds a byte stream of concatenated msgpack values
|
|
47
|
-
return msgpack.decodeMulti(contents);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Clears a list from Redis
|
|
52
|
-
*
|
|
53
|
-
* @async
|
|
54
|
-
* @param {Object} redis Redis client
|
|
55
|
-
* @param {String} list Hash key
|
|
56
|
-
* @param {String} key Hash field
|
|
57
|
-
* @returns {Number} 1 if list was deleted or 0
|
|
58
|
-
*/
|
|
59
|
-
async function clear(redis, list, key) {
|
|
60
|
-
return await redis.hdel(list, key);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
module.exports = { append, list, clear };
|
package/lib/lua/h-push.lua
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
--[[
|
|
2
|
-
Script: h-push.lua
|
|
3
|
-
Purpose: Appends data to a hash field value (concatenates strings)
|
|
4
|
-
|
|
5
|
-
KEYS:
|
|
6
|
-
[1] hashKey - The hash key to operate on
|
|
7
|
-
|
|
8
|
-
ARGV:
|
|
9
|
-
[1] entryKey - The hash field name
|
|
10
|
-
[2] buf - The string buffer to append
|
|
11
|
-
|
|
12
|
-
Returns:
|
|
13
|
-
2 if field existed and data was appended
|
|
14
|
-
1 if field was newly created with the data
|
|
15
|
-
--]]
|
|
16
|
-
|
|
17
|
-
local hashKey = KEYS[1];
|
|
18
|
-
local entryKey = ARGV[1];
|
|
19
|
-
|
|
20
|
-
local buf = ARGV[2];
|
|
21
|
-
|
|
22
|
-
if redis.call("HEXISTS", hashKey, entryKey) == 1 then
|
|
23
|
-
-- Field exists, append to existing content
|
|
24
|
-
local content = redis.call("HGET", hashKey, entryKey);
|
|
25
|
-
redis.call("HSET", hashKey, entryKey, content .. buf);
|
|
26
|
-
return 2; -- Indicates append operation
|
|
27
|
-
else
|
|
28
|
-
-- Field doesn't exist, create new
|
|
29
|
-
redis.call("HSET", hashKey, entryKey, buf);
|
|
30
|
-
return 1; -- Indicates new field creation
|
|
31
|
-
end;
|
|
32
|
-
|