1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-11-26 02:57:04 +00:00

default IPv6 AAAA records were missing

This was broken by the ability to have multiple TXT records in 9f1d633ae4.
This commit is contained in:
Joshua Tauberer 2015-06-17 06:18:32 -04:00
parent 9e0dcd8718
commit 2af557139d
2 changed files with 11 additions and 2 deletions

View File

@ -13,6 +13,9 @@ Web:
* 'www' subdomains now automatically redirect to their parent domain (but you'll need to install an SSL certificate). * 'www' subdomains now automatically redirect to their parent domain (but you'll need to install an SSL certificate).
* OCSP no longer uses Google Public DNS. * OCSP no longer uses Google Public DNS.
DNS:
* Default IPv6 AAAA records were missing since version 0.09.
Control panel: Control panel:
* Resetting a user's password now forces them to log in again everywhere. * Resetting a user's password now forces them to log in again everywhere.

View File

@ -213,8 +213,11 @@ def build_zone(domain, all_domains, additional_records, www_redirect_domains, en
records.append((qname, rtype, value, "(Set by user.)")) records.append((qname, rtype, value, "(Set by user.)"))
# Add defaults if not overridden by the user's custom settings (and not otherwise configured). # Add defaults if not overridden by the user's custom settings (and not otherwise configured).
# Any "CNAME" record on the qname overrides A and AAAA. # Any CNAME or A record on the qname overrides A and AAAA. But when we set the default A record,
has_rec_base = records # we should not cause the default AAAA record to be skipped because it thinks a custom A record
# was set. So set has_rec_base to a clone of the current set of DNS settings, and don't update
# during this process.
has_rec_base = list(records)
defaults = [ defaults = [
(None, "A", env["PUBLIC_IP"], "Required. May have a different value. Sets the IP address that %s resolves to for web hosting and other services besides mail. The A record must be present but its value does not affect mail delivery." % domain), (None, "A", env["PUBLIC_IP"], "Required. May have a different value. Sets the IP address that %s resolves to for web hosting and other services besides mail. The A record must be present but its value does not affect mail delivery." % domain),
(None, "AAAA", env.get('PUBLIC_IPV6'), "Optional. Sets the IPv6 address that %s resolves to, e.g. for web hosting. (It is not necessary for receiving mail on this domain.)" % domain), (None, "AAAA", env.get('PUBLIC_IPV6'), "Optional. Sets the IPv6 address that %s resolves to, e.g. for web hosting. (It is not necessary for receiving mail on this domain.)" % domain),
@ -234,6 +237,9 @@ def build_zone(domain, all_domains, additional_records, www_redirect_domains, en
if not has_rec(qname, rtype) and not has_rec(qname, "CNAME") and not has_rec(qname, "A"): if not has_rec(qname, rtype) and not has_rec(qname, "CNAME") and not has_rec(qname, "A"):
records.append((qname, rtype, value, explanation)) records.append((qname, rtype, value, explanation))
# Don't pin the list of records that has_rec checks against anymore.
has_rec_base = records
# SPF record: Permit the box ('mx', see above) to send mail on behalf of # SPF record: Permit the box ('mx', see above) to send mail on behalf of
# the domain, and no one else. # the domain, and no one else.
# Skip if the user has set a custom SPF record. # Skip if the user has set a custom SPF record.