Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 29, 2025

The check_domains function was annotated to return MXHost, but actually returns a dict with domain check results (single domain) or a list of such dicts (multiple domains).

Changes

  • Added DomainCheckResult TypedDict defining the actual return structure with fields: domain, base_domain, dnssec, soa, ns, mx, spf, dmarc, smtp_tls_reporting, mta_sts, and optionally bimi

  • Updated return type from -> MXHost to -> Union[DomainCheckResult, list[DomainCheckResult]]

  • Updated docstring to document all returned fields instead of the incomplete list

  • Imported result types from submodules to properly type the DomainCheckResult fields

Example

from checkdmarc import check_domains, DomainCheckResult

# Single domain returns DomainCheckResult
result: DomainCheckResult = check_domains(["example.com"])

# Multiple domains returns list[DomainCheckResult]
results: list[DomainCheckResult] = check_domains(["example.com", "example.org"])

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • vmc.digicert.com
    • Triggering command: /usr/bin/python3 python3 tests.py (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Wrong return type for check_domains</issue_title>
<issue_description>Hi @seanthegeek! Thank you for all the hard work you put into checkdmarc!

I see that in the latest release you've changed the return type for check_domains from Union[OrderedDict, list[OrderedDict[str, Any]]] to MXHost (555f133#diff-621a373ad93038ada7a8c93a25a59ade50b5b73874219dcd0f803c86cc6ff267L64) but this looks like an error because the function can still return a list if more than a single domain was provided and also MXHost doesn't seem to be the correct type even when the function does return a dict.

I'm happy to open a PR that reverts the change or I can also take a stab at trying to come up with a proper TypedDict definition for the function, let me know!

Happy holidays!</issue_description>

<agent_instructions>Update the return type and/or create new typedicts as needed to solve this issue.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 29, 2025 17:24
Co-authored-by: seanthegeek <44679+seanthegeek@users.noreply.github.com>
Co-authored-by: seanthegeek <44679+seanthegeek@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix wrong return type for check_domains function Fix check_domains return type annotation Dec 29, 2025
@seanthegeek seanthegeek marked this pull request as ready for review December 29, 2025 17:29
@seanthegeek seanthegeek merged commit c0b8e28 into main Dec 29, 2025
1 check 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.

Wrong return type for check_domains

2 participants