deal with login from email (bug 1095504, bug 1094498)
Merge pull request #780 from washort/1095504

deal with login from email (bug 1095504, bug 1094498)