You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a domain, with DKIM enabled, default Key selector (modoboa) and Key length 2048
Generate DKIM key via the command libe /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)
Add TXT record on the DNS server: modoboa._domainkey.mydomain.com (v=DKIM1;k=rsa;p=XXXXX)
Wait up to 48 hours
Run the command the check the DKIM: /srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py modo check_mx
Current behavior
DKIM status showes "No record found"
Expected behavior
DKIM status shows record found
Proposed Fix
The get_authoritative_server function 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.
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_mx
Current behavior
DKIM status showes "No record found"
Expected behavior
DKIM status shows record found
Proposed Fix
The
get_authoritative_server
function 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.
modoboa/modoboa/admin/lib.py
Line 208 in 2cb6cce
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:
The text was updated successfully, but these errors were encountered: