summaryrefslogtreecommitdiffstats
path: root/contrib/bug_email.pl
diff options
context:
space:
mode:
authorbbaetz%acm.org <>2003-11-22 12:50:36 +0100
committerbbaetz%acm.org <>2003-11-22 12:50:36 +0100
commitda857afa089e79ad16fb833dd1ffe397055fd892 (patch)
tree4582f630aa59c35fdb25aa30fd71c617977e0a86 /contrib/bug_email.pl
parent63790559f094b702688365ed12242526ce3ff969 (diff)
downloadbugzilla-da857afa089e79ad16fb833dd1ffe397055fd892.tar.gz
bugzilla-da857afa089e79ad16fb833dd1ffe397055fd892.tar.xz
Bug 208604 - Make data/template dir locations configurable
Diffstat (limited to 'contrib/bug_email.pl')
-rwxr-xr-xcontrib/bug_email.pl25
1 files changed, 14 insertions, 11 deletions
diff --git a/contrib/bug_email.pl b/contrib/bug_email.pl
index a1e537cfe..e26b9a68c 100755
--- a/contrib/bug_email.pl
+++ b/contrib/bug_email.pl
@@ -37,7 +37,7 @@
#
# You need to work with bug_email.pl the MIME::Parser installed.
#
-# $Id: bug_email.pl,v 1.16 2003/08/22 14:59:13 justdave%syndicomm.com Exp $
+# $Id: bug_email.pl,v 1.17 2003/11/22 03:50:41 bbaetz%acm.org Exp $
###############################################################
# 02/12/2000 (SML)
@@ -69,12 +69,15 @@
use strict;
use MIME::Parser;
-chdir '..'; # this script lives in contrib
-push @INC, "contrib/.";
-push @INC, ".";
+BEGIN {
+ chdir '..'; # this script lives in contrib
+ push @INC, "contrib/.";
+ push @INC, ".";
+}
require "globals.pl";
-require "BugzillaEmail.pm";
+use BugzillaEmail;
+use Bugzilla::Config qw(:DEFAULT $datadir);
use lib ".";
use lib "../";
@@ -137,8 +140,8 @@ sub storeAttachments( $$ )
print "Error while reading attachment $decoded_file!\n";
next;
}
- # print "unlinking data/mimedump-tmp/$decoded_file";
- # unlink "data/mimedump-tmp/$decoded_file";
+ # print "unlinking $datadir/mimedump-tmp/$decoded_file";
+ # unlink "$datadir/mimedump-tmp/$decoded_file";
} else {
# data is in the scalar
$data = $decoded_file;
@@ -248,7 +251,7 @@ sub Reply( $$$$ ) {
die "Cannot find sender-email-address" unless defined( $Sender );
if( $test ) {
- open( MAIL, ">>data/bug_email_test.log" );
+ open( MAIL, '>>', "$datadir/bug_email_test.log" );
}
else {
open( MAIL, "| /usr/sbin/sendmail -t" );
@@ -697,10 +700,10 @@ my $parser = new MIME::Parser;
# Create and set the output directory:
# FIXME: There should be a $BUGZILLA_HOME variable (SML)
-(-d "data/mimedump-tmp") or mkdir "data/mimedump-tmp",0755 or die "mkdir: $!";
-(-w "data/mimedump-tmp") or die "can't write to directory";
+(-d "$datadir/mimedump-tmp") or mkdir "$datadir/mimedump-tmp",0755 or die "mkdir: $!";
+(-w "$datadir/mimedump-tmp") or die "can't write to directory";
-$parser->output_dir("data/mimedump-tmp");
+$parser->output_dir("$datadir/mimedump-tmp");
# Read the MIME message:
my $entity = $parser->read(\*STDIN) or die "couldn't parse MIME stream";