This patch adds user email validation back, but it only validates the email address format if the email isn't nil. Note: when creating a user using the web app form, when you don't fill the email address in it's "", not nil. This is intentional, we want to validate emails unless it's nil, which is the case for ldap user authentication -> user creation.