mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
Handle NameTooLong by logging an error
get_dns_records() could be fed with a name that is too long for the DNS protocol. In this case a NameTooLong error is thrown, which we can catch and log an error for. This can happen for example if a DNS name that is already at the limit is used in combination with "manage.py modo check_mx", which appends an autodiscover to the domain, which then exceeds the DNS name limit.
This commit is contained in:
@@ -198,6 +198,8 @@ def get_dns_records(name, typ, resolver=None):
|
||||
logger.warning(
|
||||
_("DNS resolution timeout, unable to query %s at the moment") %
|
||||
name, exc_info=e)
|
||||
except dns.name.NameTooLong as e:
|
||||
logger.error(_("DNS name is too long: %s" % name), exc_info=e)
|
||||
else:
|
||||
return dns_answers
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user