emailengine-app 2.74.0 → 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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.74.1](https://github.com/postalsys/emailengine/compare/v2.74.0...v2.74.1) (2026-07-24)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **deps:** update dependencies (@postalsys/email-ai-tools 1.13.14) ([027f065](https://github.com/postalsys/emailengine/commit/027f0654a1a5d844dd02a22d1f594927e4c4e258))
9
+ * **ui:** document Azure OpenAI endpoints and refresh the fallback AI model list ([defef18](https://github.com/postalsys/emailengine/commit/defef1832165069d6657ebdd9a6f0c261631105a))
10
+ * **ui:** group the workers page by kind with pool health and descriptions ([8ae65a9](https://github.com/postalsys/emailengine/commit/8ae65a9e5942c2b24b76b2e815d56725567a3d59))
11
+ * **ui:** show the workers page Accounts column only for email workers ([d0fb2ef](https://github.com/postalsys/emailengine/commit/d0fb2efbb7fccb64469f2333e88d2a6768104bdf))
12
+ * **ui:** warn that Document Store will be removed on 2026-10-01 ([1415af6](https://github.com/postalsys/emailengine/commit/1415af687e24d86846482c292065916c24a9dfae))
13
+
3
14
  ## [2.74.0](https://github.com/postalsys/emailengine/compare/v2.73.1...v2.74.0) (2026-07-23)
4
15
 
5
16
 
package/lib/schemas.js CHANGED
@@ -170,13 +170,15 @@ const settingsSchema = {
170
170
  .meta({ swaggerHidden: true }),
171
171
 
172
172
  openAiAPIKey: Joi.string().allow('').example('sk-…').description('Your OpenAI API key for AI features').label('OpenAiAPIKey'),
173
- openAiModel: Joi.string().allow('').example('gpt-3.5-turbo').description('OpenAI model to use for text generation').label('OpenAiModel'),
173
+ openAiModel: Joi.string().allow('').example('gpt-5-mini').description('OpenAI model to use for text generation').label('OpenAiModel'),
174
174
 
175
175
  openAiAPIUrl: Joi.string()
176
176
  .uri({ scheme: ['http', 'https'], allowRelative: false })
177
177
  .allow('')
178
178
  .example('https://api.openai.com')
179
- .description('Base URL for OpenAI API (change for OpenAI-compatible services)')
179
+ .description(
180
+ 'Base URL for the OpenAI API. Set for OpenAI-compatible services, including any URL path the service mounts the API under - for Azure OpenAI, use https://<your-resource>.openai.azure.com/openai/v1'
181
+ )
180
182
  .label('OpenAiAPIUrl'),
181
183
 
182
184
  documentStoreChatModel: Joi.string()
@@ -13,6 +13,26 @@ const { redis } = require('../db');
13
13
  const { DEFAULT_PAGE_SIZE } = require('../consts');
14
14
  const { formatAccountData } = require('./route-helpers');
15
15
 
16
+ // Worker kinds in the order they are shown on the internals page (known kinds first; any
17
+ // unrecognized kind is appended so nothing is dropped).
18
+ const THREAD_TYPE_ORDER = ['main', 'api', 'imap', 'webhooks', 'submit', 'export', 'smtp', 'imapProxy', 'documents'];
19
+
20
+ // Severity ranking for the per-group health roll-up (higher wins).
21
+ const STATUS_RANK = { success: 0, neutral: 1, warning: 2, error: 3 };
22
+
23
+ // Short description of what each worker kind does, shown on the group card header.
24
+ const THREAD_PURPOSE = {
25
+ main: 'Orchestrates everything else: spawns and monitors the other worker threads, assigns email accounts to the sync workers, routes inter-thread calls, and manages the Redis connection and licensing.',
26
+ api: 'Serves the REST API and the admin web interface (including this page), the OpenAPI documentation, and real-time account updates.',
27
+ imap: 'Keeps email accounts in sync - IMAP, Gmail API and Outlook/Graph - maintaining connections, detecting new and changed messages in real time, and running message and mailbox operations.',
28
+ webhooks: 'Delivers webhook notifications for email and account events over HTTP, with automatic retries and optional per-route filtering and transforms.',
29
+ submit: 'Sends queued outbound email through SMTP or a provider API (Gmail, Outlook), with retries and delivery, bounce and complaint tracking.',
30
+ export: 'Runs bulk account export jobs, extracting matching messages into compressed files for download.',
31
+ documents: 'Indexes emails into the Document Store (ElasticSearch) for search and processing. This is a deprecated feature.',
32
+ smtp: 'Accepts SMTP submissions from legacy applications and queues them for delivery through the associated account.',
33
+ imapProxy: 'Lets standard IMAP clients reach EmailEngine-managed accounts, hiding the OAuth2 complexity of providers like Gmail and Microsoft 365.'
34
+ };
35
+
16
36
  function init(args) {
17
37
  const { server, call } = args;
18
38
 
@@ -47,6 +67,120 @@ function init(args) {
47
67
  bytesFormatter = new Intl.NumberFormat('en-US', bytesFormatterOpts);
48
68
  }
49
69
 
70
+ // Process each thread into row data. The per-thread config (expected worker
71
+ // count) is intentionally NOT surfaced per row here - it is a pool-level fact
72
+ // and is shown once on the group header below.
73
+ let processedThreads = threads.map(threadInfo => {
74
+ // Unresponsive / errored worker: the resource-usage probe failed or timed out.
75
+ if (threadInfo.resourceUsageError) {
76
+ threadInfo.isUnresponsive = true;
77
+ threadInfo.errorMessage = threadInfo.resourceUsageError.error;
78
+ }
79
+
80
+ // CPU metrics removed to prevent potential native code issues
81
+
82
+ // Single health signal (variant + label) used by both the per-row status dot
83
+ // and the per-group roll-up badge.
84
+ threadInfo.statusVariant = 'success';
85
+ threadInfo.statusLabel = 'Healthy';
86
+ if (threadInfo.isUnresponsive) {
87
+ threadInfo.statusVariant = 'error';
88
+ threadInfo.statusLabel = 'Unresponsive';
89
+ } else {
90
+ switch (threadInfo.healthStatus) {
91
+ case 'critical':
92
+ case 'restarting':
93
+ threadInfo.statusVariant = 'error';
94
+ threadInfo.statusLabel = 'Critical';
95
+ break;
96
+ case 'unhealthy':
97
+ threadInfo.statusVariant = 'warning';
98
+ threadInfo.statusLabel = 'Unhealthy';
99
+ break;
100
+ case 'unknown':
101
+ threadInfo.statusVariant = 'neutral';
102
+ threadInfo.statusLabel = 'Unknown';
103
+ break;
104
+ // 'healthy' or undefined -> success / Healthy
105
+ }
106
+ }
107
+
108
+ if (threadInfo.online) {
109
+ threadInfo.timeStr = new Date(threadInfo.online).toISOString();
110
+ }
111
+
112
+ // Format the heap reading for responsive threads. Unresponsive ones have no
113
+ // reading, so the Memory cell shows a dash and the Status column carries the
114
+ // state (heapTotal/rss/external are available but deliberately not displayed).
115
+ if (!threadInfo.isUnresponsive && typeof threadInfo.heapUsed === 'number') {
116
+ threadInfo.heapUsed = bytesFormatter.format(threadInfo.heapUsed).replace(/BB$/, 'GB');
117
+ }
118
+
119
+ // Email (sync) workers own account assignment, but the count field is absent
120
+ // when a worker currently syncs none - show an explicit 0 instead of a blank.
121
+ if (threadInfo.type === 'imap' && typeof threadInfo.accounts !== 'number') {
122
+ threadInfo.accounts = 0;
123
+ }
124
+
125
+ return threadInfo;
126
+ });
127
+
128
+ // Group threads by worker kind so the pool-level facts (expected vs actual count,
129
+ // config env var, health roll-up) live on the group header instead of being
130
+ // repeated on every member row.
131
+ let groupMap = new Map();
132
+ for (let threadInfo of processedThreads) {
133
+ if (!groupMap.has(threadInfo.type)) {
134
+ groupMap.set(threadInfo.type, []);
135
+ }
136
+ groupMap.get(threadInfo.type).push(threadInfo);
137
+ }
138
+
139
+ let orderedTypes = THREAD_TYPE_ORDER.filter(type => groupMap.has(type)).concat(
140
+ [...groupMap.keys()].filter(type => !THREAD_TYPE_ORDER.includes(type))
141
+ );
142
+
143
+ let groups = orderedTypes.map(type => {
144
+ let list = groupMap.get(type);
145
+ let cfg = list[0].config; // { key, value } expected-count config, or undefined
146
+ let expected = cfg && cfg.value != null ? Number(cfg.value) : null;
147
+ let hasExpected = expected !== null && !isNaN(expected);
148
+ let actual = list.length;
149
+
150
+ // Fleet completeness: green when the running count matches the configured
151
+ // count, red when a worker is missing (crashed and not restarted), amber when
152
+ // there are more running than configured.
153
+ let countVariant = 'neutral';
154
+ if (hasExpected) {
155
+ countVariant = actual < expected ? 'error' : actual > expected ? 'warning' : 'success';
156
+ }
157
+
158
+ // Health roll-up = worst member status.
159
+ let rollup = list.reduce(
160
+ (worst, threadInfo) =>
161
+ STATUS_RANK[threadInfo.statusVariant] > STATUS_RANK[worst.variant]
162
+ ? { variant: threadInfo.statusVariant, label: threadInfo.statusLabel }
163
+ : worst,
164
+ { variant: 'success', label: 'Healthy' }
165
+ );
166
+
167
+ return {
168
+ type,
169
+ description: list[0].description || type,
170
+ purpose: THREAD_PURPOSE[type] || null,
171
+ threads: list,
172
+ // Only the sync (email) workers are assigned accounts, so the Accounts
173
+ // column is shown only for that pool.
174
+ showAccounts: type === 'imap',
175
+ hasExpected,
176
+ countLabel: hasExpected ? `${actual} / ${expected} running` : `${actual} running`,
177
+ countVariant,
178
+ configRef: hasExpected ? `${cfg.key}=${expected}` : null,
179
+ healthVariant: rollup.variant,
180
+ healthLabel: rollup.label
181
+ };
182
+ });
183
+
50
184
  return h.view(
51
185
  'internals/index',
52
186
  {
@@ -57,73 +191,7 @@ function init(args) {
57
191
 
58
192
  apiWorkerWarning: apiWorkerScaling && apiWorkerScaling.fallback ? apiWorkerScaling : false,
59
193
 
60
- threads: threads.map(threadInfo => {
61
- // Check if this worker is unresponsive
62
- if (threadInfo.resourceUsageError) {
63
- threadInfo.isUnresponsive = true;
64
- threadInfo.heapUsed = threadInfo.resourceUsageError.unresponsive ? 'UNRESPONSIVE' : 'ERROR';
65
- threadInfo.errorMessage = threadInfo.resourceUsageError.error;
66
- }
67
-
68
- // CPU metrics removed to prevent potential native code issues
69
-
70
- // Process health status
71
- if (threadInfo.healthStatus) {
72
- switch (threadInfo.healthStatus) {
73
- case 'unhealthy':
74
- threadInfo.healthBadge = 'Unhealthy';
75
- threadInfo.healthBadgeType = 'warning';
76
- break;
77
- case 'critical':
78
- case 'restarting':
79
- threadInfo.healthBadge = 'Critical';
80
- threadInfo.healthBadgeType = 'error';
81
- break;
82
- case 'unknown':
83
- threadInfo.healthBadge = 'Unknown';
84
- threadInfo.healthBadgeType = 'neutral';
85
- break;
86
- // healthy - no badge shown to avoid clutter
87
- }
88
- }
89
-
90
- for (let key of Object.keys(threadInfo)) {
91
- switch (key) {
92
- case 'online':
93
- threadInfo.timeStr = new Date(threadInfo.online).toISOString();
94
- break;
95
-
96
- /*
97
- // managed by the template helper
98
- case 'messages':
99
- case 'called':
100
- case 'accounts':
101
- case 'threadId':
102
- threadInfo[key] = threadInfo[key];
103
- break;
104
- */
105
-
106
- case 'heapUsed':
107
- if (!threadInfo.isUnresponsive) {
108
- threadInfo.heapUsed = bytesFormatter.format(threadInfo[key]).replace(/BB$/, 'GB');
109
- }
110
- break;
111
-
112
- case 'heapTotal':
113
- // Not displayed anymore to avoid confusion with heap limit
114
- break;
115
-
116
- // Handle other memory metrics from new format
117
- case 'rss':
118
- case 'external':
119
- case 'arrayBuffers':
120
- // These are available but not displayed in the current UI
121
- break;
122
- }
123
- }
124
-
125
- return threadInfo;
126
- })
194
+ groups
127
195
  },
128
196
  {
129
197
  layout: 'app'
@@ -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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emailengine-app",
3
- "version": "2.74.0",
3
+ "version": "2.74.1",
4
4
  "private": false,
5
5
  "productTitle": "EmailEngine",
6
6
  "description": "Email Sync Engine",
@@ -49,8 +49,8 @@
49
49
  },
50
50
  "homepage": "https://emailengine.app/",
51
51
  "dependencies": {
52
- "@bull-board/api": "8.1.2",
53
- "@bull-board/hapi": "8.1.2",
52
+ "@bull-board/api": "8.3.0",
53
+ "@bull-board/hapi": "8.3.0",
54
54
  "@elastic/elasticsearch": "8.15.3",
55
55
  "@hapi/accept": "6.0.3",
56
56
  "@hapi/bell": "13.1.0",
@@ -64,7 +64,7 @@
64
64
  "@postalsys/bounce-classifier": "3.0.0",
65
65
  "@postalsys/certs": "1.0.16",
66
66
  "@postalsys/ee-client": "1.5.0",
67
- "@postalsys/email-ai-tools": "1.13.13",
67
+ "@postalsys/email-ai-tools": "1.13.14",
68
68
  "@postalsys/email-text-tools": "2.4.11",
69
69
  "@postalsys/gettext": "4.1.1",
70
70
  "@postalsys/joi-messages": "1.0.5",
@@ -76,7 +76,7 @@
76
76
  "@zone-eu/wild-config": "1.7.6",
77
77
  "ace-builds": "1.44.0",
78
78
  "base32.js": "0.1.0",
79
- "bullmq": "5.80.11",
79
+ "bullmq": "5.81.0",
80
80
  "compare-versions": "6.1.1",
81
81
  "dotenv": "17.4.2",
82
82
  "encoding-japanese": "2.2.0",