hallelujah/valid_email — pull request #39 by mocoso (2014-10-08 05:33:54+00:00)
Title: Stop rescuing all exceptions

There are a number of places where valid_email rescues from any `Exception` and simply returns false.

This is a dangerous pattern in that it fails to distinguish between exceptions we are expecting and genuinely indicate that an email is invalid e.g. Mail::Field:ParserError when parsing an email address vs. other exceptions which may mean anything at all. In this pull request I have removed all the genereric rescues and where appropriate replaced them with the specific Exception I think we are expecting.

There is a possibility that I have missed some exceptions that we are genuinely expecting and would like to interpret as invalid email addresses, in which case this pull request would change behaviour inadvertently. If you can think of any instances then please say.