01-Apr-2026 — add MX record management for subdomain email routing(#207)
build 573 — commit # 4549a14
What's New
MX Record Status on Mail Settings Page
The Senders tab on the Mail Settings page (/admin/mail-settings?tab=senders)
now includes an MX Records section that shows:
- Whether the required Cloudflare MX records are configured for your environment's domain
- A status table listing each required mail server with a check or cross indicator
- An Add Missing MX Records button that appears when records are missing, allowing you to fix the configuration with a single click
This makes it easy for site administrators to diagnose and resolve email delivery issues without needing direct access to Cloudflare.
Automatic MX Records for New Environments
When a new environment is provisioned via the environment setup workflow, the required MX records are now created automatically alongside the existing A and AAAA DNS records. This prevents the email routing gap that previously affected all new subdomain deployments.
Background
Emails sent to *.ngx-ramblers.org.uk subdomain addresses were bouncing with
error 5.4.0 (network or routing status) because no MX records existed to tell
sending mail servers where to deliver email. The root domain and all custom
domains (e.g. ekwg.co.uk) had correct MX records, but subdomains like
kent.ngx-ramblers.org.uk were missing them entirely.
The three required MX records point to Cloudflare's email routing servers:
route1.mx.cloudflare.net(priority 16)route2.mx.cloudflare.net(priority 99)route3.mx.cloudflare.net(priority 2)
Technical Details
Server-side changes
server/lib/cloudflare/cloudflare.model.ts— Addedpriorityfield toDnsRecordandDnsRecordResultinterfaces. AddedMxRecordDetailandMxRecordStatusinterfaces for the status API response.server/lib/cloudflare/cloudflare-dns.ts— UpdatedcreateDnsRecord()to conditionally includepriorityin the Cloudflare API POST body when present (required for MX record creation).server/lib/cloudflare/cloudflare-email-routing-routes.ts— Added two new authenticated API endpoints:GET /api/cloudflare/email-routing/mx-records— returns MX record status for the current environment's subdomainPOST /api/cloudflare/email-routing/mx-records— creates any missing MX records and returns updated statusserver/lib/cli/commands/subdomain.ts— UpdatedsetupSubdomainForEnvironment()to create MX records after A/AAAA records, with duplicate detection matching the existing pattern.
Client-side changes
projects/ngx-ramblers/src/app/models/cloudflare-email-routing.model.ts— AddedMxRecordStatus,MxRecordDetail, andMxExistingRecordinterfaces.projects/ngx-ramblers/src/app/services/cloudflare/cloudflare-email-routing.service.ts— AddedqueryMxRecordStatus()andcreateMissingMxRecords()service methods.projects/ngx-ramblers/src/app/pages/admin/system-settings/mail/mail-senders-list.ts— Added MX record status section to the template with status badge, record table, error display, and create button. AddedloadMxRecordStatus()andcreateMissingMxRecords()component methods.