mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-06-08 19:00:55 +00:00
Added autoconfig/autodiscover to domains, A record generation, and clarified DNS page verbage
This commit is contained in:
parent
0e69c5e8fc
commit
8c1b912b9b
@ -288,13 +288,15 @@ def build_zone(domain, all_domains, additional_records, www_redirect_domains, en
|
|||||||
if not has_rec(qname, "SRV"):
|
if not has_rec(qname, "SRV"):
|
||||||
records.append((qname, "SRV", "0 0 443 " + env["PRIMARY_HOSTNAME"] + ".", "Recommended. Specifies the hostname of the server that handles CardDAV/CalDAV services for email addresses on this domain."))
|
records.append((qname, "SRV", "0 0 443 " + env["PRIMARY_HOSTNAME"] + ".", "Recommended. Specifies the hostname of the server that handles CardDAV/CalDAV services for email addresses on this domain."))
|
||||||
|
|
||||||
# Adds CNAME records for hosted email address domains (Email addresses that are added apart from the PRIMARY_HOSTNAME)
|
# Adds autoconfiguration A records for all domains.
|
||||||
|
# This allows the following clients to automatically configure email addresses in the respective applications.
|
||||||
# autodiscover.* - Z-Push ActiveSync Autodiscover
|
# autodiscover.* - Z-Push ActiveSync Autodiscover
|
||||||
# autoconfig.* - Thunderbird Autoconfig
|
# autoconfig.* - Thunderbird Autoconfig
|
||||||
if domain != env["PRIMARY_HOSTNAME"]:
|
if domain != env["PRIMARY_HOSTNAME"]:
|
||||||
for qname in ("autodiscover", "autoconfig"):
|
if not has_rec("autodiscover", "A"):
|
||||||
if not has_rec(qname, "CNAME"):
|
records.append(("autodiscover", "A", env["PUBLIC_IP"], "Provides email configuration autodiscovery support for Z-Push ActiveSync Autodiscover."))
|
||||||
records.append((qname, "CNAME", env["PRIMARY_HOSTNAME"] + ".", "Provides autodiscovery support for hosted email address domains."))
|
if not has_rec("autoconfig", "A"):
|
||||||
|
records.append(("autoconfig", "A", env["PUBLIC_IP"], "Provides email configuration autodiscovery support for Thunderbird Autoconfig."))
|
||||||
|
|
||||||
# Sort the records. The None records *must* go first in the nsd zone file. Otherwise it doesn't matter.
|
# Sort the records. The None records *must* go first in the nsd zone file. Otherwise it doesn't matter.
|
||||||
records.sort(key = lambda rec : list(reversed(rec[0].split(".")) if rec[0] is not None else ""))
|
records.sort(key = lambda rec : list(reversed(rec[0].split(".")) if rec[0] is not None else ""))
|
||||||
|
@ -29,6 +29,12 @@ def get_web_domains(env, include_www_redirects=True, exclude_dns_elsewhere=True)
|
|||||||
# IP address than this box. Remove those domains from our list.
|
# IP address than this box. Remove those domains from our list.
|
||||||
domains -= get_domains_with_a_records(env)
|
domains -= get_domains_with_a_records(env)
|
||||||
|
|
||||||
|
# Add Autoconfiguration domains, allowing us to serve correct SSL certs.
|
||||||
|
# 'autoconfig.' for Mozilla Thunderbird auto setup.
|
||||||
|
# 'autodiscover.' for Activesync autodiscovery.
|
||||||
|
domains |= set('autoconfig.' + zone for zone, zonefile in get_dns_zones(env))
|
||||||
|
domains |= set('autodiscover.' + zone for zone, zonefile in get_dns_zones(env))
|
||||||
|
|
||||||
# Ensure the PRIMARY_HOSTNAME is in the list so we can serve webmail
|
# Ensure the PRIMARY_HOSTNAME is in the list so we can serve webmail
|
||||||
# as well as Z-Push for Exchange ActiveSync. This can't be removed
|
# as well as Z-Push for Exchange ActiveSync. This can't be removed
|
||||||
# by a custom A/AAAA record and is never a 'www.' redirect.
|
# by a custom A/AAAA record and is never a 'www.' redirect.
|
||||||
|
Loading…
Reference in New Issue
Block a user