emailengine-app 2.88.0 → 2.90.0

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.
Files changed (79) hide show
  1. package/.ncurc.js +36 -45
  2. package/.release-please-manifest.json +1 -1
  3. package/CHANGELOG.md +58 -0
  4. package/Dockerfile +5 -1
  5. package/bin/healthcheck.js +1 -1
  6. package/copy-static-files.sh +0 -8
  7. package/data/google-crawlers.json +1 -1
  8. package/encrypt.js +1 -4
  9. package/lib/account/field-codec.js +396 -0
  10. package/lib/account.js +158 -453
  11. package/lib/api-routes/account-routes.js +42 -6
  12. package/lib/api-routes/route-metadata.js +5 -2
  13. package/lib/api-routes/submit-routes.js +15 -2
  14. package/lib/api-token-auth.js +342 -274
  15. package/lib/arf-detect.js +174 -149
  16. package/lib/attachment-size.js +29 -0
  17. package/lib/autodetect-imap-settings.js +83 -234
  18. package/lib/consts.js +1 -5
  19. package/lib/db.js +1 -4
  20. package/lib/email-client/base-client.js +907 -780
  21. package/lib/email-client/gmail-client.js +557 -450
  22. package/lib/email-client/imap/cid-parts.js +61 -0
  23. package/lib/email-client/imap/mailbox.js +376 -422
  24. package/lib/email-client/imap/sync-operations.js +239 -178
  25. package/lib/email-client/new-message-steps.js +168 -2
  26. package/lib/email-client/outlook/graph-message.js +266 -0
  27. package/lib/email-client/outlook/subscription-expiry.js +30 -0
  28. package/lib/email-client/outlook-client.js +652 -808
  29. package/lib/get-raw-email.js +338 -232
  30. package/lib/get-secret.js +1 -4
  31. package/lib/license-subscription.js +77 -11
  32. package/lib/load-env.js +48 -0
  33. package/lib/logger.js +1 -4
  34. package/lib/mcp/tools.js +244 -207
  35. package/lib/metric-values.js +76 -0
  36. package/lib/metrics.js +320 -0
  37. package/lib/node-version.js +99 -12
  38. package/lib/oauth/gmail.js +39 -120
  39. package/lib/oauth/http-request.js +195 -0
  40. package/lib/oauth/mail-ru.js +24 -58
  41. package/lib/oauth/outlook.js +37 -137
  42. package/lib/oauth/pubsub/google.js +176 -117
  43. package/lib/oauth2-apps.js +440 -463
  44. package/lib/openapi/build-document.js +10 -10
  45. package/lib/read-env-value.js +1 -1
  46. package/lib/route-descriptors.js +78 -0
  47. package/lib/schemas.js +10 -1
  48. package/lib/sentry-integrations.js +299 -0
  49. package/lib/sentry.js +75 -27
  50. package/lib/settings.js +4 -1
  51. package/lib/sso-routes.js +249 -0
  52. package/lib/sso.js +29 -6
  53. package/lib/tools.js +5 -4
  54. package/lib/ui-routes/account-edit-form.js +198 -0
  55. package/lib/ui-routes/account-page.js +241 -0
  56. package/lib/ui-routes/account-routes.js +12 -318
  57. package/lib/ui-routes/auth-routes.js +10 -10
  58. package/lib/ui-routes/dashboard-routes.js +4 -0
  59. package/lib/ui-view-context.js +328 -0
  60. package/lib/utils/public-suffix.js +22 -101
  61. package/lib/web-safe-html.js +70 -13
  62. package/lib/worker-metrics.js +82 -0
  63. package/list-generate.js +57 -23
  64. package/package.json +34 -33
  65. package/sbom.json +380 -1612
  66. package/scripts/refresh-test-tokens.js +1 -1
  67. package/server.js +351 -707
  68. package/static/css/flyonui.css +1 -1
  69. package/static/css/src/app.tailwind.css +18 -0
  70. package/static/js/ee-client.js +2619 -645
  71. package/static/js/ui.js +12 -2
  72. package/static/licenses.html +1055 -969
  73. package/translations/messages.pot +71 -60
  74. package/views/accounts/browse.hbs +19 -1
  75. package/views/dashboard.hbs +9 -0
  76. package/views/upgrade.hbs +25 -0
  77. package/workers/api.js +20 -451
  78. package/data/public_suffix_list.dat +0 -16597
  79. package/lib/net-tos-guard.js +0 -42
@@ -349,8 +349,20 @@ function registerCreateAccount(server, args) {
349
349
 
350
350
  webhooksCustomHeaders: settingsSchema.webhooksCustomHeaders.label('AccountWebhooksCustomHeaders'),
351
351
 
352
- locale: Joi.string().empty('').max(100).example('fr').description('Optional locale'),
353
- tz: Joi.string().empty('').max(100).example('Europe/Tallinn').description('Optional timezone')
352
+ locale: Joi.string()
353
+ .empty('')
354
+ .max(100)
355
+ .example('fr')
356
+ .description(
357
+ 'Language of the text EmailEngine adds to messages sent from this account, such as the "On ... wrote:" line of an inline reply. A language tag like "sv"; a submit request can override it with its own `locale`'
358
+ ),
359
+ tz: Joi.string()
360
+ .empty('')
361
+ .max(100)
362
+ .example('Europe/Tallinn')
363
+ .description(
364
+ 'Time zone of the dates EmailEngine writes into messages sent from this account. A submit request can override it with its own `tz`'
365
+ )
354
366
  })
