Bug 912055 - validate email addresses

Taking over this bug from @dpoirier who's moved on to other things. This replaces PR #86.