mirror of
https://github.com/modoboa/modoboa.git
synced 2026-04-25 00:46:03 +03:00
[GH-ISSUE #3388] Issue with get_authoritative_server Function Failing for DKIM Check #1845
Labels
No labels
bug
bug
dependencies
design
documentation
duplicate
enhancement
enhancement
enhancement
feedback-needed
help-needed
help-needed
installer
invalid
looking-for-sponsors
modoboa-contacts
new-ui
new-ui
pr
pull-request
pyconfr
python
question
security
stale
webmail
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/modoboa-modoboa#1845
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jerems6 on GitHub (Dec 22, 2024).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/3388
Impacted versions
Steps to reproduce
/srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py modo manage_dkim_keys("generate key" was not available via the web UI after the fresh installation)/srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py modo check_mxCurrent behavior
DKIM status showes "No record found"
Expected behavior
DKIM status shows record found
Proposed Fix
The
get_authoritative_serverfunction in Modoboa fails to retrieve the authoritative server during a DKIM check. The issue arises when querying with the domain like "modoboa._domainkey.mydomain.com". An exception is raised with "_domainkey.mydomain.com" of type dns.resolver.NXDOMAIN.The function should handle dns.resolver.NXDOMAIN exceptions in addition to dns.resolver.NoAnswer, ensuring the logic continues with the domain's parent in such cases.
The issue occurs because dns.resolver.NXDOMAIN is not caught by the except block. This leads to the function halting prematurely instead of continuing to the parent domain.
github.com/modoboa/modoboa@2cb6ccebfa/modoboa/admin/lib.py (L208)The except block should also handle dns.resolver.NXDOMAIN to ensure the function works correctly.
New line suggested:
except (dns.resolver.NoAnswer, dns.resolver.NXDOMAIN) as e:@tonioo commented on GitHub (Jan 16, 2025):
Why does the resolution fail if you properly declared your record?
@Spitfireap commented on GitHub (Jan 16, 2025):
Perhaps @arthru if you could enlight us with your DNS knowledge ? :D
@arthru commented on GitHub (Jan 16, 2025):
NXDOMAIN happens when a name could not be resolved
it can happen when asking a NS record for "modoboa._domainkey.mydomain.com"
based on reading this issue, the proposed fix looks good to me, but I did not test it myself
@Spitfireap commented on GitHub (Jan 16, 2025):
Thanks @arthru.
@jerems6 are you able to open a PR ?
@stale[bot] commented on GitHub (Apr 25, 2025):
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@stovesy commented on GitHub (Jun 16, 2025):
The above changed fixed the issue I was having...