Simplistic / Faulty Email Validation
Whilst trying to debug a failing ldap account I had a feeling that it was probably related to the email address that was assigned to the account. I was able to confirm this on my dev box and after a bit more digging found the validator in GitLab that is being used to validate email addresses. https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/email_validator.rb
The problem is that the regex is very simplistic and could potentially block a number of valid email addresses (and if I wanted to be picky accepts invalid addresses that have whitespace at the beginning or end).
The account that was trying to register had an # in its email address, which according to https://en.wikipedia.org/wiki/Email_address is allowed, but GitLab is rejecting it. This is also confirmed by trying to add the email address test.#user@example.com to an existing account which is also rejected.
At the moment the regex appears to be only accepting alphanumeric, -, +, ., _ & ' in the local portion, but as can be seen on the wikipedia article it should be able to accept a lot more. For some reason the local portion is only allowed to be up to 64 characters long, which given that the db field for is 255 characters seems a bit restrictive. It also only appears to handle Roman characters but email addresses, and domains, could contain unicode characters these days.