emailengine-app 2.81.1 → 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 +25 -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 +17 -17
- package/sbom.json +1 -1
- package/server.js +25 -49
- package/static/licenses.html +38 -38
- package/translations/messages.pot +75 -75
- 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
|
|
|
@@ -114,12 +114,67 @@ msgid ""
|
|
|
114
114
|
"received."
|
|
115
115
|
msgstr ""
|
|
116
116
|
|
|
117
|
-
#: views/accounts/register/
|
|
118
|
-
msgid "
|
|
117
|
+
#: views/accounts/register/imap.hbs:13
|
|
118
|
+
msgid "Your name"
|
|
119
119
|
msgstr ""
|
|
120
120
|
|
|
121
|
-
#: views/accounts/register/
|
|
122
|
-
msgid "
|
|
121
|
+
#: views/accounts/register/imap.hbs:19
|
|
122
|
+
msgid "Enter your full name"
|
|
123
|
+
msgstr ""
|
|
124
|
+
|
|
125
|
+
#: views/accounts/register/imap.hbs:35
|
|
126
|
+
msgid "This setup link is restricted to this email address"
|
|
127
|
+
msgstr ""
|
|
128
|
+
|
|
129
|
+
#: views/accounts/register/imap.hbs:37
|
|
130
|
+
msgid "Enter your email address"
|
|
131
|
+
msgstr ""
|
|
132
|
+
|
|
133
|
+
#: views/accounts/register/imap.hbs:43
|
|
134
|
+
#: views/accounts/register/imap-server.hbs:58
|
|
135
|
+
#: views/accounts/register/imap-server.hbs:165
|
|
136
|
+
msgid "Password"
|
|
137
|
+
msgstr ""
|
|
138
|
+
|
|
139
|
+
#: views/accounts/register/imap.hbs:49
|
|
140
|
+
msgid "Enter your account password"
|
|
141
|
+
msgstr ""
|
|
142
|
+
|
|
143
|
+
#: views/accounts/register/imap.hbs:55
|
|
144
|
+
#: views/accounts/register/validating.hbs:74
|
|
145
|
+
msgid "Continue"
|
|
146
|
+
msgstr ""
|
|
147
|
+
|
|
148
|
+
#: views/accounts/register/validating.hbs:35
|
|
149
|
+
msgid "Checking your mail server"
|
|
150
|
+
msgstr ""
|
|
151
|
+
|
|
152
|
+
#: views/accounts/register/validating.hbs:40
|
|
153
|
+
msgid "Still checking. This can take up to a minute."
|
|
154
|
+
msgstr ""
|
|
155
|
+
|
|
156
|
+
#: views/accounts/register/validating.hbs:47
|
|
157
|
+
msgid "Enter server settings manually"
|
|
158
|
+
msgstr ""
|
|
159
|
+
|
|
160
|
+
#: views/accounts/register/validating.hbs:53
|
|
161
|
+
msgid "We couldn't sign in to your mail server"
|
|
162
|
+
msgstr ""
|
|
163
|
+
|
|
164
|
+
#: views/accounts/register/validating.hbs:54
|
|
165
|
+
msgid "Check the settings on the next page and try again."
|
|
166
|
+
msgstr ""
|
|
167
|
+
|
|
168
|
+
#: views/accounts/register/validating.hbs:61
|
|
169
|
+
msgid "Continue to server settings"
|
|
170
|
+
msgstr ""
|
|
171
|
+
|
|
172
|
+
#: views/accounts/register/validating.hbs:69
|
|
173
|
+
msgid "Almost there"
|
|
174
|
+
msgstr ""
|
|
175
|
+
|
|
176
|
+
#: views/accounts/register/validating.hbs:70
|
|
177
|
+
msgid "Continue to review your mail server settings."
|
|
123
178
|
msgstr ""
|
|
124
179
|
|
|
125
180
|
#: views/accounts/register/imap-server.hbs:23
|
|
@@ -143,12 +198,6 @@ msgstr ""
|
|
|
143
198
|
msgid "Username"
|
|
144
199
|
msgstr ""
|
|
145
200
|
|
|
146
|
-
#: views/accounts/register/imap-server.hbs:58
|
|
147
|
-
#: views/accounts/register/imap-server.hbs:165
|
|
148
|
-
#: views/accounts/register/imap.hbs:43
|
|
149
|
-
msgid "Password"
|
|
150
|
-
msgstr ""
|
|
151
|
-
|
|
152
201
|
#: views/accounts/register/imap-server.hbs:70
|
|
153
202
|
#: views/accounts/register/imap-server.hbs:177
|
|
154
203
|
msgid "Important"
|
|
@@ -232,61 +281,12 @@ msgstr ""
|
|
|
232
281
|
msgid "We couldn't connect with these settings. Check the errors below."
|
|
233
282
|
msgstr ""
|
|
234
283
|
|
|
235
|
-
#: views/accounts/register/
|
|
236
|
-
msgid "
|
|
237
|
-
msgstr ""
|
|
238
|
-
|
|
239
|
-
#: views/accounts/register/imap.hbs:19
|
|
240
|
-
msgid "Enter your full name"
|
|
241
|
-
msgstr ""
|
|
242
|
-
|
|
243
|
-
#: views/accounts/register/imap.hbs:35
|
|
244
|
-
msgid "This setup link is restricted to this email address"
|
|
245
|
-
msgstr ""
|
|
246
|
-
|
|
247
|
-
#: views/accounts/register/imap.hbs:37
|
|
248
|
-
msgid "Enter your email address"
|
|
249
|
-
msgstr ""
|
|
250
|
-
|
|
251
|
-
#: views/accounts/register/imap.hbs:49
|
|
252
|
-
msgid "Enter your account password"
|
|
253
|
-
msgstr ""
|
|
254
|
-
|
|
255
|
-
#: views/accounts/register/imap.hbs:55
|
|
256
|
-
#: views/accounts/register/validating.hbs:74
|
|
257
|
-
msgid "Continue"
|
|
258
|
-
msgstr ""
|
|
259
|
-
|
|
260
|
-
#: views/accounts/register/validating.hbs:35
|
|
261
|
-
msgid "Checking your mail server"
|
|
262
|
-
msgstr ""
|
|
263
|
-
|
|
264
|
-
#: views/accounts/register/validating.hbs:40
|
|
265
|
-
msgid "Still checking. This can take up to a minute."
|
|
266
|
-
msgstr ""
|
|
267
|
-
|
|
268
|
-
#: views/accounts/register/validating.hbs:47
|
|
269
|
-
msgid "Enter server settings manually"
|
|
270
|
-
msgstr ""
|
|
271
|
-
|
|
272
|
-
#: views/accounts/register/validating.hbs:53
|
|
273
|
-
msgid "We couldn't sign in to your mail server"
|
|
274
|
-
msgstr ""
|
|
275
|
-
|
|
276
|
-
#: views/accounts/register/validating.hbs:54
|
|
277
|
-
msgid "Check the settings on the next page and try again."
|
|
278
|
-
msgstr ""
|
|
279
|
-
|
|
280
|
-
#: views/accounts/register/validating.hbs:61
|
|
281
|
-
msgid "Continue to server settings"
|
|
282
|
-
msgstr ""
|
|
283
|
-
|
|
284
|
-
#: views/accounts/register/validating.hbs:69
|
|
285
|
-
msgid "Almost there"
|
|
284
|
+
#: views/accounts/register/index.hbs:6
|
|
285
|
+
msgid "Choose your email account provider"
|
|
286
286
|
msgstr ""
|
|
287
287
|
|
|
288
|
-
#: views/accounts/register/
|
|
289
|
-
msgid "
|
|
288
|
+
#: views/accounts/register/index.hbs:19
|
|
289
|
+
msgid "Standard IMAP"
|
|
290
290
|
msgstr ""
|
|
291
291
|
|
|
292
292
|
#: views/partials/public_test_labels.hbs:9
|
|
@@ -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
|
-
|