From 62017592e1566d14a7806afd9ea14e8e07cdee1e Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Mon, 25 May 2020 19:51:30 +0200 Subject: [PATCH] Add ALIAS_DOMAINS config --- app/config.py | 6 +++++- example.env | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/config.py b/app/config.py index 218613c5..048dbca2 100644 --- a/app/config.py +++ b/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 diff --git a/example.env b/example.env index f55db586..53d38731 100644 --- a/example.env +++ b/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