A customer noted that the login by email was case-sensitive, which differs to the handling of the loginname.
This PR changes the email check to be case-insensitive (which it was already in same parts) and improve the search for this as well.
(cherry picked from commit 7e24a1adbce724d3b999db39c005a00d5e74334d)