emailengine-app 2.73.1 → 2.74.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.
@@ -22,20 +22,23 @@ const { REDIS_PREFIX } = require('../consts');
22
22
  const { oauth2ProviderData } = require('../oauth2-apps');
23
23
  const exampleDocumentsPayloads = require('../payload-examples-documents.json');
24
24
 
25
+ // Fallback model list, shown until the first successful "Refresh Models" call
26
+ // replaces it with the models actually available on the configured endpoint
27
+ // (stored in the openAiModels setting)
25
28
  const OPEN_AI_MODELS = [
26
29
  {
27
- name: 'GPT-3 (instruct)',
28
- id: 'gpt-3.5-turbo-instruct'
30
+ name: 'GPT-5 Mini',
31
+ id: 'gpt-5-mini'
29
32
  },
30
33
 
31
34
  {
32
- name: 'GPT-3 (chat)',
33
- id: 'gpt-3.5-turbo'
35
+ name: 'GPT-5',
36
+ id: 'gpt-5'
34
37
  },
35
38
 
36
39
  {
37
- name: 'GPT-4',
38
- id: 'gpt-4'
40
+ name: 'GPT-5 Nano',
41
+ id: 'gpt-5-nano'
39
42
  }
40
43
  ];
41
44
 
@@ -0,0 +1,54 @@
1
+ 'use strict';
2
+
3
+ // Serialization of an Error across a worker-thread RPC hop.
4
+ //
5
+ // submitMessage() runs in the IMAP worker and the error it throws reaches the submit worker through
6
+ // two postMessage relays (workers/imap.js -> server.js -> workers/submit.js). postMessage cannot
7
+ // clone an Error's own enumerable-but-non-standard properties reliably, so each hop copies an
8
+ // explicit field list onto a plain payload and rebuilds an Error on the far side. Any field not
9
+ // listed here is silently dropped in transit.
10
+ //
11
+ // `responseCode` (the numeric SMTP reply code) is on the list because lib/delivery-error.js needs it
12
+ // to tell a transient 4xx rejection (e.g. greylisting) from a permanent 5xx one. It used to be
13
+ // dropped, so the predicate's SMTP-reply branch never fired in production; keeping the field list in
14
+ // one place makes that dependency explicit and unit-testable (see test/worker-rpc-error-test.js).
15
+ //
16
+ // These helpers are used at the delivery-error RPC path - the imap/submit workers and the main-thread
17
+ // hub (server.js) that relays between them. The other workers (webhooks/export/documents/smtp/api)
18
+ // keep their own inline resp-handler copies: they never carry a delivery error, so `responseCode`
19
+ // does not apply to them. Route a delivery error through a new worker and it must switch to these too.
20
+ const RPC_ERROR_FIELDS = ['code', 'statusCode', 'responseCode', 'info'];
21
+
22
+ /**
23
+ * Serializes an Error into the plain payload sent over postMessage.
24
+ *
25
+ * @param {Error} err - Error to serialize
26
+ * @returns {Object} Payload with `error` (the message) plus every present RPC_ERROR_FIELD
27
+ */
28
+ function packRpcError(err) {
29
+ let payload = { error: err.message };
30
+ for (let field of RPC_ERROR_FIELDS) {
31
+ if (err[field] != null) {
32
+ payload[field] = err[field];
33
+ }
34
+ }
35
+ return payload;
36
+ }
37
+
38
+ /**
39
+ * Rebuilds an Error from a received postMessage payload.
40
+ *
41
+ * @param {Object} message - Payload produced by packRpcError (may carry extra fields, e.g. cmd/mid)
42
+ * @returns {Error} Error with its message and every present RPC_ERROR_FIELD restored
43
+ */
44
+ function unpackRpcError(message) {
45
+ let err = new Error(message.error);
46
+ for (let field of RPC_ERROR_FIELDS) {
47
+ if (message[field] != null) {
48
+ err[field] = message[field];
49
+ }
50
+ }
51
+ return err;
52
+ }
53
+
54
+ module.exports = { packRpcError, unpackRpcError };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emailengine-app",
3
- "version": "2.73.1",
3
+ "version": "2.74.1",
4
4
  "private": false,
5
5
  "productTitle": "EmailEngine",
6
6
  "description": "Email Sync Engine",
@@ -14,6 +14,7 @@
14
14
  "test": "NODE_ENV=test grunt",
15
15
  "test:unit": "NODE_ENV=test grunt test-unit",
16
16
  "test:integration": "NODE_ENV=test grunt test-integration",
17
+ "test:dovecot": "./test/dovecot/run-dovecot-tests.sh",
17
18
  "test:e2e": "playwright test",
18
19
  "test:e2e:install": "playwright install --with-deps chromium",
19
20
  "lint": "npx eslint 'lib/**/*.js' 'workers/**/*.js' 'test/**/*.js' server.js Gruntfile.js",
@@ -48,22 +49,22 @@
48
49
  },
49
50
  "homepage": "https://emailengine.app/",
50
51
  "dependencies": {
51
- "@bull-board/api": "8.1.2",
52
- "@bull-board/hapi": "8.1.2",
52
+ "@bull-board/api": "8.3.0",
53
+ "@bull-board/hapi": "8.3.0",
53
54
  "@elastic/elasticsearch": "8.15.3",
54
55
  "@hapi/accept": "6.0.3",
55
56
  "@hapi/bell": "13.1.0",
56
57
  "@hapi/boom": "10.0.1",
57
58
  "@hapi/cookie": "12.0.1",
58
59
  "@hapi/crumb": "9.0.1",
59
- "@hapi/hapi": "21.4.9",
60
+ "@hapi/hapi": "21.4.10",
60
61
  "@hapi/inert": "7.1.2",
61
62
  "@hapi/vision": "7.0.3",
62
63
  "@phc/pbkdf2": "1.1.14",
63
64
  "@postalsys/bounce-classifier": "3.0.0",
64
65
  "@postalsys/certs": "1.0.16",
65
66
  "@postalsys/ee-client": "1.5.0",
66
- "@postalsys/email-ai-tools": "1.13.13",
67
+ "@postalsys/email-ai-tools": "1.13.14",
67
68
  "@postalsys/email-text-tools": "2.4.11",
68
69
  "@postalsys/gettext": "4.1.1",
69
70
  "@postalsys/joi-messages": "1.0.5",
@@ -75,7 +76,7 @@
75
76
  "@zone-eu/wild-config": "1.7.6",
76
77
  "ace-builds": "1.44.0",
77
78
  "base32.js": "0.1.0",
78
- "bullmq": "5.80.9",
79
+ "bullmq": "5.81.0",
79
80
  "compare-versions": "6.1.1",
80
81
  "dotenv": "17.4.2",
81
82
  "encoding-japanese": "2.2.0",
@@ -89,7 +90,7 @@
89
90
  "html-to-text": "10.0.0",
90
91
  "ical.js": "1.5.0",
91
92
  "iconv-lite": "0.7.3",
92
- "imapflow": "1.4.7",
93
+ "imapflow": "1.5.0",
93
94
  "ioredfour": "1.4.2",
94
95
  "ioredis": "5.11.1",
95
96
  "ipaddr.js": "2.4.0",
@@ -133,7 +134,7 @@
133
134
  "grunt-cli": "1.5.0",
134
135
  "grunt-shell-spawn": "0.5.0",
135
136
  "pino-pretty": "13.1.3",
136
- "prettier": "3.9.5",
137
+ "prettier": "3.9.6",
137
138
  "resedit": "3.0.2",
138
139
  "spdx-satisfies": "6.0.0",
139
140
  "supertest": "7.2.2",