Handle invalid domains parsed through from mail

In mail 2.6.1, invalid domains are incorrectly parsed when they
shouldn't. For example, "..example.com" and "example..com" should be
invalid but mail parses them as valid.

Add a check for those cases and properly invalidate domains that are not
valid per rfc2822