Skip to content

Commit

Permalink
permit the first user account to be a domain control validation addre…
Browse files Browse the repository at this point in the history
…ss because a) it will necessarily be an admin and b) the user doesn't know the rules yet
  • Loading branch information
JoshData committed May 3, 2015
1 parent ce94ef3 commit fc32cf5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions management/mailconfig.py
Expand Up @@ -254,9 +254,10 @@ def add_mail_user(email, pw, privs, env):
return ("Invalid email address.", 400)
elif not validate_email(email, mode='user'):
return ("User account email addresses may only use the ASCII letters A-Z, the digits 0-9, underscore (_), hyphen (-), and period (.).", 400)
elif is_dcv_address(email):
elif is_dcv_address(email) and len(get_mail_users(env)) > 0:
# Make domain control validation hijacking a little harder to mess up by preventing the usual
# addresses used for DCV from being user accounts.
# addresses used for DCV from being user accounts. Except let it be the first account because
# during box setup the user won't know the rules.
return ("You may not make a user account for that address because it is frequently used for domain control validation. Use an alias instead if necessary.", 400)

# validate password
Expand Down

0 comments on commit fc32cf5

Please sign in to comment.