From 0fd221c6a2623521b5a81a56bcb32a4402bf0f31 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Wed, 20 Feb 2013 16:47:17 +0800 Subject: Fix the path to the LimitedEmail log file --- extensions/LimitedEmail/Config.pm | 2 -- extensions/LimitedEmail/Extension.pm | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'extensions/LimitedEmail') diff --git a/extensions/LimitedEmail/Config.pm b/extensions/LimitedEmail/Config.pm index 026398edb..ea05f363c 100644 --- a/extensions/LimitedEmail/Config.pm +++ b/extensions/LimitedEmail/Config.pm @@ -19,6 +19,4 @@ use constant FILTERS => [ qr/^reed\@reedloden\.com$/i, ]; -use constant MAIL_LOG => 'data/mail.log'; - __PACKAGE__->NAME; diff --git a/extensions/LimitedEmail/Extension.pm b/extensions/LimitedEmail/Extension.pm index f2020a6cc..35cc83567 100644 --- a/extensions/LimitedEmail/Extension.pm +++ b/extensions/LimitedEmail/Extension.pm @@ -14,6 +14,7 @@ our $VERSION = '2'; use FileHandle; use Date::Format; use Encode qw(encode_utf8); +use Bugzilla::Constants qw(bz_locations); sub mailer_before_send { my ($self, $args) = @_; @@ -27,7 +28,8 @@ sub mailer_before_send { $header->header_set(to => ''); } - my $fh = FileHandle->new('>>' . Bugzilla::Extension::LimitedEmail::MAIL_LOG); + my $log_filename = bz_locations->{'datadir'} . '/mail.log'; + my $fh = FileHandle->new(">>$log_filename"); if ($fh) { print $fh encode_utf8(sprintf( "[%s] %s%s %s : %s\n", -- cgit v1.2.3-24-g4f1b