355
367
  .label('CreateAccount')
356
368
  .example({
@@ -534,8 +546,20 @@ function registerUpdateAccount(server, args) {
534
546
 
535
547
  webhooksCustomHeaders: settingsSchema.webhooksCustomHeaders.label('AccountWebhooksCustomHeaders'),
536
548
 
537
- locale: Joi.string().empty('').max(100).example('fr').description('Optional locale'),
538
- tz: Joi.string().empty('').max(100).example('Europe/Tallinn').description('Optional timezone')
549
+ locale: Joi.string()
550
+ .empty('')
551
+ .max(100)
552
+ .example('fr')
553
+ .description(
554
+ 'Language of the text EmailEngine adds to messages sent from this account, such as the "On ... wrote:" line of an inline reply. A language tag like "sv"; a submit request can override it with its own `locale`'
555
+ ),
556
+ tz: Joi.string()
557
+ .empty('')
558
+ .max(100)
559
+ .example('Europe/Tallinn')
560
+ .description(
561
+ 'Time zone of the dates EmailEngine writes into messages sent from this account. A submit request can override it with its own `tz`'
562
+ )
539
563
  })
540
564
  .label('UpdateAccount')
541
565
  .example({
@@ -1499,8 +1523,20 @@ function registerGetAccount(server, args) {
1499
1523
 
1500
1524
  webhooksCustomHeaders: settingsSchema.webhooksCustomHeaders.label('AccountWebhooksCustomHeaders'),
1501
1525
 
1502
- locale: Joi.string().empty('').max(100).example('fr').description('Optional locale'),
1503
- tz: Joi.string().empty('').max(100).example('Europe/Tallinn').description('Optional timezone'),
1526
+ locale: Joi.string()
1527
+ .empty('')
1528
+ .max(100)
1529
+ .example('fr')
1530
+ .description(
1531
+ 'Language of the text EmailEngine adds to messages sent from this account, such as the "On ... wrote:" line of an inline reply. A language tag like "sv"; a submit request can override it with its own `locale`'
1532
+ ),
1533
+ tz: Joi.string()
1534
+ .empty('')
1535
+ .max(100)
1536
+ .example('Europe/Tallinn')
1537
+ .description(
1538
+ 'Time zone of the dates EmailEngine writes into messages sent from this account. A submit request can override it with its own `tz`'
1539
+ ),
1504
1540
 
1505
1541
  type: AccountTypeSchema,
1506
1542
  app: Joi.string().max(256).example('AAABhaBPHscAAAAH').description('OAuth2 application ID'),
@@ -13,6 +13,8 @@
13
13
  // It sits under lib/api-routes/ rather than lib/openapi/ so the dependency runs one way. The
14
14
  // generator reads route metadata; route modules do not read the generator.
15
15
 
16
+ const { routePlugins } = require('../route-descriptors');
17
+
16
18
  const PLUGIN_OPTIONS_KEY = 'openapi';
17
19
 
18
20
  // The shared no-metadata answer. This accessor runs in the api-token strategy on every API
@@ -24,12 +26,13 @@ const NO_OPTIONS = Object.freeze({});
24
26
  /**
25
27
  * The documentation and permission metadata a route declares.
26
28
  *
27
- * @param {Object} route - a `server.table()` entry, or a live `request.route`
29
+ * @param {Object} route - a route descriptor (lib/route-descriptors.js), or a live `request.route`
28
30
  * @param {String} [namespace] - which plugins block to read; defaults to `plugins.openapi`
29
31
  * @returns {Object} the route's plugins block, or an empty object when it declares none
30
32
  */
31
33
  function pluginOptions(route, namespace) {
32
- return (route && route.settings && route.settings.plugins && route.settings.plugins[namespace || PLUGIN_OPTIONS_KEY]) || NO_OPTIONS;
34
+ const plugins = routePlugins(route);
35
+ return (plugins && plugins[namespace || PLUGIN_OPTIONS_KEY]) || NO_OPTIONS;
33
36
  }
34
37
 
35
38
  /**
@@ -286,8 +286,21 @@ function buildSubmitMessagePayloadSchema(MAX_ATTACHMENT_SIZE) {
286
286
  .example('Sent Mail')
287
287
  .description("Upload sent message to this folder. By default the account's Sent Mail folder is used."),
288
288
 
289
- locale: Joi.string().empty('').max(100).example('fr').description('Optional locale').label('MessageLocale'),
290
- tz: Joi.string().empty('').max(100).example('Europe/Tallinn').description('Optional timezone'),
289
+ locale: Joi.string()
290
+ .empty('')
291
+ .max(100)
292
+ .example('fr')
293
+ .description(
294
+ 'Language of the text EmailEngine adds to the message, such as the "On ... wrote:" line and the forwarded message headers of `reference.inline`. A language tag like "sv" or "pt-BR"; only the language part is used, and a language without a translation is written in English. Defaults to the locale of the account, then to the locale setting of the instance'
295
+ )
296
+ .label('MessageLocale'),
297
+ tz: Joi.string()
298
+ .empty('')
299
+ .max(100)
300
+ .example('Europe/Tallinn')
301
+ .description(
302
+ 'Time zone of the dates EmailEngine writes into the message, such as the date of the quoted message with `reference.inline`. Defaults to the time zone of the account, then to the timezone setting of the instance'
303
+ ),
291
304
 
292
305
  sendAt: sendAtSchema,
293
306
  deliveryAttempts: deliveryAttemptsSchema,