X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Fprocess;h=c663dfd69782a59262095b36424ff5cd07cf6901;hb=c05083e5394af9c9cad1cfe84e188b9f82e2d2b4;hp=d919c66b22ec9ab984e9816ddb00aba990f3d2ad;hpb=abbdfc37780341b158dc3d01ab4f75ce15848262;p=debbugs.git diff --git a/scripts/process b/scripts/process index d919c66..c663dfd 100755 --- a/scripts/process +++ b/scripts/process @@ -275,8 +275,18 @@ if (!defined($header{'subject'})) my $ref=-1; # remove Re: from the subject line $subject =~ s/^Re:\s*//i; -# remove remaining mailing list name markers from the subject line -$subject =~ s/^\[.*\]\s*//i; +# remove remaining mailing list name markers from the subject line if +# this appears to be a message that has traversed a mailing list +if (exists $header{'list-id'} or exists $header{'list-subscribe'} or + (exists $header{'precedence'} and defined $header{'precedence'} and + $header{'precedence'} eq 'bulk') or + exists $header{'mailing-list'} or exists $header{'list-processor-version'} + ){ + # if a mailing list didn't match any of the above, it's probably + # so horribly configured that we wouldn't be able to figure it out + # anyway. + $subject =~ s/^\[.*\]\s*//i; +} $_= $subject."\n"; if (not defined $tryref and m/^Bug ?\#(\d+)\D/i) { $tryref = $1 if $1 > 0;