Code

send-email: rfc822 forbids using <address@domain> without a non-empty "phrase"
authorUwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Thu, 9 Aug 2007 13:27:57 +0000 (15:27 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Aug 2007 08:00:51 +0000 (01:00 -0700)
Email::Valid does respect this considering such a mailbox specification
invalid.  b06c6bc831cbb9e9eb82fd3ffd5a2b674cd940d0 addressed the issue, but
only if Email::Valid is available.

Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl

index 39e433b76b28ce7c2d9299024cc9202fa525f580..a02ab9694fdfb3d6f368278f20c367277bef6d07 100755 (executable)
@@ -408,8 +408,8 @@ sub extract_valid_address {
        # check for a local address:
        return $address if ($address =~ /^($local_part_regexp)$/);
 
+       $address =~ s/^\s*<(.*)>\s*$/$1/;
        if ($have_email_valid) {
-               $address =~ s/^\s*<(.*)>\s*$/$1/;
                return scalar Email::Valid->address($address);
        } else {
                # less robust/correct than the monster regexp in Email::Valid,