Bug#688344: Handling of gSubscriptionDomain and gBugSubscriptionDomain

Mike Gabriel <[email protected]>
Newsgroups gmane.linux.debian.devel.debbugs
Message-ID <[email protected]>
Package: debbugs
Severity: normal
Version: 2.4.2~exp2
Tags: patch

Hi Don,

attached is a patch against your latest Git repos that fixes the  
handline of undefined (or defined as "") variables gSubscriptionDomain  
and gBugSubscriptionDomain.

In my setup the process script sent out mails like hell, though I had  
the variables defined as "" in the config file.

Mike


-- 

DAS-NETZWERKTEAM
mike gabriel, rothenstein 5, 24214 neudorf-bornstein
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: [email protected], http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb
0002-Make-sure-that-mails-to-gSubscriptionDomain-and-gBug.patch (text/x-diff, 3.3 KB)
>From 7c95815e7b47588e4982238e099fa48eb2e78ee3 Mon Sep 17 00:00:00 2001
From: Mike Gabriel <[email protected]>
Date: Fri, 21 Sep 2012 21:57:14 +0200
Subject: [PATCH 2/2] Make sure that mails to gSubscriptionDomain and
 gBugSubscriptionDomain are only sent out if the
 variables in config are defined and have a lenght < 0.

---
 debian/changelog |    3 +++
 scripts/process  |   22 ++++++++++++++++------
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 786f92b..1d062f9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -41,6 +41,9 @@ debbugs (2.4.2~exp2) UNRELEASED; urgency=low
   * Update postfix section in Readme.mail. Closes: #688109.
   * Provide gStrongList configuration option in config file to make
     a site admin aware of its existence.
+  * Make sure that mails to gSubscriptionDomain and gBugSubscriptionDomain
+    are only sent out if the variables in config are defined and
+    have a lenght < 0.
 
  -- Don Armstrong <[email protected]>  Wed, 25 Aug 2010 01:57:38 -0700
 
diff --git a/scripts/process b/scripts/process
index 4dd56fd..9fb2c2f 100755
--- a/scripts/process
+++ b/scripts/process
@@ -447,8 +447,16 @@ if ($codeletter eq 'D' || $codeletter eq 'F')
 
 	# Add bug mailing list to $generalbcc as appropriate
  	# This array is used to specify bcc in the cases where we're using create_mime_message.
- 	my @generalbcc = (@generalcc,@addsrcaddrs,"bugs=$ref\@$gListDomain");
-	my $generalbcc = join(', ', $generalcc, @addsrcaddrs,"bugs=$ref\@$gListDomain");
+	my @generalbcc = @generalcc;
+	my $generalbcc = $generalcc;
+	if (defined $config{subscription_domain} and length $config{subscription_domain}) {
+	    my @generalbcc = (@generalbcc, @addsrcaddrs);
+	    my $generalbcc = join(', ', $generalbcc, @addsrcaddrs);
+	}
+	if (defined $config{bug_subscription_domain} and length $config{bug_subscription_domain}) {
+	    my @generalbcc = (@generalbcc, "bugs=$ref\@$config{bug_subscription_domain}");
+	    my $generalbcc = join(', ', $generalbcc, "bugs=$ref\@$config{bug_subscription_domain}");
+	}
 	$generalbcc =~ s/\s+\n\s+/ /g;
 	$generalbcc =~ s/^\s+/ /; $generalbcc =~ s/\s+$//;
 	if (length $generalbcc) {$generalbcc = "Bcc: $generalbcc\n"};
@@ -721,7 +729,9 @@ if (defined $gStrongList and isstrongseverity($data->{severity})) {
 }
 
 # Send mail to the per bug list subscription too
-#push @bccs, "bugs=$ref\@$gListDomain";
+if (defined $config{bug_subscription_domain} and length $config{bug_subscription_domain}) {
+    push @bccs, "bugs=$ref\@$config{bug_subscription_domain}";
+}
 
 if (defined $pheader{source}) {
     # Prefix source versions with the name of the source package. They
@@ -1260,15 +1270,15 @@ sub checkmaintainers {
 	$p =~ /((?:src:)?[a-z0-9.+-]+)/;
 	$p = $1;
 	next unless defined $p;
-	if (defined $gSubscriptionDomain) {
+        if (defined $config{subscription_domain} and length $config{subscription_domain}) {
 	    my @source = binary_to_source(binary => $p,
 					  source_only => 1,
 					 );
 	    if (@source) {
 		push @addsrcaddrs,
-		    map {"$_\@$gSubscriptionDomain"} @source;
+		    map {"$_\@$config{subscription_domain}"} @source;
 	    } else {
-		push @addsrcaddrs, "$p\@$gSubscriptionDomain";
+		push @addsrcaddrs, "$p\@$config{subscription_domain}";
 	    }
 	}
 	# this is utter hackery until we switch to Debbugs::Recipients
-- 
1.7.10
signature.asc (application/pgp-signature, 836 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIcBAABAgAGBQJQXMdhAAoJEJr0azAldxsxk90QAKgwgEsZQh66lfrHy2ivtaWV
CdNHYCLtyDXzj8c4IlarriNSXonOm+A7PfGoER8KaEQHz+axyGEQzcd27+X8tpvA
R/1TJt6g0bP8XoF2hM8wASzjQyhSTwD8MiR0sYzJf+Eyi+47K/qJBZX1Ru/phCSw
cHZAMUSYhaUJfl7AzpVVm3Q/w/4YLtjYbPqFzqNdW3aP/XLQOrnOzajlMjSeirEZ
8yWgDJz4Yx2pjNJsuYfREhXgppePBsx1wFoUHY9CCiqbpQIpBd5mBYecoT045mSK
6/Tc5UDoR7cdPn2jtynj4ych0ejRaBRqoPPLF57PQCpSxrf960rT8f1fxGYAjN5y
YUeIJvZhEr2hgVRnIJd7iyvbTZjQnlNHXsBT7Mw7apTT1b094vJzPI4VsW939gpD
BS792x0K3uSWyHSFahT2gkg0Pmr/PooIsDAe4Y2MVUQSCvXtTMh5O8t+RxukedXB
KcZRgd7BTVOdReYF097rdg4xMwKpLcwxLyeneHAQ4G0js7OHDCw+g+0FvxpjsXog
wedstU2ht0geqMgDSWBOh9PcLYgkDPO3ThN8Reu6NJk/9QtS5dBZjlIJGzEd8K7m
zXs2cYcxxBKQef6LBQtjyS3ZQyeqPwiMSInytCILQRsbU8in/yujQUwtvE2UG0RK
GlgMmHFGXh1ILC6ldv9M
=6A8J
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.