Skip to content

feat: bump mx-connect to 1.7.0, add new blockReservedNetworks option - #503

Open
dragoangel wants to merge 1 commit into
zone-eu:masterfrom
dragoangel:feat/block-reserved-networks
Open

feat: bump mx-connect to 1.7.0, add new blockReservedNetworks option#503
dragoangel wants to merge 1 commit into
zone-eu:masterfrom
dragoangel:feat/block-reserved-networks

Conversation

@dragoangel

@dragoangel dragoangel commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Bumps mx-connect to 1.7.0 and exposes the blockReservedNetworks switch it introduces.

What 1.7.0 brings

Hardened MX IP validation, null MX rejection (RFC 7505), TLSA lookups skipped for non-DNSSEC zones (RFC 7672), and a fix for extractSPKI() returning the raw public key instead of SPKI DER.

MX destinations are now classified in three tiers:

Tier Ranges Switch
Never valid unspecified (0.0.0.0), broadcast, multicast none — always rejected
Local scope loopback, private, link-local, CGNAT, unique-local blockLocalAddresses
Reserved future-use 240.0.0.0/4, RFC 5737 / RFC 3849 documentation blockReservedNetworks (new)

What this PR adds

Only the second tier was reachable from zone-mta. blockReservedNetworks is now wired identically:

  • config/default.js — global dns.blockReservedNetworks: false
  • lib/sending-zone.js — copied onto the zone like the other delivery options
  • lib/sender.js — folded into delivery.dnsOptions

Precedence matches blockLocalAddresses: per-delivery dnsOptions → zone → config.dns. Defaults to false, same as mx-connect.

Behaviour change

The first tier arrives with the bump and has no opt-out: an MX resolving to 0.0.0.0, 255.255.255.255 or a multicast address is now rejected regardless of configuration. Nothing else changes for existing deployments.

About the lockfile

package-lock.json loses 221 lines — 16 entries removed, none added. That is the effect of the bump, not collateral damage:

  • 14 of them are the entire node_modules/mx-connect/node_modules/* subtree. 1.6.0 pinned mailauth@4.13.0 while zone-mta pins 4.13.3, so npm kept a private copy along with its full transitive tree. 1.7.0 pins 4.13.3, so it dedupes into the hoisted one.
  • node_modules/mailauth/node_modules/ipaddr.js — the hoisted ipaddr.js was 2.3.0 (1.6.0's pin), so mailauth carried its own 2.4.0. The hoisted one is now 2.4.0 itself.
  • node_modules/joi — hoisted only for the nested mailauth@4.13.0. The joi that mailauth@4.13.3 needs lives at node_modules/mailauth/node_modules/joi and is untouched in both locks.

Checked by walking every remaining package's declared dependencies in npm's resolution order: no unresolved dependency in the resulting tree, and nothing added.

The node floor is unaffected: the strictest requirement in the tree is mailauth's node >=20.18.1, which zone-mta already depends on directly and which is unchanged here. The bump only drops the two nested copies (mx-connect/mailauth, mx-connect/undici) that carried the same requirement.

Verification

Run in a clean node:20 container (node 20.20.2, npm 10.8.2):

  • npm ci — installs cleanly, 651 packages, so the lockfile is consistent with package.json.
  • npm test (grunt: eslint + nodeunit) — lint clean, 227 assertions passed.
  • npm install --package-lock-only reproduces the committed lockfile byte for byte. The committed file was generated by npm 9 on node 18, so both toolchains resolve the tree identically — the dedupe above is npm's own resolution, not an artifact of the environment it was generated in.

…tion

1.7.0 hardens MX IP validation, rejects null MX (RFC 7505), skips TLSA
lookups for non-DNSSEC zones (RFC 7672) and fixes DANE SPKI extraction.

It splits invalid MX targets into three tiers: unspecified, broadcast and
multicast are now rejected unconditionally; local/private ranges stay behind
blockLocalAddresses; and a new blockReservedNetworks covers the future-use
and documentation ranges.

Expose the new switch exactly like blockLocalAddresses — global default,
zone override, per-delivery override. Defaults to false, as in mx-connect.

Signed-off-by: Dmytro Alieksieiev <1865999+dragoangel@users.noreply.github.com>
@dragoangel

Copy link
Copy Markdown
Contributor Author

@NickOvt can you please review this change? Shipping as discussed in #495

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant