emailengine-app 2.63.3 → 2.63.4
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/CHANGELOG.md +10 -0
- package/data/google-crawlers.json +1 -1
- package/lib/email-client/imap/mailbox.js +24 -6
- package/lib/email-client/imap/sync-operations.js +17 -5
- package/lib/email-client/imap-client.js +20 -13
- package/lib/tools.js +6 -0
- package/package.json +7 -7
- package/sbom.json +1 -1
- package/static/licenses.html +27 -17
- package/translations/messages.pot +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.63.4](https://github.com/postalsys/emailengine/compare/v2.63.3...v2.63.4) (2026-03-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* guard null imapClient dereferences during async operations ([671bcee](https://github.com/postalsys/emailengine/commit/671bcee4e81c7c0d6421617c3e25ec6906cb1abb))
|
|
9
|
+
* prevent null dereference crash in getImapConnection during connection drops ([6a356fd](https://github.com/postalsys/emailengine/commit/6a356fd20e1412a070c26c093108c4ea2a722a5c))
|
|
10
|
+
* throw instead of silent return in select() null guard, revert redundant optional chaining ([cb7db50](https://github.com/postalsys/emailengine/commit/cb7db5024e0b00f8a773328dd5e0009067bed0b6))
|
|
11
|
+
* update tests for getCurrentListing null guard changes ([a644f9c](https://github.com/postalsys/emailengine/commit/a644f9c1c3f3e4cbce388e43bfa319f11f4a469c))
|
|
12
|
+
|
|
3
13
|
## [2.63.3](https://github.com/postalsys/emailengine/compare/v2.63.2...v2.63.3) (2026-03-05)
|
|
4
14
|
|
|
5
15
|
|
|
@@ -94,7 +94,10 @@ class Mailbox {
|
|
|
94
94
|
getMailboxStatus(connectionClient) {
|
|
95
95
|
connectionClient = connectionClient || this.connection.imapClient;
|
|
96
96
|
if (!connectionClient) {
|
|
97
|
-
|
|
97
|
+
let err = new Error('IMAP connection not available');
|
|
98
|
+
err.code = 'IMAPConnectionClosing';
|
|
99
|
+
err.statusCode = 503;
|
|
100
|
+
throw err;
|
|
98
101
|
}
|
|
99
102
|
|
|
100
103
|
let mailboxInfo = connectionClient.mailbox;
|
|
@@ -490,6 +493,12 @@ class Mailbox {
|
|
|
490
493
|
* @param {Boolean} skipIdle - Don't start IDLE after selecting
|
|
491
494
|
*/
|
|
492
495
|
async select(skipIdle) {
|
|
496
|
+
if (!this.connection.imapClient) {
|
|
497
|
+
let err = new Error('IMAP connection not available');
|
|
498
|
+
err.code = 'IMAPConnectionClosing';
|
|
499
|
+
err.statusCode = 503;
|
|
500
|
+
throw err;
|
|
501
|
+
}
|
|
493
502
|
const currentLock = this.connection.imapClient.currentLock;
|
|
494
503
|
// Avoid interfering with any active operations
|
|
495
504
|
if (currentLock) {
|
|
@@ -520,7 +529,7 @@ class Mailbox {
|
|
|
520
529
|
|
|
521
530
|
// Check if we still need to select after getting the lock
|
|
522
531
|
// Another operation might have already selected this mailbox while we were waiting
|
|
523
|
-
if (this.connection.imapClient
|
|
532
|
+
if (this.connection.imapClient?.mailbox && this.connection.imapClient.mailbox.path === this.path) {
|
|
524
533
|
this.logger.trace({
|
|
525
534
|
msg: 'Mailbox already selected after lock acquired',
|
|
526
535
|
path: this.path
|
|
@@ -551,7 +560,10 @@ class Mailbox {
|
|
|
551
560
|
connectionClient = connectionClient || this.connection.imapClient;
|
|
552
561
|
|
|
553
562
|
if (!connectionClient) {
|
|
554
|
-
|
|
563
|
+
let err = new Error('IMAP connection not available');
|
|
564
|
+
err.code = 'IMAPConnectionClosing';
|
|
565
|
+
err.statusCode = 503;
|
|
566
|
+
throw err;
|
|
555
567
|
}
|
|
556
568
|
|
|
557
569
|
let lock = await connectionClient.getMailboxLock(this.path, options || {});
|
|
@@ -613,7 +625,13 @@ class Mailbox {
|
|
|
613
625
|
return false;
|
|
614
626
|
})
|
|
615
627
|
.then(() => this.select())
|
|
616
|
-
.catch(err =>
|
|
628
|
+
.catch(err => {
|
|
629
|
+
if (err.code === 'IMAPConnectionClosing') {
|
|
630
|
+
this.logger.debug({ msg: 'Sync skipped, connection closing', err });
|
|
631
|
+
} else {
|
|
632
|
+
this.logger.error({ msg: 'Sync error', err });
|
|
633
|
+
}
|
|
634
|
+
});
|
|
617
635
|
}, 1000);
|
|
618
636
|
}
|
|
619
637
|
|
|
@@ -1090,7 +1108,7 @@ class Mailbox {
|
|
|
1090
1108
|
|
|
1091
1109
|
// Resolve Gmail category for inbox messages
|
|
1092
1110
|
if (
|
|
1093
|
-
this.connection.imapClient
|
|
1111
|
+
this.connection.imapClient?.capabilities?.has('X-GM-EXT-1') &&
|
|
1094
1112
|
this.isAllMail &&
|
|
1095
1113
|
messageInfo.labels &&
|
|
1096
1114
|
messageInfo.labels.includes('\\Inbox') &&
|
|
@@ -2069,7 +2087,7 @@ class Mailbox {
|
|
|
2069
2087
|
}
|
|
2070
2088
|
|
|
2071
2089
|
// Partial sync if CONDSTORE indicates only new messages or flag changes
|
|
2072
|
-
if (canUseCondstorePartialSync(this.connection.imapClient, storedStatus, mailboxStatus)) {
|
|
2090
|
+
if (this.connection.imapClient && canUseCondstorePartialSync(this.connection.imapClient, storedStatus, mailboxStatus)) {
|
|
2073
2091
|
return await this.partialSync(storedStatus);
|
|
2074
2092
|
}
|
|
2075
2093
|
|
|
@@ -197,7 +197,10 @@ class SyncOperations {
|
|
|
197
197
|
this.mailbox.syncing = true;
|
|
198
198
|
try {
|
|
199
199
|
if (!this.connection.imapClient) {
|
|
200
|
-
|
|
200
|
+
let err = new Error('IMAP connection not available');
|
|
201
|
+
err.code = 'IMAPConnectionClosing';
|
|
202
|
+
err.statusCode = 503;
|
|
203
|
+
throw err;
|
|
201
204
|
}
|
|
202
205
|
|
|
203
206
|
let knownUidNext = typeof storedStatus.uidNext === 'number' ? storedStatus.uidNext || 1 : 1;
|
|
@@ -351,7 +354,10 @@ class SyncOperations {
|
|
|
351
354
|
this.mailbox.syncing = true;
|
|
352
355
|
try {
|
|
353
356
|
if (!this.connection.imapClient) {
|
|
354
|
-
|
|
357
|
+
let err = new Error('IMAP connection not available');
|
|
358
|
+
err.code = 'IMAPConnectionClosing';
|
|
359
|
+
err.statusCode = 503;
|
|
360
|
+
throw err;
|
|
355
361
|
}
|
|
356
362
|
|
|
357
363
|
let fields = { uid: true, flags: true, modseq: true, emailId: true, labels: true, internalDate: true };
|
|
@@ -378,7 +384,10 @@ class SyncOperations {
|
|
|
378
384
|
let imapClient = this.connection.imapClient;
|
|
379
385
|
if (!imapClient || !imapClient.usable) {
|
|
380
386
|
this.logger.error({ msg: 'IMAP client not available for partial sync' });
|
|
381
|
-
|
|
387
|
+
let err = new Error('IMAP connection not available');
|
|
388
|
+
err.code = 'IMAPConnectionClosing';
|
|
389
|
+
err.statusCode = 503;
|
|
390
|
+
throw err;
|
|
382
391
|
}
|
|
383
392
|
|
|
384
393
|
try {
|
|
@@ -556,7 +565,10 @@ class SyncOperations {
|
|
|
556
565
|
const imapClient = this.connection.imapClient;
|
|
557
566
|
if (!imapClient || !imapClient.usable) {
|
|
558
567
|
this.logger.error({ msg: 'IMAP client not available for FETCH' });
|
|
559
|
-
|
|
568
|
+
let err = new Error('IMAP connection not available');
|
|
569
|
+
err.code = 'IMAPConnectionClosing';
|
|
570
|
+
err.statusCode = 503;
|
|
571
|
+
throw err;
|
|
560
572
|
}
|
|
561
573
|
|
|
562
574
|
try {
|
|
@@ -728,7 +740,7 @@ class SyncOperations {
|
|
|
728
740
|
|
|
729
741
|
// Verify we're still on the correct mailbox after the delay
|
|
730
742
|
// Another operation might have changed the mailbox while we were waiting
|
|
731
|
-
const currentMailbox = this.connection.imapClient
|
|
743
|
+
const currentMailbox = this.connection.imapClient?.mailbox;
|
|
732
744
|
if (!currentMailbox || currentMailbox.path !== this.mailbox.path) {
|
|
733
745
|
this.logger.error({
|
|
734
746
|
msg: 'Mailbox changed during retry delay, aborting sync',
|
|
@@ -191,6 +191,12 @@ class IMAPClient extends BaseClient {
|
|
|
191
191
|
let syncing = this.syncing || ['init', 'connecting', 'syncing'].includes(this.state);
|
|
192
192
|
if (!noPool && (!syncing || !allowSecondary)) {
|
|
193
193
|
// Return the primary connection for most operations
|
|
194
|
+
if (!this.imapClient) {
|
|
195
|
+
let err = new Error('IMAP connection not available');
|
|
196
|
+
err.code = 'IMAPConnectionClosing';
|
|
197
|
+
err.statusCode = 503;
|
|
198
|
+
throw err;
|
|
199
|
+
}
|
|
194
200
|
return this.imapClient;
|
|
195
201
|
}
|
|
196
202
|
|
|
@@ -202,14 +208,19 @@ class IMAPClient extends BaseClient {
|
|
|
202
208
|
if (connectionClient && connectionClient.usable) {
|
|
203
209
|
connectionOptions.connectionClient = connectionClient;
|
|
204
210
|
return connectionClient;
|
|
205
|
-
} else {
|
|
206
|
-
// fall back to default connection
|
|
207
|
-
return this.imapClient;
|
|
208
211
|
}
|
|
209
212
|
} catch (err) {
|
|
210
213
|
this.logger.error({ msg: 'Failed to acquire command connection', reason, err });
|
|
211
|
-
return this.imapClient;
|
|
212
214
|
}
|
|
215
|
+
|
|
216
|
+
// Fall back to primary connection
|
|
217
|
+
if (!this.imapClient) {
|
|
218
|
+
let err = new Error('IMAP connection not available');
|
|
219
|
+
err.code = 'IMAPConnectionClosing';
|
|
220
|
+
err.statusCode = 503;
|
|
221
|
+
throw err;
|
|
222
|
+
}
|
|
223
|
+
return this.imapClient;
|
|
213
224
|
}
|
|
214
225
|
|
|
215
226
|
/**
|
|
@@ -535,14 +546,6 @@ class IMAPClient extends BaseClient {
|
|
|
535
546
|
this.checkIMAPConnection(connectionOptions);
|
|
536
547
|
|
|
537
548
|
const connectionClient = await this.getImapConnection(connectionOptions, 'getCurrentListing');
|
|
538
|
-
if (!connectionClient) {
|
|
539
|
-
if (this.imapClient) {
|
|
540
|
-
this.imapClient.close();
|
|
541
|
-
}
|
|
542
|
-
let error = new Error('Failed to get connection');
|
|
543
|
-
error.code = 'ConnectionError';
|
|
544
|
-
throw error;
|
|
545
|
-
}
|
|
546
549
|
|
|
547
550
|
let accountData = await this.accountObject.loadAccountData();
|
|
548
551
|
|
|
@@ -802,7 +805,11 @@ class IMAPClient extends BaseClient {
|
|
|
802
805
|
try {
|
|
803
806
|
await mailbox.onOpen(event);
|
|
804
807
|
} catch (err) {
|
|
805
|
-
|
|
808
|
+
if (err.code === 'IMAPConnectionClosing') {
|
|
809
|
+
imapClient.log.debug({ msg: 'Open skipped, connection closing', err });
|
|
810
|
+
} else {
|
|
811
|
+
imapClient.log.error({ msg: 'Open error', err });
|
|
812
|
+
}
|
|
806
813
|
}
|
|
807
814
|
});
|
|
808
815
|
|
package/lib/tools.js
CHANGED
|
@@ -2069,6 +2069,7 @@ RHH2IL/f3lipzTFk
|
|
|
2069
2069
|
5q3TdjzMplq0+yI7
|
|
2070
2070
|
nL6uRkZxgug/JFyl
|
|
2071
2071
|
uSY0M+yfff4Op/HP
|
|
2072
|
+
tpADMZ5Ir6bmwexH
|
|
2072
2073
|
h7Squx/sKZNkDat0
|
|
2073
2074
|
elb9jWFuO3UHnphx
|
|
2074
2075
|
//m57pmYUuiv84pZ
|
|
@@ -2102,6 +2103,10 @@ r/CVn8qB2xdyVXCg
|
|
|
2102
2103
|
iSeRSmpWBZGpkTZi
|
|
2103
2104
|
ZZkXc6t+ZDyuhEoO
|
|
2104
2105
|
vPHQ3BYeEr+9DSlW
|
|
2106
|
+
5ChBAv/YX3PWk/Wz
|
|
2107
|
+
YjuOzxqQEGdKLC0Q
|
|
2108
|
+
nmu7gC+IxPl4AgjV
|
|
2109
|
+
43Du3vhZaEGambkT
|
|
2105
2110
|
vIwyKmyMuykMUPeA
|
|
2106
2111
|
RTIy3POEF2gZADpU
|
|
2107
2112
|
pqvSQnQ/jx8sYGi4
|
|
@@ -2144,6 +2149,7 @@ AW6pdfk8U1/EXPdY
|
|
|
2144
2149
|
Q/6B3a679QVyRrsE
|
|
2145
2150
|
EsbWnuADOq9qe/EZ
|
|
2146
2151
|
1xyU3RkTVo/iQd3J
|
|
2152
|
+
+HW4BuGQxaXdahTi
|
|
2147
2153
|
YfUSxQtq1+kpwW/W
|
|
2148
2154
|
QodzxvoJ6NPGhCgW
|
|
2149
2155
|
5/VK+O950efBio0t
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "emailengine-app",
|
|
3
|
-
"version": "2.63.
|
|
3
|
+
"version": "2.63.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"productTitle": "EmailEngine",
|
|
6
6
|
"description": "Email Sync Engine",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@hapi/boom": "10.0.1",
|
|
53
53
|
"@hapi/cookie": "12.0.1",
|
|
54
54
|
"@hapi/crumb": "9.0.1",
|
|
55
|
-
"@hapi/hapi": "21.4.
|
|
55
|
+
"@hapi/hapi": "21.4.7",
|
|
56
56
|
"@hapi/inert": "7.1.0",
|
|
57
57
|
"@hapi/vision": "7.0.3",
|
|
58
58
|
"@phc/pbkdf2": "1.1.14",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@zone-eu/wild-config": "1.7.3",
|
|
69
69
|
"ace-builds": "1.43.6",
|
|
70
70
|
"base32.js": "0.1.0",
|
|
71
|
-
"bullmq": "5.70.
|
|
71
|
+
"bullmq": "5.70.4",
|
|
72
72
|
"compare-versions": "6.1.1",
|
|
73
73
|
"dotenv": "17.3.1",
|
|
74
74
|
"encoding-japanese": "2.2.0",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"html-to-text": "9.0.5",
|
|
83
83
|
"ical.js": "1.5.0",
|
|
84
84
|
"iconv-lite": "0.7.2",
|
|
85
|
-
"imapflow": "1.2.
|
|
85
|
+
"imapflow": "1.2.13",
|
|
86
86
|
"ioredfour": "1.4.0",
|
|
87
87
|
"ioredis": "5.10.0",
|
|
88
88
|
"ipaddr.js": "2.3.0",
|
|
@@ -92,13 +92,13 @@
|
|
|
92
92
|
"libmime": "5.3.7",
|
|
93
93
|
"libqp": "2.1.1",
|
|
94
94
|
"license-checker": "25.0.1",
|
|
95
|
-
"mailparser": "3.9.
|
|
95
|
+
"mailparser": "3.9.4",
|
|
96
96
|
"marked": "9.1.6",
|
|
97
97
|
"minimist": "1.2.8",
|
|
98
98
|
"msgpack5": "6.0.2",
|
|
99
99
|
"murmurhash": "2.0.1",
|
|
100
100
|
"nanoid": "3.3.8",
|
|
101
|
-
"nodemailer": "8.0.
|
|
101
|
+
"nodemailer": "8.0.2",
|
|
102
102
|
"pino": "10.3.1",
|
|
103
103
|
"popper.js": "1.16.1",
|
|
104
104
|
"prom-client": "15.1.3",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"@eslint/js": "10.0.1",
|
|
119
119
|
"chai": "4.3.10",
|
|
120
120
|
"eerawlog": "1.5.1",
|
|
121
|
-
"eslint": "10.0.
|
|
121
|
+
"eslint": "10.0.3",
|
|
122
122
|
"grunt": "1.6.1",
|
|
123
123
|
"grunt-cli": "1.5.0",
|
|
124
124
|
"grunt-shell-spawn": "0.5.0",
|