Trim and tolower in email domain validation

Incorporated @polastre from #345 that didn't make it in to the previous PR.