From 09cf3b37557befd1ffcd491cfd6fe40197e11195 Mon Sep 17 00:00:00 2001 From: David Duque Date: Thu, 8 Sep 2022 16:00:08 +0100 Subject: [PATCH] Allow dashes in DKIM selectors (when they're not the first character) * Fixes #68 --- management/daemon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/management/daemon.py b/management/daemon.py index 3a3767c..0a49f11 100755 --- a/management/daemon.py +++ b/management/daemon.py @@ -878,7 +878,7 @@ def smtp_relay_set(): if sel is None or sel.strip() == "": config["SMTP_RELAY_DKIM_SELECTOR"] = None config["SMTP_RELAY_DKIM_RR"] = None - elif re.fullmatch(r"[a-z\d\._]+", sel.strip()) is None: + elif re.fullmatch(r"[a-z\d\._][a-z\d\._\-]*", sel.strip()) is None: return ("The DKIM selector is invalid!", 400) # DKIM selector looks good, try processing the RR