IMX-3049: Fix domain check reading DNS results from the wrong place by scorpiofighter · Pull Request #2 · improvmx/cli · GitHub
Skip to content

IMX-3049: Fix domain check reading DNS results from the wrong place - #2

Open
scorpiofighter wants to merge 1 commit into
masterfrom
mustapha/imx-3049-fix-domain-check-records
Open

scorpiofighter wants to merge 1 commit into
masterfrom
mustapha/imx-3049-fix-domain-check-records

Conversation

@scorpiofighter

@scorpiofighter scorpiofighter commented Sep 3, 2026 •

Copy link
Copy Markdown

improvmx domain check <domain> printed MISSING for MX, SPF and the overall result on every domain, even ones that are perfectly set up. It read those three values from the top of the API's reply, but they have always been nested one level down under records — so they always came back empty, and empty means "missing". Only --json was right, because it prints the reply as-is without reading it.

Before and after, on a domain that is correctly configured:

Domain: relai.co.za          Domain: relai.co.za
MX:     MISSING       →      MX:     OK
SPF:    MISSING              SPF:    OK
Overall: MISSING             Overall: OK

A domain that genuinely isn't set up still prints MISSING, so this is reading the reply rather than assuming everything is fine.

This is the display fix on its own. The command stays on the v3 endpoint and nothing else about it changes, so it can ship straight away. Moving the command to v4 is #1, which builds on this.

Merge order: 1 of 2 — merge before #1.

Changes

  • cmd/domain.go — read MX, SPF and the overall result from inside records.

Testing

  • Ran the exact reply the endpoint sends ({"success": true, "records": {…}}) through the new reading code: a configured domain prints OK, an unconfigured one still prints MISSING.
  • go build and go vet are clean.
  • IMX-3049: Switch domain check to POST /v4/domains/:domain/verify #1 was run against production with a real API key and printed OK for relai.co.za where it used to print MISSING. Both endpoint versions build the records section with the same server-side code, so that same result applies here.

No automated tests — this repo has none.

@linear

linear Bot commented Sep 3, 2026

Copy link
Copy Markdown

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.

2 participants