1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-04-21 03:02:09 +00:00

Secondary name server could not be set

This commit is contained in:
yodax 2017-07-20 06:50:09 +02:00
parent a16855ecf0
commit 6056949191

View File

@ -764,12 +764,12 @@ def set_custom_dns_record(qname, rtype, value, action, env):
if qname != "_secondary_nameserver":
raise ValueError("%s is not a domain name or a subdomain of a domain name managed by this box." % qname)
if not re.search(DOMAIN_RE, qname):
raise ValueError("Invalid name.")
# validate rtype
rtype = rtype.upper()
if value is not None and qname != "_secondary_nameserver":
if not re.search(DOMAIN_RE, qname):
raise ValueError("Invalid name.")
if rtype in ("A", "AAAA"):
if value != "local": # "local" is a special flag for us
v = ipaddress.ip_address(value) # raises a ValueError if there's a problem