handle the 2 consecutive dots in alias

This commit is contained in:
Son 2021-12-31 11:15:24 +01:00
parent e3d06f7a1d
commit 61226545c2
1 changed files with 6 additions and 0 deletions

View File

@ -104,6 +104,12 @@ def new_custom_alias_v2():
LOG.d("full alias already used %s", full_alias)
return jsonify(error=f"alias {full_alias} already exists"), 409
if ".." in full_alias:
return (
jsonify(error="2 consecutive dot signs aren't allowed in an email address"),
400,
)
custom_domain = get_custom_domain(full_alias)
alias = Alias.create(