From: Don Armstrong Date: Sun, 14 Oct 2012 00:41:51 +0000 (-0700) Subject: Only remove list headers if the message appears to have traversed a mailing list... X-Git-Tag: release/2.6.0~332 X-Git-Url: https://git.donarmstrong.com/?p=debbugs.git;a=commitdiff_plain;h=c05083e5394af9c9cad1cfe84e188b9f82e2d2b4 Only remove list headers if the message appears to have traversed a mailing list to get to us. (closes: #690408) --- diff --git a/debian/changelog b/debian/changelog index a78ad5b..33fe18a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,8 @@ debbugs (2.4.2~exp2) UNRELEASED; urgency=low * Fix encoding in cgi * Fix installation of templates (closes: #686928). Thanks to Mike Gabriel. + * Only remove list headers if the message appears to have traversed a + mailing list to get to us. (closes: #690408) [Thanks to Arnout Engelen: ] * Add Homepage (closes: #670555). 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;