diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ecb77a4..5461c564 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ In Development * ownCloud updated to version 8.0.3. * SMTP Submission (port 587) began offering the insecure SSLv3 protocol due to a misconfiguration in the previous version. +* Users and aliases weren't working if they were entered with any uppercase letters. Now only lowercase is allowed. v0.09 (May 8, 2015) ------------------- diff --git a/management/mailconfig.py b/management/mailconfig.py index a7a80372..e7419e75 100755 --- a/management/mailconfig.py +++ b/management/mailconfig.py @@ -32,8 +32,11 @@ def validate_email(email, mode=None): # unusual characters in the address. Bah. Also note that since # the mailbox path name is based on the email address, the address # shouldn't be absurdly long and must not have a forward slash. + # Our database is case sensitive (oops), which affects mail delivery + # (Postfix always queries in lowercase?), so also only permit lowercase + # letters. if len(email) > 255: return False - if re.search(r'[^\@\.a-zA-Z0-9_\-]+', email): + if re.search(r'[^\@\.a-z0-9_\-]+', email): return False # Everything looks good. @@ -253,7 +256,7 @@ def add_mail_user(email, pw, privs, env): elif not validate_email(email): 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) + return ("User account email addresses may only use the lowercase ASCII letters a-z, the digits 0-9, underscore (_), hyphen (-), and period (.).", 400) 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. Except let it be the first account because @@ -403,6 +406,10 @@ def add_mail_alias(source, destination, env, update_if_exists=False, do_kick=Tru # convert Unicode domain to IDNA source = sanitize_idn_email_address(source) + # Our database is case sensitive (oops), which affects mail delivery + # (Postfix always queries in lowercase?), so force lowercase. + source = source.lower() + # validate source source = source.strip() if source == "":