From: Greg KH Date: Fri, 13 Jul 2007 06:34:14 GMT Subject: Re: [PATCH] make git-send-email.perl handle email addresses with no names when Email::Valid is present Message-ID: <20070713063414.GN24317@kroah.com> In-Reply-To: <7vr6ncrh22.fsf@assigned-by-dhcp.cox.net> On Thu, Jul 12, 2007 at 10:47:17PM -0700, Junio C Hamano wrote: > Greg KH writes: > > > When using git-send-email.perl on a changeset that has: > > Cc: > > in the body of the description, and the Email::Valid perl module is > > installed on the system, the email address will be deemed "invalid" for > > some reason (Email::Valid isn't smart enough to handle this?) and > > complain and not send the address the email. > > That appears to be the case. > > bad foo > bad > ok foo@bar.baz > ok Foo > > > Anyway, this tiny patch fixes this problem for me. Note, my perl-foo is > > quite week, so this could probably be easily done in one line for those > > with better reg-ex skills. > > > --- a/git-send-email.perl > > +++ b/git-send-email.perl > > @@ -410,6 +410,9 @@ sub extract_valid_address { > > return $address if ($address =~ /^($local_part_regexp)$/); > > > > if ($have_email_valid) { > > + if ($address =~ s/^ > + $address =~ s/>$//; > > + } > > return scalar Email::Valid->address($address); > > } else { > > I'd probably do: > > if ($have_email_valid) { > $address =~ s/^<(.*)>$/$1/; Ah, yeah, that looks better :) Thanks for the fix, greg k-h