mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2026-03-05 15:57:23 +01:00
Support dual-stack IPv4/IPv6 mail servers
Addresses #3 Added support by adding parallel code wherever `$PUBLIC_IP` was used. Providing an IPv6 address is completely optional. Playing around on my IPv6-enabled mail server revealed that — before this change — mailinabox might try to use an IPv6 address as the value for `$PUBLIC_IP`, which wouldn't work out well.
This commit is contained in:
@@ -60,9 +60,13 @@ def build_zone(domain, env):
|
||||
records.append((None, "NS", "ns1.%s." % env["PUBLIC_HOSTNAME"]))
|
||||
records.append((None, "NS", "ns2.%s." % env["PUBLIC_HOSTNAME"]))
|
||||
records.append((None, "A", env["PUBLIC_IP"]))
|
||||
if env.get('PUBLIC_IPV6'):
|
||||
records.append((None, "AAAA", env["PUBLIC_IPV6"]))
|
||||
records.append((None, "MX", "10 %s." % env["PUBLIC_HOSTNAME"]))
|
||||
records.append((None, "TXT", '"v=spf1 mx -all"'))
|
||||
records.append(("www", "A", env["PUBLIC_IP"]))
|
||||
if env.get('PUBLIC_IPV6'):
|
||||
records.append(("www", "AAAA", env["PUBLIC_IPV6"]))
|
||||
|
||||
# In PUBLIC_HOSTNAME, also define ns1 and ns2.
|
||||
if domain == env["PUBLIC_HOSTNAME"]:
|
||||
|
||||
Reference in New Issue
Block a user