Browse Source

Add ALIAS_DOMAINS config

Son NK 5 years ago
parent
commit
62017592e1
2 changed files with 8 additions and 1 deletions
  1. 5 1
      app/config.py
  2. 3 0
      example.env

+ 5 - 1
app/config.py

@@ -86,7 +86,11 @@ else:
     OTHER_ALIAS_DOMAINS = []
 
 # List of domains user can use to create alias
-ALIAS_DOMAINS = OTHER_ALIAS_DOMAINS + [EMAIL_DOMAIN]
+if "ALIAS_DOMAINS" in os.environ:
+    ALIAS_DOMAINS = eval(os.environ["ALIAS_DOMAINS"])  # ["domain1.com", "domain2.com"]
+else:
+    ALIAS_DOMAINS = OTHER_ALIAS_DOMAINS + [EMAIL_DOMAIN]
+
 ALIAS_DOMAINS = [d.lower().strip() for d in ALIAS_DOMAINS]
 
 # the alias domain used when creating the first alias for user

+ 3 - 0
example.env

@@ -24,6 +24,9 @@ ENFORCE_SPF=true
 # other domains that can be used to create aliases, in addition to EMAIL_DOMAIN
 OTHER_ALIAS_DOMAINS=["domain1.com", "domain2.com"]
 
+# domains that can be used to create aliases. If set, override OTHER_ALIAS_DOMAINS
+ALIAS_DOMAINS=["domain1.com", "domain2.com"]
+
 # the alias domain used when creating the first alias for user, default to EMAIL_DOMAIN if not set
 # FIRST_ALIAS_DOMAIN = another-domain.com