From 005a760710420ee8de6af0959865f2a0ffee0ab6 Mon Sep 17 00:00:00 2001 From: Son Nguyen Kim Date: Mon, 20 Sep 2021 12:32:39 +0200 Subject: [PATCH] handle case catch_all is enabled but custom_domain.auto_create_regex is already set --- app/alias_utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/alias_utils.py b/app/alias_utils.py index 8b67402c..e90bdc1c 100644 --- a/app/alias_utils.py +++ b/app/alias_utils.py @@ -132,11 +132,10 @@ def try_auto_create_catch_all_domain(address: str) -> Optional[Alias]: if not custom_domain: return None - # custom_domain exists if not custom_domain.catch_all and not custom_domain.auto_create_regex: return None - if custom_domain.auto_create_regex: + if custom_domain.auto_create_regex and not custom_domain.catch_all: local = get_email_local_part(address) regex = re.compile(custom_domain.auto_create_regex) if not re.fullmatch(regex, local):