emailengine-app 2.88.0 → 2.89.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.
package/.ncurc.js CHANGED
@@ -2,33 +2,30 @@
2
2
 
3
3
  module.exports = {
4
4
  upgrade: true,
5
- // Node 20 is a hard runtime floor, not a preference (engines.node says >=20.19.0, the oldest 20.x the
6
- // dependency tree itself accepts; server.js only warns below it). The DigitalOcean one-click images run
7
- // EmailEngine on Node 20 and ship an upgrade script for EmailEngine but none for Node, so those
8
- // installs keep self-updating on a runtime that never moves; raising the floor breaks them on
9
- // their next upgrade. Node 20 being EOL upstream, and CI and the pkg targets being on Node 24,
10
- // do not lift this. Treat "needs Node >20" as a permanent reject.
5
+ // The Node.js floor is lib/node-version.js: server.js refuses to start below MIN_NODE (22.19.0, what
6
+ // undici 8 needs) and engines.node declares the range the bundled jsdom does. Until 2026-11 the floor
7
+ // was Node 20, held there by the DigitalOcean one-click images (they upgrade EmailEngine but not the
8
+ // Node.js under it), and several entries below existed only for that; they were lifted with the
9
+ // floor. A package that needs a Node.js newer than MIN_NODE still needs the floor raised first.
11
10
  //
12
11
  // Packages capped inside their current major: the next major is ESM-only (this codebase is
13
12
  // CommonJS and is bundled into a binary with pkg), needs a Node newer than the floor above, or
14
13
  // is a major we are deliberately soaking. Using 'minor' instead of a blanket reject so these
15
14
  // still receive security/patch updates within the safe major instead of being frozen at one
16
- // exact version. Last verified against Node 20 (Docker) 2026-06-17; re-check whenever an entry
17
- // below is reconsidered.
15
+ // exact version. Re-check whenever an entry below is reconsidered.
18
16
  //
19
- // Two different constraints drive these caps, and they lift on different terms. "Needs a newer
20
- // Node" is the floor above. "ESM-only" is pkg: the binary bundles a CommonJS module graph and cannot
21
- // load ES modules whatever Node version runs it, so an ESM-only runtime dependency stays out even
22
- // if the floor ever moves (see "Pure JavaScript only" in CLAUDE.md).
17
+ // "ESM-only" is pkg's constraint, not Node's: the binary bundles a CommonJS module graph and cannot
18
+ // load ES modules whatever Node version runs it, so an ESM-only runtime dependency stays out
19
+ // regardless of the floor (see "Pure JavaScript only" in CLAUDE.md).
23
20
  //
24
21
  // `pino` is capped harder than the rest, at 'patch', because the break arrived in a MINOR and a
25
22
  // major cap would not have stopped it. See its entry below.
26
23
  target: name =>
27
24
  ['pino', '@playwright/test'].includes(name)
28
25
  ? 'patch'
29
- : ['gettext-parser', 'xgettext-template', 'undici', 'marked', '@sentry/node-core', 'he', 'iconv-lite'].includes(name)
26
+ : ['gettext-parser', 'marked', '@sentry/node-core', 'he', 'iconv-lite'].includes(name)
30
27
  ? 'minor'
31
- : 'latest',
28
+ : 'latest'
32
29
  // pino - held on 10.3.x. 10.4.0 took PR #2294, which makes lib/caller.js prefer
33
30
  // util.getCallSites() over the Error.prepareStackTrace dance. Inside a pkg
34
31
  // binary that API aborts the PROCESS, not the call: V8 fails the CHECK in
@@ -48,31 +45,21 @@ module.exports = {
48
45
  // Same spec passes in 3.8 s on 1.63.0; nothing in the 1.64 release notes covers
49
46
  // it. Lift once a 1.64.x or later passes that spec unchanged.
50
47
  // gettext-parser - 8.x is ESM-only
51
- // xgettext-template - 6.x and later are ESM-only and need Node >=22. It only runs as a CLI in the
52
- // translation build, so ESM alone would not keep it out (build tools are exempt
53
- // from the CommonJS rule); the Node requirement does, since the tooling has to
54
- // run on the Node 20 floor too.
55
- // undici - 8.x requires Node >=22.19 and crashes at require() on Node 20. Permanent while the
56
- // Node 20 floor above stands. lib/net-tos-guard.js covers a 7.x crash 8.x fixed
57
- // itself (unguarded setTypeOfService); remove it with the upgrade.
58
- // marked - 16.x dropped the CommonJS build (ESM-only, needs require(esm)/Node >=20.19); 15.x is the
59
- // last require()-compatible line. 15.0.12 verified on Node 20-24 and in a yao/pkg node24 build.
48
+ // marked - 16.x dropped the CommonJS build (ESM-only, needs require(esm)); 15.x is the last
49
+ // require()-compatible line, verified in a yao/pkg node24 build.
60
50
  // Permanent: an ESM-only release cannot be bundled by pkg, whatever the Node floor.
61
- // iconv-lite - 1.0 (alpha since 2026-10) requires Node >=22 and moves to ES modules, relying on
62
- // require(esm). Held on 0.x; libmime, imapflow and mailparser carry the same cap.
63
- // The ES module move keeps it out of the pkg bundle even past the Node floor.
64
- // he - 2.x is ESM-only (exports only src/he.mjs) and requires Node >=22; require('he') throws
65
- // ERR_REQUIRE_ESM on Node 20 before 20.19. 1.2.0 is the last CommonJS release. mailparser,
51
+ // iconv-lite - 1.0 (alpha since 2026-10) moves to ES modules, relying on require(esm). Held on 0.x;
52
+ // libmime, imapflow and mailparser carry the same cap. The ES module move keeps it out of
53
+ // the pkg bundle.
54
+ // he - 2.x is ESM-only (exports only src/he.mjs). 1.2.0 is the last CommonJS release. mailparser,
66
55
  // which reaches EmailEngine through the same require, rejects 2.x for the same reason.
67
- // Permanent for the same pkg reason as marked, not because of the Node floor.
68
- // @sentry/node-core - held on the 10.x line for the reasons @sentry/node (which it replaced, through its
69
- // `light` entry) was held there: @sentry/node 11.x requires Node >=20.19 (engines now says the
70
- // same, but the startup check only warns below it, so a DigitalOcean image on an older 20.x
71
- // still runs; the error-reporting path must not be what fails there), and it depends on
72
- // @sentry/bundler-plugins, which pulls the 16 MB Sentry CLI (package `sentry`, licensed
73
- // FSL-1.1-Apache-2.0, not an OSI license) into the runtime tree and the pkg bundle. The
74
- // node-core line is versioned in step with @sentry/node, so lift this only once an 11.x
75
- // of node-core exists and has been checked against both points.
56
+ // Permanent for the same pkg reason as marked.
57
+ // @sentry/node-core - held on the 10.x line for the reason @sentry/node (which it replaced, through its
58
+ // `light` entry) was held there: @sentry/node 11.x depends on @sentry/bundler-plugins,
59
+ // which pulls the 16 MB Sentry CLI (package `sentry`, licensed FSL-1.1-Apache-2.0, not an
60
+ // OSI license) into the runtime tree and the pkg bundle. The node-core line is versioned in
61
+ // step with @sentry/node, so lift this only once an 11.x of node-core exists and has been
62
+ // checked against that.
76
63
  //
77
64
  // ical.js was capped at 1.x here as "2.x is ESM-only", which was never true: every 2.x ships a CommonJS
78
65
  // build behind exports.require. Moved to 2.x on 2026-09-28; it is also what resolves a DTSTART against
@@ -91,11 +78,4 @@ module.exports = {
91
78
  // (the OpenAPI document is generated by lib/openapi/ now), so joi may move majors again. A major
92
79
  // bump still needs a look at the generated document: test/openapi-golden-test.js fails if joi's
93
80
  // describe() output changes shape.
94
- reject: [
95
- // Not a direct dependency, so nothing here moves it: the "overrides" entry in package.json
96
- // lifts cheerio from the 1.0.0 that juice 11 (via @postalsys/email-text-tools) pins exactly,
97
- // which drags in a second copy of undici (6.x) next to ours. cheerio 1.2.0 shares our undici
98
- // 7 and keeps a CommonJS build; juice 12 would fix this itself but is ESM-only and needs
99
- // Node 22. Re-check the override when juice or email-text-tools changes its cheerio range.
100
- ]
101
81
  };
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "2.88.0"
2
+ ".": "2.89.0"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.89.0](https://github.com/postalsys/emailengine/compare/v2.88.0...v2.89.0) (2026-11-15)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * check a newly registered subscription key soon instead of on the replaced key's schedule ([07e0512](https://github.com/postalsys/emailengine/commit/07e05120483178684c98a604f6549ebdcfa0d895))
9
+ * stop the IMAP workers retaining every web-safe HTML message, require Node.js 22.19 ([8b0bc06](https://github.com/postalsys/emailengine/commit/8b0bc064e2485b7b30a6ec1d2f4e1a9b42767125))
10
+ * update dependencies ([1e08d01](https://github.com/postalsys/emailengine/commit/1e08d01cca2d381ef7ce9f4702c0d3c0cdcf59c5))
11
+
12
+
13
+ ### Miscellaneous Chores
14
+
15
+ * release 2.89.0 ([ac15c96](https://github.com/postalsys/emailengine/commit/ac15c9699c3a1e59de2389bad8b8daa4a77873d6))
16
+
3
17
  ## [2.88.0](https://github.com/postalsys/emailengine/compare/v2.87.2...v2.88.0) (2026-11-10)
4
18
 
5
19
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "creationTime": "2026-11-09T15:46:02.000000",
2
+ "creationTime": "2026-11-13T15:46:09.000000",
3
3
  "prefixes": [
4
4
  {
5
5
  "ipv6Prefix": "2001:4860:4801:2008::/64"
@@ -5,8 +5,8 @@
5
5
  // Please pull this list from, and only from https://publicsuffix.org/list/public_suffix_list.dat,
6
6
  // rather than any other VCS sites. Pulling from any other URL is not guaranteed to be supported.
7
7
 
8
- // VERSION: 2026-11-09_13-00-17_UTC
9
- // COMMIT: ab73a956765706dc3f42dbac5c7e48df2297e1ac
8
+ // VERSION: 2026-11-14_18-45-38_UTC
9
+ // COMMIT: dfe55f3548d0fe51c04b8d2903507a01fdec57ad
10
10
 
11
11
  // Instructions on pulling and using this list can be found at https://publicsuffix.org/list/.
12
12
 
@@ -11275,6 +11275,10 @@ ltd.ua
11275
11275
  a2hosted.com
11276
11276
  cpserver.com
11277
11277
 
11278
+ // abyme : https://abyme.studio
11279
+ // Submitted by Richard Mathieson <psl@abyme.studio>
11280
+ abyme.dev
11281
+
11278
11282
  // ActiveTrail : https://www.activetrail.biz/
11279
11283
  // Submitted by Ofer Kalaora <postmaster@activetrail.com>
11280
11284
  activetrail.biz
@@ -11311,6 +11315,10 @@ africa.com
11311
11315
  // Submitted by Simon Farshid <security@assistant-ui.com>
11312
11316
  *.auiusercontent.com
11313
11317
 
11318
+ // Agile Developer : https://agiledeveloper.de
11319
+ // Submitted by Görkem Sinirlioglu <info@agiledeveloper.de>
11320
+ agilevibes.app
11321
+
11314
11322
  // Agnat sp. z o.o. : https://domena.pl
11315
11323
  // Submitted by Przemyslaw Plewa <it-admin@domena.pl>
11316
11324
  beep.pl
@@ -12379,6 +12387,13 @@ eero-stage.online
12379
12387
 
12380
12388
  // concludes Amazon
12381
12389
 
12390
+ // Amba : https://amba.dev
12391
+ // Submitted by Amba Abuse Desk <abuse@amba.dev>
12392
+ app.amba.host
12393
+ cdn.amba.host
12394
+ fn.amba.host
12395
+ go.amba.host
12396
+
12382
12397
  // Anomaly : https://opencode.ai
12383
12398
  // Submitted by Dax Raad <security@anoma.ly>
12384
12399
  opentunnel.xyz
@@ -12478,6 +12493,11 @@ myasustor.com
12478
12493
  *.atlassian-isolated-3p.com
12479
12494
  cdn.prod.atlassian-dev.net
12480
12495
 
12496
+ // Automattic Inc. : https://automattic.com
12497
+ // Submitted by Stefano Sala <support@spacefast.com>
12498
+ space.fast
12499
+ view.fast
12500
+
12481
12501
  // AVM : https://avm.de
12482
12502
  // Submitted by Andreas Weise <a.weise@avm.de>
12483
12503
  myfritz.link
@@ -12521,6 +12541,10 @@ beagleboard.io
12521
12541
  // Submitted by Herman Martinus <admin@bearblog.dev>
12522
12542
  bearblog.dev
12523
12543
 
12544
+ // Bearly : https://bearly.ai
12545
+ // Submitted by Bearly Support <support@bearly.ai>
12546
+ bearly.sh
12547
+
12524
12548
  // Beget LLC : https://beget.com
12525
12549
  // Submitted by Lev Nekrasov & Nikita Radchenko <admin@beget.com>
12526
12550
  *.beget.app
@@ -12786,6 +12810,10 @@ objects.rma.cloudscale.ch
12786
12810
  lpg.objectstorage.ch
12787
12811
  rma.objectstorage.ch
12788
12812
 
12813
+ // Cloudzyro Ltd : https://cloudzyro.com
12814
+ // Submitted by Kofi Agyem <psl@cloudzyro.com>
12815
+ cloudzyro.app
12816
+
12789
12817
  // Clovyr : https://clovyr.io
12790
12818
  // Submitted by Patrick Nielsen <patrick@clovyr.io>
12791
12819
  wnext.app
@@ -12887,6 +12915,10 @@ craft.me
12887
12915
  // Submitted by Ales Krajnik <ales.krajnik@craynic.com>
12888
12916
  realm.cz
12889
12917
 
12918
+ // Curia : https://curiabots.com
12919
+ // Submitted by Curia <psl@crbts.app>
12920
+ crbts.app
12921
+
12890
12922
  // cyber_Folks S.A. : https://cyberfolks.pl
12891
12923
  // Submitted by Bartlomiej Kida <security@cyberfolks.pl>
12892
12924
  cfolks.pl
@@ -12938,6 +12970,10 @@ mydatto.com
12938
12970
  dattolocal.net
12939
12971
  mydatto.net
12940
12972
 
12973
+ // ddns.ge : https://nic.ddns.ge
12974
+ // Submitted by John Snow <support@mail.ddns.ge>
12975
+ ddns.ge
12976
+
12941
12977
  // ddnss.de : https://www.ddnss.de/
12942
12978
  // Submitted by Robert Niedziela <webmaster@ddnss.de>
12943
12979
  ddnss.de
@@ -13412,8 +13448,13 @@ webredirect.org
13412
13448
  myddns.rocks
13413
13449
 
13414
13450
  // dynv6 : https://dynv6.com
13415
- // Submitted by Dominik Menke <dom@digineo.de>
13451
+ // Submitted by Dominik Menke <dynv6@digineo.de>
13452
+ dns.army
13453
+ v6.army
13454
+ dns.navy
13455
+ v6.navy
13416
13456
  dynv6.net
13457
+ v6.rocks
13417
13458
 
13418
13459
  // E4YOU spol. s.r.o. : https://e4you.cz/
13419
13460
  // Submitted by Vladimir Dudr <info@e4you.cz>
@@ -13773,6 +13814,10 @@ freemyip.com
13773
13814
  // Submitted by Daniel A. Maierhofer <vorstand@funkfeuer.at>
13774
13815
  wien.funkfeuer.at
13775
13816
 
13817
+ // FurryBox : https://www.furry.box
13818
+ // Submitted by Aether <furry@org.digital>
13819
+ xwx.me
13820
+
13776
13821
  // Future Versatile Group. : https://www.fvg-on.net/
13777
13822
  // T.Kabu <webmaster@fvg-on.net>
13778
13823
  daemon.asia
@@ -14020,6 +14065,10 @@ goupile.fr
14020
14065
  // Submitted by Richard Baker <richard.baker@digital.cabinet-office.gov.uk>
14021
14066
  pymnt.uk
14022
14067
 
14068
+ // Government of Germany : https://dachmarke.gov.de/
14069
+ // Submitted by Digitale Dachmarke <support@dachmarke.gov.de>
14070
+ gov.de
14071
+
14023
14072
  // Government of the Netherlands : https://www.government.nl
14024
14073
  // Submitted by <domeinnaam@minaz.nl>
14025
14074
  gov.nl
@@ -14196,11 +14245,6 @@ iki.fi
14196
14245
  ibxos.it
14197
14246
  iliadboxos.it
14198
14247
 
14199
- // Imagine : https://imagine.dev
14200
- // Submitted by Steven Nguyen <security@imagine.dev>
14201
- imagine.diy
14202
- imagine-proxy.work
14203
-
14204
14248
  // Incsub, LLC : https://incsub.com/
14205
14249
  // Submitted by Aaron Edwards <sysadmins@incsub.com>
14206
14250
  smushcdn.com
@@ -14678,6 +14722,10 @@ luyani.net
14678
14722
  // Submitted by Damien Tournoud <dtournoud@magento.cloud>
14679
14723
  *.magentosite.cloud
14680
14724
 
14725
+ // Magic Pages : https://www.magicpages.co
14726
+ // Submitted by Jannis Fedoruk-Betschki <help@magicpages.co>
14727
+ mymagic.page
14728
+
14681
14729
  // Magic Patterns : https://www.magicpatterns.com
14682
14730
  // Submitted by Teddy Ni <security@magicpatterns.com>
14683
14731
  magicpatterns.app
@@ -14717,6 +14765,7 @@ hra.health
14717
14765
  // MedusaJS, Inc : https://medusajs.com/
14718
14766
  // Submitted by Stevche Radevski <engineering@medusajs.com>
14719
14767
  medusajs.app
14768
+ medusajs.site
14720
14769
 
14721
14770
  // Memset hosting : https://www.memset.com
14722
14771
  // Submitted by Tom Whitwell <domains@memset.com>
@@ -14898,6 +14947,12 @@ mocha.app
14898
14947
  mochausercontent.com
14899
14948
  mocha-sandbox.dev
14900
14949
 
14950
+ // Modelence : https://modelence.com/
14951
+ // Submitted by Modelence Security <security@modelence.com>
14952
+ modelence.app
14953
+ cloud.modelence.app
14954
+ sandbox.modelence.app
14955
+
14901
14956
  // MODX Systems LLC : https://modx.com
14902
14957
  // Submitted by Elizabeth Southwell <elizabeth@modx.com>
14903
14958
  modx.dev
@@ -15040,6 +15095,10 @@ torun.pl
15040
15095
  nh-serv.co.uk
15041
15096
  nimsite.uk
15042
15097
 
15098
+ // Ninjaneer Media : https://ninjaneer.au
15099
+ // Submitted by the Ninjaneer Media team <admin@ninjaneer.au>
15100
+ ninjaneer-sites.com
15101
+
15043
15102
  // No-IP.com : https://noip.com/
15044
15103
  // Submitted by Deven Reza <publicsuffixlist@noip.com>
15045
15104
  mmafan.biz
@@ -15215,6 +15274,10 @@ prvcy.page
15215
15274
  observablehq.cloud
15216
15275
  static.observableusercontent.com
15217
15276
 
15277
+ // omg.dev : https://omg.dev
15278
+ // Submitted by omg.dev Security <security@omg.dev>
15279
+ omgs.page
15280
+
15218
15281
  // OMG.LOL : https://omg.lol
15219
15282
  // Submitted by Adam Newbold <adam@omg.lol>
15220
15283
  omg.lol
@@ -15336,6 +15399,10 @@ own.pm
15336
15399
  // Submitted by Adam Grand <webmaster@mail.ox.rs>
15337
15400
  ox.rs
15338
15401
 
15402
+ // OxyPages : https://oxypages.com
15403
+ // Submitted by Oxy Pages <hello@oxypages.com>
15404
+ myoxypages.com
15405
+
15339
15406
  // oy.lc
15340
15407
  // Submitted by Charly Coste <changaco@changaco.oy.lc>
15341
15408
  oy.lc
@@ -15564,6 +15631,10 @@ ravpage.co.il
15564
15631
  readthedocs-hosted.com
15565
15632
  readthedocs.io
15566
15633
 
15634
+ // ReadWriteExecute, Inc : https://www.rwx.com
15635
+ // Submitted by Dan Manges <security@rwx.com>
15636
+ rwx.run
15637
+
15567
15638
  // Red Hat, Inc. OpenShift : https://openshift.redhat.com/
15568
15639
  // Submitted by Tim Kramer <tkramer@rhcloud.com>
15569
15640
  rhcloud.com
@@ -15577,6 +15648,12 @@ instances.spawn.cc
15577
15648
  *.clusters.rdpa.co
15578
15649
  *.srvrless.rdpa.co
15579
15650
 
15651
+ // Reliant Labs : https://reliantlabs.io
15652
+ // Submitted by Reliant Labs Security <security@reliantlabs.io>
15653
+ reliantlabs.dev
15654
+ sites.reliantlabs.dev
15655
+ reliantpreview.dev
15656
+
15580
15657
  // Render : https://render.com
15581
15658
  // Submitted by Anurag Goel <dev@render.com>
15582
15659
  onrender.com
@@ -15657,6 +15734,10 @@ io.noc.ruhr-uni-bochum.de
15657
15734
  // Submitted by Tech Support <support@rasnet.ru>
15658
15735
  ras.ru
15659
15736
 
15737
+ // Sail Research Co. : https://sailresearch.com/
15738
+ // Submitted by Sail Support <support@sailresearch.com>
15739
+ sail.box
15740
+
15660
15741
  // Sakura Frp : https://www.natfrp.com
15661
15742
  // Submitted by Bobo Liu <support@natfrp.cloud>
15662
15743
  nyat.app
@@ -15900,6 +15981,13 @@ shopitsite.com
15900
15981
  shopware.shop
15901
15982
  shopware.store
15902
15983
 
15984
+ // Show Corporation : https://doma.in
15985
+ // Submitted by Xiufeng Guo <support@cctld.com>
15986
+ co.fo
15987
+ com.fo
15988
+ wz.io
15989
+ wz.org
15990
+
15903
15991
  // Siemens Mobility GmbH
15904
15992
  // Submitted by Oliver Graebner <security@mo-siemens.io>
15905
15993
  mo-siemens.io
@@ -16209,6 +16297,10 @@ telebit.io
16209
16297
  // Submitted by Rob Picard <security@goteleport.com>
16210
16298
  teleport.sh
16211
16299
 
16300
+ // Terramind.com, Inc. : https://terramind.com
16301
+ // Submitted by Terramind Sites <sites@terramind.com>
16302
+ terramind.io
16303
+
16212
16304
  // Thingdust AG : https://thingdust.com/
16213
16305
  // Submitted by Adrian Imboden <adi@thingdust.com>
16214
16306
  *.firenet.ch
@@ -16378,6 +16470,10 @@ now.sh
16378
16470
  // Submitted by Danko Aleksejevs <danko@very.lv>
16379
16471
  2038.io
16380
16472
 
16473
+ // VibeKit : https://vibekit.bot/
16474
+ // Submitted by Brian Boisjoli <info@vibekit.bot>
16475
+ vibekit.page
16476
+
16381
16477
  // Virtual-Info : https://www.virtual-info.info/
16382
16478
  // Submitted by Adnan RIHAN <hostmaster@v-info.info>
16383
16479
  v-info.info
@@ -16395,6 +16491,10 @@ deus-canvas.com
16395
16491
  vivenushop.com
16396
16492
  vivenushop.dev
16397
16493
 
16494
+ // Voati : https://voati.org
16495
+ // Submitted by Voati Support <support@voati.org>
16496
+ voati.host
16497
+
16398
16498
  // Voorloper.com : https://voorloper.com
16399
16499
  // Submitted by Nathan van Bakel <info@voorloper.com>
16400
16500
  voorloper.cloud
@@ -16414,6 +16514,7 @@ wal.app
16414
16514
  // Wasmer: https://wasmer.io
16415
16515
  // Submitted by Lorentz Kinde <security@wasmer.io>
16416
16516
  wasmer.app
16517
+ sm.run
16417
16518
 
16418
16519
  // Webflow, Inc. : https://www.webflow.com
16419
16520
  // Submitted by Webflow Security Team <security@webflow.com>
@@ -82,17 +82,24 @@ const checkInterval = state => (state && (toTime(state.subexp) || state.subsusp)
82
82
  * to store; suspend is the subsusp record to store; removeLicense is the legacy outcome; nextCheck is
83
83
  * when the next online check is due (ms), or null to leave it
84
84
  */
85
+ // A server-provided time as an ISO string, or null when it does not parse
86
+ const isoOrNull = value => {
87
+ const time = toTime(value);
88
+ return time ? new Date(time).toISOString() : null;
89
+ };
90
+
91
+ // What decide() returns when nothing changes; each branch states only what differs
92
+ const NO_CHANGE = Object.freeze({ clear: false, resume: false, subexp: null, suspend: null, removeLicense: false, nextCheck: null });
93
+
85
94
  function decide({ ok, data, now, subexp }) {
86
95
  data = data || {};
87
96
 
88
97
  if (ok) {
89
98
  const validatedUntil = toTime(data.validatedUntil);
90
99
  return {
100
+ ...NO_CHANGE,
91
101
  clear: true,
92
102
  resume: true,
93
- subexp: null,
94
- suspend: null,
95
- removeLicense: false,
96
103
  nextCheck: validatedUntil ? Math.min(now + MAX_LICENSE_CHECK_DELAY, validatedUntil) : null
97
104
  };
98
105
  }
@@ -100,7 +107,7 @@ function decide({ ok, data, now, subexp }) {
100
107
  // A refusal without invalidate is not about the subscription (bad input, a server error):
101
108
  // nothing changes, EmailEngine never stops over the license server's own trouble
102
109
  if (!data.invalidate) {
103
- return { clear: false, resume: false, subexp: null, suspend: null, removeLicense: false, nextCheck: null };
110
+ return { ...NO_CHANGE };
104
111
  }
105
112
 
106
113
  const stored = toTime(subexp);
@@ -109,25 +116,23 @@ function decide({ ok, data, now, subexp }) {
109
116
  if (deadline > now) {
110
117
  // inside the window: working, even if a stored suspension said otherwise (the server's
111
118
  // deadline is the one that counts, and it can move later)
112
- return { clear: false, resume: true, subexp: deadline, suspend: null, removeLicense: false, nextCheck: now + OVERDUE_CHECK_INTERVAL };
119
+ return { ...NO_CHANGE, resume: true, subexp: deadline, nextCheck: now + OVERDUE_CHECK_INTERVAL };
113
120
  }
114
121
 
115
122
  if (!data.keepLicense) {
116
- return { clear: false, resume: false, subexp: null, suspend: null, removeLicense: true, nextCheck: null };
123
+ return { ...NO_CHANGE, removeLicense: true };
117
124
  }
118
125
 
119
126
  return {
120
- clear: false,
121
- resume: false,
127
+ ...NO_CHANGE,
122
128
  subexp: deadline,
123
129
  suspend: {
124
130
  code: typeof data.code === 'string' ? data.code.slice(0, 64) : 'SubscriptionInactive',
125
131
  error: typeof data.error === 'string' ? data.error.slice(0, 256) : 'Subscription inactive',
126
132
  since: new Date(deadline).toISOString(),
127
- overdueSince: toTime(data.overdueSince) ? new Date(toTime(data.overdueSince)).toISOString() : null,
128
- endedAt: toTime(data.endedAt) ? new Date(toTime(data.endedAt)).toISOString() : null
133
+ overdueSince: isoOrNull(data.overdueSince),
134
+ endedAt: isoOrNull(data.endedAt)
129
135
  },
130
- removeLicense: false,
131
136
  nextCheck: now + OVERDUE_CHECK_INTERVAL
132
137
  };
133
138
  }
@@ -231,6 +236,7 @@ module.exports = {
231
236
  parseSuspension,
232
237
  isSubscriptionLicense,
233
238
  keepsSubscriptionState,
239
+ toTime,
234
240
  LEGACY_GRACE,
235
241
  CHECK_INTERVAL,
236
242
  OVERDUE_CHECK_INTERVAL,
@@ -1,24 +1,111 @@
1
1
  'use strict';
2
2
 
3
- // The oldest Node.js release the dependency tree supports, matching `engines.node` in package.json
4
- // (test/node-version-test.js keeps the two in step). Requires nothing but the dependency-free
5
- // lib/utils/version.js, because server.js checks it before it requires anything else.
6
-
7
- const MIN_SUPPORTED_NODE = '20.19.0';
3
+ // Which Node.js releases EmailEngine runs on. Requires nothing but the dependency-free
4
+ // lib/utils/version.js, because server.js asks before it requires anything else.
5
+ //
6
+ // Two thresholds, because the dependency tree has two:
7
+ //
8
+ // - MIN_NODE is the oldest release EmailEngine can start on at all. undici 8, which the main
9
+ // thread and every worker load at startup, throws when it is loaded on anything older than
10
+ // 22.19 (it calls a zlib API Node 20 does not have), so below it server.js exits with a message
11
+ // instead of letting the first worker die on a TypeError.
12
+ // - SUPPORTED_RANGES is what package.json `engines.node` declares, the range the bundled jsdom
13
+ // (inside @postalsys/email-text-tools) declares. A release between the two starts and runs, and
14
+ // the dashboard says it is outside the supported range. test/node-version-test.js keeps the
15
+ // ranges equal to the engines field.
8
16
 
9
17
  const { compareVersions } = require('./utils/version');
10
18
 
19
+ const MIN_NODE = '22.19.0';
20
+
21
+ // [major, minimum within that major], the last entry also admits every later major
22
+ const SUPPORTED_RANGES = [
23
+ [22, '22.22.2'],
24
+ [24, '24.15.0'],
25
+ [26, '26.0.0']
26
+ ];
27
+
28
+ // The engines.node form of SUPPORTED_RANGES
29
+ const SUPPORTED_RANGE_TEXT = SUPPORTED_RANGES.map(([, min], i) => (i === SUPPORTED_RANGES.length - 1 ? `>=${min}` : `^${min}`)).join(' || ');
30
+
31
+ // What an operator reads when the version is not supported
32
+ // ("22.x from 22.22.2, 24.x from 24.15.0, or 26 and newer")
33
+ const SUPPORTED_RANGE_LABEL = SUPPORTED_RANGES.map(([major, min], i) =>
34
+ i === SUPPORTED_RANGES.length - 1 ? `or ${major} and newer` : `${major}.x from ${min}`
35
+ ).join(', ');
36
+
37
+ function normalize(version) {
38
+ return String(version || '').replace(/^v/, '');
39
+ }
40
+
41
+ function inSupportedRange(version) {
42
+ const major = Number(version.split('.')[0]);
43
+ const last = SUPPORTED_RANGES[SUPPORTED_RANGES.length - 1];
44
+ if (major >= last[0]) {
45
+ return compareVersions(version, last[1]) >= 0;
46
+ }
47
+ const range = SUPPORTED_RANGES.find(([rangeMajor]) => rangeMajor === major);
48
+ return !!range && compareVersions(version, range[1]) >= 0;
49
+ }
50
+
11
51
  /**
12
- * Whether a Node.js version is older than MIN_SUPPORTED_NODE
13
- * @param {string} version - A version such as process.versions.node ("20.18.1")
14
- * @returns {boolean} True when the version is older, false for one that can not be read
52
+ * How well EmailEngine supports a Node.js version
53
+ * @param {string} version - A version such as process.versions.node ("22.19.0")
54
+ * @returns {'unsupported'|'outside-range'|'ok'} 'unsupported' below MIN_NODE, 'outside-range' for
55
+ * a release that runs but is not in SUPPORTED_RANGES, 'ok' otherwise. A version that can not be
56
+ * read is 'ok': nothing is gained by refusing to start over a string we do not understand
15
57
  */
16
- function isBelowSupportedNode(version) {
58
+ function nodeSupport(version) {
59
+ const normalized = normalize(version);
17
60
  try {
18
- return compareVersions(String(version || '').replace(/^v/, ''), MIN_SUPPORTED_NODE) < 0;
61
+ if (compareVersions(normalized, MIN_NODE) < 0) {
62
+ return 'unsupported';
63
+ }
64
+ return inSupportedRange(normalized) ? 'ok' : 'outside-range';
19
65
  } catch (err) {
20
- return false;
66
+ return 'ok';
21
67
  }
22
68
  }
23
69
 
24
- module.exports = { MIN_SUPPORTED_NODE, isBelowSupportedNode };
70
+ // What an operator on a Debian or Ubuntu server with Node.js from NodeSource (the DigitalOcean one-click
71
+ // image included) runs to move to a supported release. The startup error and /admin/upgrade show it
72
+ const NODESOURCE_UPGRADE_COMMANDS = [
73
+ 'curl -fsSL https://deb.nodesource.com/setup_24.x | sudo bash -',
74
+ 'sudo apt-get install -y nodejs',
75
+ 'sudo systemctl restart emailengine'
76
+ ];
77
+
78
+ /**
79
+ * The commands an operator runs to move to a supported Node.js release, for the startup error
80
+ * @returns {string}
81
+ */
82
+ function nodeUpgradeHint() {
83
+ return [
84
+ 'To upgrade Node.js on a Debian or Ubuntu server that installed it from NodeSource (this includes the',
85
+ 'DigitalOcean one-click image), run:',
86
+ '',
87
+ ...NODESOURCE_UPGRADE_COMMANDS.map(command => ` ${command}`),
88
+ '',
89
+ 'The EmailEngine binaries and the Docker image carry their own Node.js and are not affected.'
90
+ ].join('\n');
91
+ }
92
+
93
+ /**
94
+ * What the admin UI shows about the Node.js release it runs on
95
+ * @param {string} version - A version such as process.versions.node
96
+ * @param {boolean} [packaged] - A pkg binary, which carries its own Node.js: there is nothing for
97
+ * its operator to upgrade but EmailEngine, so it is never flagged
98
+ * @returns {{version: string, supported: string, upgradeCommands: string[], packaged: boolean, outsideRange: boolean}}
99
+ */
100
+ function nodeRuntimeView(version, packaged) {
101
+ return {
102
+ version: normalize(version),
103
+ supported: SUPPORTED_RANGE_LABEL,
104
+ upgradeCommands: NODESOURCE_UPGRADE_COMMANDS,
105
+ packaged: !!packaged,
106
+ // 'unsupported' never renders: the process would not have started
107
+ outsideRange: !packaged && nodeSupport(version) !== 'ok'
108
+ };
109
+ }
110
+
111
+ module.exports = { nodeRuntimeView, MIN_NODE, SUPPORTED_RANGE_TEXT, SUPPORTED_RANGE_LABEL, nodeSupport, nodeUpgradeHint };
package/lib/settings.js CHANGED
@@ -462,7 +462,10 @@ ${Buffer.from(licenseFile, 'base64url').toString('base64')}
462
462
 
463
463
  let multi = redis.multi().hset(`${REDIS_PREFIX}settings`, 'license', licenseFile);
464
464
  if (!keepState) {
465
- multi = multi.hdel(`${REDIS_PREFIX}settings`, 'subexp', 'subsusp');
465
+ // A different key starts clean, and is checked online soon rather than when the last
466
+ // check of the key it replaces said: subcheck was stamped by that key's checks, and
467
+ // left in place it would hold off the first check of the new one by up to a day
468
+ multi = multi.hdel(`${REDIS_PREFIX}settings`, 'subexp', 'subsusp', 'subcheck');
466
469
  }
467
470
  await multi
468
471
  .hset(