Package: devscripts
Version: 2.10.35
Severity: wishlist
Tags: patch

Hi,

Every bts-generated mail now always has a line like this:
# Automatically generated email from bts, devscripts version 2.10.35
this information is also duplicated in the X-BTS-Version header of the same 
mail thus appearing twice.

As there is a standardised header for specifying the version of the tool, and 
the version is hardly relevant for day to day use, I think it's desirable to 
move that info into the right header and leave it out of the mail body where 
it just clutters things, e.g. real comments by the user.

Please find attached a patch that fixes it.


cheers,
Thijs
Index: scripts/bts.pl
===================================================================
--- scripts/bts.pl	(revision 1580)
+++ scripts/bts.pl	(working copy)
@@ -1993,11 +1993,9 @@
     $message   .= "X-Debbugs-No-Ack: Yes\n" if $requestack==0;
     $message   .= "Subject: $subject\n"
 	       .  "Date: $date\n"
-               .  "X-BTS-Version: $version\n"
+               .  "User-Agent: devscripts bts/$version\n"
                .  "Message-ID: <$msgid>\n"
-               .  "\n"
-               .  "# Automatically generated email from bts,"
-                  . " devscripts version $version\n";
+               .  "\n";
 
     $body = addfooter($body);
     $body = confirmmail($message, $body);
@@ -2135,10 +2133,8 @@
 	$header   .= "Cc: $ccemail\n" if length $ccemail;
 	$header   .= "X-Debbugs-No-Ack: Yes\n" if $requestack==0;
 	$header   .= "Subject: $subject\n"
-		  .  "X-BTS-Version: $version\n"
-		  .  "\n"
-		  .  "# Automatically generated email from bts,"
-		  . " devscripts version $version\n";
+		  .  "User-Agent: devscripts bts/$version\n"
+		  .  "\n";
 
 	$body = addfooter($body);
 	$body = confirmmail($header, $body);
@@ -2160,7 +2156,6 @@
 	$SIG{'PIPE'} = sub { die "bts: pipe for mail broke\n"; };
 	if ($pid) {
 	    # parent
-	    print MAIL "# Automatically generated email from bts, devscripts version $version\n";
 	    print MAIL $body;
 	    close MAIL or die "bts: mail: $!\n";
 	}
@@ -2172,7 +2167,7 @@
 	    } else {
 		$ccemail =~ s/ //g;
 		my @args;
-		@args = ("-s", $subject, "-a", "X-BTS-Version: $version", $btsemail);
+		@args = ("-s", $subject, "-a", "User-Agent: devscripts bts/$version", $btsemail);
 		push(@args, "-c", "$ccemail") if $ccemail;
 		push(@args, "-a", "X-Debbugs-No-Ack: Yes")
 		    if $requestack==0;

Attachment: pgpvEdW7YE7Ql.pgp
Description: PGP signature

Reply via email to