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/lib/export.js CHANGED
@@ -10,6 +10,7 @@ const settings = require('./settings');
10
10
  const logger = require('./logger');
11
11
  const getSecret = require('./get-secret');
12
12
  const { escapeRedisGlob } = require('./tools');
13
+ const { ImapFlowErrorCode } = require('imapflow');
13
14
 
14
15
  const {
15
16
  REDIS_PREFIX,
@@ -132,7 +133,9 @@ function isTransientError(err) {
132
133
  if (['ETIMEDOUT', 'ECONNRESET', 'ENOTFOUND', 'EAI_AGAIN', 'ECONNREFUSED', 'EPIPE', 'EHOSTUNREACH'].includes(err.code)) {
133
134
  return true;
134
135
  }
135
- if (err.statusCode >= 500 && err.statusCode < 600) {
136
+ // 429: a throttled Gmail or Graph request, or an IMAP server throttling every FETCH retry
137
+ // (the IMAP worker reports ImapFlow's ETHROTTLE as 429)
138
+ if (err.statusCode === 429 || (err.statusCode >= 500 && err.statusCode < 600)) {
136
139
  return true;
137
140
  }
138
141
  if (err.code === 'Timeout' || err.message?.includes('timeout')) {
@@ -144,10 +147,16 @@ function isTransientError(err) {
144
147
  // Account.assertMessageFound reports a missing message as a Boom 404 that carries the
145
148
  // machine-readable code and status only in err.output, while client/RPC errors set plain
146
149
  // err.code/err.statusCode - check both shapes
150
+ // DownloadIncomplete is ImapFlow reporting that the message disappeared while it was being read
147
151
  function isSkippableError(err) {
148
152
  let errCode = err.output?.payload?.code || err.code;
149
153
  let statusCode = err.statusCode || err.output?.statusCode;
150
- return errCode === 'MessageNotFound' || statusCode === 404 || err.message?.includes('Failed to generate message ID');
154
+ return (
155
+ errCode === 'MessageNotFound' ||
156
+ errCode === ImapFlowErrorCode.DownloadIncomplete ||
157
+ statusCode === 404 ||
158
+ err.message?.includes('Failed to generate message ID')
159
+ );
151
160
  }
152
161
 
153
162
  // Account.listMessages reports unknown folders as FolderNotFound (Boom error with the code in
package/lib/msgpack.js CHANGED
@@ -54,9 +54,4 @@ function decode(buf) {
54
54
  throw new Error('Unable to decode msgpack value');
55
55
  }
56
56
 
57
- // Decodes a byte stream of concatenated msgpack values (append-list hash fields)
58
- function decodeMulti(buf) {
59
- return Array.from(decoder.decodeMulti(buf), bufferize);
60
- }
61
-
62
- module.exports = { encode, decode, decodeMulti };
57
+ module.exports = { encode, decode };
package/lib/schemas.js CHANGED
@@ -1115,22 +1115,6 @@ const messageCategorySchema = Joi.string()
1115
1115
  .meta({ enumDescriptions: ENUM_DESCRIPTIONS.messageCategory })
1116
1116
  .label('MessageCategory');
1117
1117
 
1118
- const bounceListSchema = Joi.array()
1119
- .items(
1120
- Joi.object({
1121
- message: Joi.string().max(256).required().example('AAAAAQAACnA').description('EmailEngine identifier of the bounce notification'),
1122
- recipient: Joi.string().email().example('recipient@example.com').description('Email address that bounced'),
1123
- action: Joi.string().example('failed').description('Bounce action (failed, delayed, etc.)').label('BounceAction'),
1124
- response: Joi.object({
1125
- message: Joi.string().example('550 5.1.1 No such user').description('Error message from the receiving server'),
1126
- status: Joi.string().example('5.1.1').description('SMTP status code')
1127
- }).label('BounceResponse'),
1128
- date: Joi.date().iso().example('2021-03-22T13:13:31.000Z').description('When the bounce was detected')
1129
- }).label('BounceEntry')
1130
- )
1131
- .description('Bounce notifications detected for this message (IMAP accounts only)')
1132
- .label('BounceList');
1133
-
1134
1118
  const messageEntrySchema = Joi.object({
1135
1119
  id: Joi.string().example('AAAAAgAACrI').description('EmailEngine message identifier').label('MessageEntryId'),
1136
1120
  uid: Joi.number().integer().example(12345).description('IMAP UID (unique identifier within the mailbox). IMAP accounts only').label('MessageUid'),
@@ -1175,8 +1159,7 @@ const messageEntrySchema = Joi.object({
1175
1159
 
1176
1160
  category: messageCategorySchema,
1177
1161
  messageSpecialUse: messageSpecialUseSchema,
1178
- isAutoReply: Joi.boolean().example(false).description('Whether this message appears to be an automatic reply (out of office, vacation responder, etc.)'),
1179
- bounces: bounceListSchema
1162
+ isAutoReply: Joi.boolean().example(false).description('Whether this message appears to be an automatic reply (out of office, vacation responder, etc.)')
1180
1163
  }).label('MessageListEntry');
1181
1164
 
1182
1165
  const messageDetailsSchema = Joi.object({
@@ -1239,9 +1222,13 @@ const messageDetailsSchema = Joi.object({
1239
1222
  )
1240
1223
  }).label('TextInfoDetails'),
1241
1224
 
1242
- bounces: bounceListSchema,
1243
-
1244
1225
  isAutoReply: Joi.boolean().example(false).description('Whether this message appears to be an automatic reply (out of office, vacation responder, etc.)'),
1226
+ isBounce: Joi.boolean()
1227
+ .example(false)
1228
+ .description(
1229
+ 'Whether this message is a bounce (a delivery failure report). Checked for messages in the Inbox only; a delivery or delay notification is not one'
1230
+ ),
1231
+ relatedMessageId: Joi.string().example('<original@example.com>').description('Message-ID of the message that bounced. Set together with isBounce'),
1245
1232
 
1246
1233
  preview: Joi.string()
1247
1234
  .example('Hello, here is the report you asked for')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emailengine-app",
3
- "version": "2.81.0",
3
+ "version": "2.81.2",
4
4
  "private": false,
5
5
  "productTitle": "EmailEngine",
6
6
  "description": "Email Sync Engine",
@@ -65,24 +65,24 @@
65
65
  "@msgpack/msgpack": "3.1.3",
66
66
  "@phc/pbkdf2": "1.1.14",
67
67
  "@postalsys/bounce-classifier": "3.0.0",
68
- "@postalsys/certs": "1.4.2",
68
+ "@postalsys/certs": "1.4.3",
69
69
  "@postalsys/ee-client": "1.8.0",
70
- "@postalsys/email-ai-tools": "1.14.6",
71
- "@postalsys/email-content": "0.1.5",
70
+ "@postalsys/email-ai-tools": "1.14.10",
71
+ "@postalsys/email-content": "0.1.7",
72
72
  "@postalsys/email-text-tools": "2.4.16",
73
73
  "@postalsys/gettext": "4.1.1",
74
74
  "@postalsys/joi-messages": "1.3.0",
75
75
  "@postalsys/templates": "2.0.2",
76
- "@sentry/node": "10.74.0",
76
+ "@sentry/node": "10.75.3",
77
77
  "@simplewebauthn/browser": "14.0.0",
78
- "@simplewebauthn/server": "14.0.2",
79
- "@zone-eu/mailsplit": "5.4.16",
78
+ "@simplewebauthn/server": "14.0.3",
79
+ "@zone-eu/mailsplit": "5.4.17",
80
80
  "@zone-eu/wild-config": "1.7.6",
81
81
  "ace-builds": "1.44.0",
82
- "bullmq": "6.3.4",
82
+ "bullmq": "6.3.9",
83
83
  "compare-versions": "6.1.1",
84
- "dotenv": "17.4.2",
85
- "encoding-japanese": "2.3.0",
84
+ "dotenv": "18.0.4",
85
+ "encoding-japanese": "2.4.0",
86
86
  "exponential-backoff": "3.1.3",
87
87
  "fast-xml-parser": "5.11.1",
88
88
  "gettext-parser": "7.0.1",
@@ -93,34 +93,34 @@
93
93
  "html-to-text": "10.0.1",
94
94
  "ical.js": "1.5.0",
95
95
  "iconv-lite": "0.7.3",
96
- "imapflow": "2.0.2",
96
+ "imapflow": "2.1.0",
97
97
  "ioredfour": "1.4.3",
98
98
  "ioredis": "6.0.0",
99
99
  "ipaddr.js": "2.5.0",
100
100
  "joi": "18.2.9",
101
101
  "libbase64": "1.3.0",
102
- "libmime": "5.4.3",
102
+ "libmime": "5.4.4",
103
103
  "libqp": "2.1.1",
104
- "mailparser": "3.9.26",
104
+ "mailparser": "3.9.29",
105
105
  "marked": "15.0.12",
106
106
  "minimist": "1.2.8",
107
107
  "murmurhash": "2.0.1",
108
108
  "nanoid": "3.3.19",
109
- "nodemailer": "10.0.9",
109
+ "nodemailer": "10.0.11",
110
110
  "pino": "10.3.1",
111
111
  "prom-client": "15.1.3",
112
112
  "psl": "1.15.0",
113
- "pubface": "1.1.15",
113
+ "pubface": "1.1.17",
114
114
  "punycode.js": "2.3.1",
115
115
  "qrcode": "1.5.4",
116
- "smtp-server": "3.19.12",
116
+ "smtp-server": "3.19.14",
117
117
  "socks": "2.8.10",
118
118
  "timezones-list": "3.1.0",
119
- "undici": "7.29.1"
119
+ "undici": "7.30.0"
120
120
  },
121
121
  "devDependencies": {
122
122
  "@eslint/js": "10.0.1",
123
- "@iconify-json/tabler": "1.2.38",
123
+ "@iconify-json/tabler": "1.2.40",
124
124
  "@iconify/tailwind4": "1.2.3",
125
125
  "@playwright/test": "1.63.0",
126
126
  "@tailwindcss/cli": "4.3.3",
@@ -128,13 +128,13 @@
128
128
  "acorn-walk": "8.3.5",
129
129
  "chai": "4.5.0",
130
130
  "eerawlog": "1.5.5",
131
- "eslint": "10.10.0",
131
+ "eslint": "10.11.0",
132
132
  "flyonui": "2.4.1",
133
133
  "pino-pretty": "13.1.3",
134
- "prettier": "3.9.6",
134
+ "prettier": "3.9.9",
135
135
  "resedit": "3.1.0",
136
136
  "spdx-satisfies": "6.0.0",
137
- "supertest": "7.2.2",
137
+ "supertest": "7.3.0",
138
138
  "tailwindcss": "4.3.3",
139
139
  "xgettext-template": "5.0.0"
140
140
  },