Package: devscripts
Followup-For: Bug #809318

As I understand, the normal bug is about "DEFAULTING TO DEFAULT sendmail".

Then its fix should be "die" instead of stop doing sanity check.

What do you think of attached patch.

Osamu

>From ee5b19c7fc488cc503c7ede427492f40e3c5c3da Mon Sep 17 00:00:00 2001
From: Osamu Aoki <os...@debian.org>
Date: Thu, 10 Mar 2016 20:25:49 +0000
Subject: [PATCH] bts: Fail if sendmail is broken

---
 scripts/bts.pl | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/scripts/bts.pl b/scripts/bts.pl
index e431c6f..8d64f6e 100755
--- a/scripts/bts.pl
+++ b/scripts/bts.pl
@@ -542,11 +542,9 @@ if (@ARGV and $ARGV[0] =~ /^--no-?conf$/) {
         and $config_vars{'BTS_SENDMAIL_COMMAND'} ne '/usr/sbin/sendmail') {
 	my $cmd = (split ' ', $config_vars{'BTS_SENDMAIL_COMMAND'})[0];
 	unless ($cmd =~ /^~?[A-Za-z0-9_\-\+\.\/]*$/) {
-	    warn "BTS_SENDMAIL_COMMAND contained funny characters: $cmd\nReverting to default value /usr/sbin/sendmail\n";
-	    $config_vars{'BTS_SENDMAIL_COMMAND'}='/usr/sbin/sendmail';
+	    die "BTS_SENDMAIL_COMMAND contained funny characters: $cmd\nPlease fix configuration file.\n";
 	} elsif (system("command -v $cmd >/dev/null 2>&1") != 0) {
-	    warn "BTS_SENDMAIL_COMMAND $cmd could not be executed.\nReverting to default value /usr/sbin/sendmail\n";
-	    $config_vars{'BTS_SENDMAIL_COMMAND'}='/usr/sbin/sendmail';
+	    die "BTS_SENDMAIL_COMMAND $cmd could not be executed.\nPlease fix configuration file.\n";
 	}
     }
 
@@ -678,11 +676,9 @@ if ($opt_sendmail) {
 	and $opt_sendmail ne $sendmailcmd) {
 	my $cmd = (split ' ', $opt_sendmail)[0];
 	unless ($cmd =~ /^~?[A-Za-z0-9_\-\+\.\/]*$/) {
-	    warn "--sendmail command contained funny characters: $cmd\nReverting to default value $sendmailcmd\n";
-	    undef $opt_sendmail;
+	    die "--sendmail command contained funny characters: $cmd\n";
 	} elsif (system("command -v $cmd >/dev/null 2>&1") != 0) {
-	    warn "--sendmail command $cmd could not be executed.\nReverting to default value $sendmailcmd\n";
-	    undef $opt_sendmail;
+	    die "--sendmail command $cmd could not be executed.\n";
 	}
     }
 }
-- 
2.7.0

Reply via email to