Re: Failure to extra stable@vger.kernel.org addresses
- From
- Krzysztof Mazur <krzysiek@podlesie.net>
- Date
- Nov 20, 2012, 23:09 UTC
- Message-ID
- <20121120230955.GA9686@shrek.podlesie.net>
- In-Reply-To
- <7vhaojrjpx.fsf@alter.siamese.dyndns.org>
On Tue, Nov 20, 2012 at 02:30:02PM -0800, Junio C Hamano wrote:
Show 29 quoted lines
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
> > On Tue, Nov 20, 2012 at 10:21 PM, Krzysztof Mazur <krzysiek@podlesie.net> wrote:
> >
> >> --- a/git-send-email.perl
> >> +++ b/git-send-email.perl
> >> @@ -924,6 +924,10 @@ sub quote_subject {
> >> # use the simplest quoting being able to handle the recipient
> >> sub sanitize_address {
> >> my ($recipient) = @_;
> >> +
> >> + # remove garbage after email address
> >> + $recipient =~ s/(.*?<[^>]*>).*$/$1/;
> >
> > That won't work for 'foo@bar.com # test'. I think we should abandon
> > hopes of properly parsing an email address and just do:
> >
> > $recipient =~ s/(.*?) #.*$/$1/;
>
> We should probably fix the tools that generate these bogus
> non-addresses first. What's wrong with
>
> Cc: stable kernel (v3.5 v3.6 v3.7) <stable@vger.kernel.org>
>
> which should be OK?
>
> Also I suspect that this should be also deemed valid:
>
> Cc: stable@vger.kernel.org (Stable kernel - v3.5 v3.6 v3.7)So maybe we should just use the original regex:
$recipient =~ s/(.*>).*$/$1/
which does not add regression for valid addresses, and just fails in some rare cases when '>' is used in garbage. It was sufficient for original issue reported by, and tested by Felipe.
The problem with '>' would be fixed in separate patch. The same problem exits for invalid address generated by --cc-cmd (see [PATCH] git-send-email: don't return undefined value in extract_valid_address()). We would report an error in both cases, as suggested by Junio.
Krzysiek