diff --git a/management/mailconfig.py b/management/mailconfig.py index b9709af3..30f40b2e 100755 --- a/management/mailconfig.py +++ b/management/mailconfig.py @@ -93,7 +93,11 @@ def validate_email(email, mode=None): # Check the syntax of the address. try: # allow .local domains to pass when they refer to the local machine - email_domain = get_domain(email) + try: + email_domain = get_domain(email) + except IndexError: + raise EmailNotValidError(email) + test_env = ( email_domain.endswith(".local") and email_domain == socket.getfqdn()