]> git.donarmstrong.com Git - debbugs.git/commitdiff
Only remove list headers if the message appears to have traversed a mailing list...
authorDon Armstrong <don@donarmstrong.com>
Sun, 14 Oct 2012 00:41:51 +0000 (17:41 -0700)
committerDon Armstrong <don@donarmstrong.com>
Sun, 14 Oct 2012 00:41:51 +0000 (17:41 -0700)
debian/changelog
scripts/process

index a78ad5b6552c9a753515bb981ca2b4588fac2310..33fe18a5a5ed3dd7a3e3a1329f6ddd5d915c5ae1 100644 (file)
@@ -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).
index d919c66b22ec9ab984e9816ddb00aba990f3d2ad..c663dfd69782a59262095b36424ff5cd07cf6901 100755 (executable)
@@ -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;