Re: Failure to extra stable@vger.kernel.org addresses
- From
Andreas Schwab <schwab@linux-m68k.org>
- Date
- Nov 20, 2012, 19:58 UTC
- Message-ID
- <m2lidw11yb.fsf@igel.home>
- In-Reply-To
- <20121120115942.GA6132@shrek.podlesie.net>
Krzysztof Mazur <krzysiek@podlesie.net> writes:
Show 21 quoted lines
> On Tue, Nov 20, 2012 at 11:28:39AM +0100, Felipe Contreras wrote:
>> On Tue, Nov 20, 2012 at 8:56 AM, Krzysztof Mazur <krzysiek@podlesie.net> wrote:
>>
>> > --- a/git-send-email.perl
>> > +++ b/git-send-email.perl
>> > @@ -925,8 +925,11 @@ sub quote_subject {
>> > sub sanitize_address {
>> > my ($recipient) = @_;
>> >
>> > + my $local_part_regexp = qr/[^<>"\s@]+/;
>> > + my $domain_regexp = qr/[^.<>"\s@]+(?:\.[^.<>"\s@]+)+/;
>> > +
>> > # remove garbage after email address
>> > - $recipient =~ s/(.*>).*$/$1/;
>> > + $recipient =~ s/^(.*?<$local_part_regexp\@$domain_regexp>).*/$1/;
>>
>> I don't think all that extra complexity is warranted, to me
>> s/(.*?>)(.*)$/$1/ is just fine.
>>
>
> Yeah, it's a little bit too complex, but "s/(.*?>)(.*)$/$1/"How about "s/(.*?<[^>]*>).*$/$1/"? That will still fail on "<foo@bar>" <foo@bar>, but you'll need a full rfc822 parser to handle the general case anyway.
Andreas.
-- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."