From 9c089f1824e405ebb67ac1dd59c4cfc1304176be Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Sat, 5 Aug 2017 13:39:00 -0700 Subject: [PATCH] Include references from the original bug in replies --- debian/changelog | 2 ++ scripts/process | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 41458cf..23a313a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -57,6 +57,8 @@ debbugs (2.6.0~exp1) UNRELEASED; urgency=low path if the sendmail default is wrong. (Closes: #719205) * Fix links to merged and blocked bugs. (Closes: #539691) * Strip out Mail-Followup-To: (Closes: #798092) + * Include references from the original message in replies. (Closes: #485697) + Thanks to Julien Cristau [ Niels Thykier ] * quitcgi() now returns 400/500 status codes instead of 200 (Closes: #584922) diff --git a/scripts/process b/scripts/process index 38e4f90..d7eec80 100755 --- a/scripts/process +++ b/scripts/process @@ -180,7 +180,9 @@ for my $hdr (@headerlines) { $_ = $hdr; s/\n\s/ /g; finish() if m/^x-loop: (\S+)$/i && $1 eq "$gMaintainerEmail"; - my $ins = !m/^(?:(?:subject|reply-to|return-path|mail-followup-to): + my $ins = !m/^(?:(?:subject|reply-to|return-path| + mail-followup-to| + references): |From\s|X-Debbugs-)/xi; $fwd .= encode_utf8($hdr)."\n" if $ins; # print {$debugfh} ">$_<\n"; @@ -812,6 +814,12 @@ if (length($resentccval)) { $resentcc= "Resent-CC: $resentccval\n"; } +my $referencesval = join(' ',grep {defined $_} $header{'references'},$data->{msgid}); +my $references = ''; +if (!$newref && length($referencesval)) { + $references = "References: $referencesval\n"; +} + my $common_headers=''; { my @tmp = @common_headers; @@ -831,7 +839,7 @@ Resent-Sender: $gMaintainerEmail X-$gProject-PR-Message: report $ref X-$gProject-PR-Package: $data->{package} X-$gProject-PR-Keywords: $data->{keywords} -${source_pr_header} +${references}${source_pr_header} END chomp $enc_msg; $enc_msg = encode_utf8($enc_msg).$fwd."\n"; @@ -854,7 +862,7 @@ Resent-Sender: $gMaintainerEmail X-$gProject-PR-Message: $report_followup $ref X-$gProject-PR-Package: $data->{package} X-$gProject-PR-Keywords: $data->{keywords} -${source_pr_header} +${references}${source_pr_header} END chomp $enc_msg; $enc_msg = encode_utf8($enc_msg).$fwd."\n"; @@ -888,7 +896,7 @@ Resent-Sender: $gMaintainerEmail ${common_headers}X-$gProject-PR-Message: $report_followup $ref X-$gProject-PR-Package: $data->{package} X-$gProject-PR-Keywords: $data->{keywords} -${source_pr_header} +${references}${source_pr_header} END chomp $enc_msg; $enc_msg = encode_utf8($enc_msg).$fwd."\n"; -- 2.39.5