Skip to content

Commit

Permalink
Allow dashes in DKIM selectors
Browse files Browse the repository at this point in the history
(when they're not the first character)
* Fixes #68
  • Loading branch information
ddavness committed Sep 8, 2022
1 parent fc04c8d commit 09cf3b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion management/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 09cf3b3

Please sign in to comment.