Skip to content

Conversation

@lig
Copy link
Contributor

@lig lig commented Oct 30, 2025

dig often includes failed attempts in fulfilling the user request with lines that start with ';' which is a commentary line. This lines could be safely ignored as long as there is an actual answer.

Requests like an example below could result in some connectivity (ipv6 or otherwise) errors reports followed by a legitimate answer from dig.

This change ignores such "comments" in the output and returns the first meaningful answer.

> dig @linode3.countzero.co -r -q mta-sts.countzero.co -t cname +short
;; communications error to 2a01:7e01::f03c:93ff:febc:6635#53: connection refused
;; communications error to 2a01:7e01::f03c:93ff:febc:6635#53: connection refused
;; communications error to 2a01:7e01::f03c:93ff:febc:6635#53: connection refused
countzero.co.

This case appears to be caused by Debian 12 having no ipv6 connectivity by default on a fresh install. So, any SOA accessible by ipv6 will most likely cause a break in the chatmail server default installation process.

@lig lig force-pushed the improve-dns-records-resolution branch from 4d857fa to 3364e58 Compare October 30, 2025 08:29
@missytake
Copy link
Contributor

Looks good! Can you maybe add a test to cmdeploy/src/cmdeploy/tests/test_dns.py with a mocked DNS test result with a comment? Otherwise I can do that later myself.

@lig
Copy link
Contributor Author

lig commented Oct 31, 2025

Will do

@lig
Copy link
Contributor Author

lig commented Oct 31, 2025

That will be a bit more complicated than adding a fixture as the method affected by the fix is actually mocked in tests. I'll figure something out.

@lig
Copy link
Contributor Author

lig commented Oct 31, 2025

@missytake I've parametrized the fixture and changed the function that is being mocked.

@lig lig force-pushed the improve-dns-records-resolution branch from 325d427 to 049ef98 Compare October 31, 2025 16:52
Copy link
Contributor

@missytake missytake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@missytake missytake merged commit 76108c1 into chatmail:main Nov 6, 2025
2 of 4 checks passed
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