summaryrefslogtreecommitdiffstats
path: root/globals.pl
diff options
context:
space:
mode:
authorgerv%gerv.net <>2005-01-01 22:44:15 +0100
committergerv%gerv.net <>2005-01-01 22:44:15 +0100
commit4e2bfc82a0a1d70e3e0e79d27b9bcee8dfc25077 (patch)
tree7995ebb2391debcd774e93aab16411e04df8e28d /globals.pl
parentb9cfd23ffdca5cf3efc90f19471c553085f4c913 (diff)
downloadbugzilla-4e2bfc82a0a1d70e3e0e79d27b9bcee8dfc25077.tar.gz
bugzilla-4e2bfc82a0a1d70e3e0e79d27b9bcee8dfc25077.tar.xz
Bug 59351 - move all calls to sendmail to a central place. Patch by mkanat; r=gerv,vladd; a=justdave.
Diffstat (limited to 'globals.pl')
-rw-r--r--globals.pl37
1 files changed, 16 insertions, 21 deletions
diff --git a/globals.pl b/globals.pl
index 02a4f8fb4..12644d506 100644
--- a/globals.pl
+++ b/globals.pl
@@ -33,6 +33,7 @@ use Bugzilla::Constants;
use Bugzilla::Util;
# Bring ChmodDataFile in until this is all moved to the module
use Bugzilla::Config qw(:DEFAULT ChmodDataFile $localconfig $datadir);
+use Bugzilla::BugMail;
# Shut up misguided -w warnings about "used only once". For some reason,
# "use vars" chokes on me when I try it here.
@@ -1410,32 +1411,26 @@ sub RemoveVotes {
# Now lets send the e-mail to alert the user to the fact that their votes have
# been reduced or removed.
- my $sendmailparm = '-ODeliveryMode=deferred';
- if (Param('sendmailnow')) {
- $sendmailparm = '';
- }
- if (open(SENDMAIL, "|/usr/lib/sendmail $sendmailparm -t -i")) {
- my %substs;
+ my %substs;
- $substs{"to"} = $name . Param('emailsuffix');
- $substs{"bugid"} = $id;
- $substs{"reason"} = $reason;
+ $substs{"to"} = $name . Param('emailsuffix');
+ $substs{"bugid"} = $id;
+ $substs{"reason"} = $reason;
- $substs{"votesremoved"} = $removedvotes;
- $substs{"votesold"} = $oldvotes;
- $substs{"votesnew"} = $newvotes;
+ $substs{"votesremoved"} = $removedvotes;
+ $substs{"votesold"} = $oldvotes;
+ $substs{"votesnew"} = $newvotes;
- $substs{"votesremovedtext"} = $removedvotestext;
- $substs{"votesoldtext"} = $oldvotestext;
- $substs{"votesnewtext"} = $newvotestext;
+ $substs{"votesremovedtext"} = $removedvotestext;
+ $substs{"votesoldtext"} = $oldvotestext;
+ $substs{"votesnewtext"} = $newvotestext;
- $substs{"count"} = $removedvotes . "\n " . $newvotestext;
+ $substs{"count"} = $removedvotes . "\n " . $newvotestext;
- my $msg = PerformSubsts(Param("voteremovedmail"),
- \%substs);
- print SENDMAIL $msg;
- close SENDMAIL;
- }
+ my $msg = PerformSubsts(Param("voteremovedmail"),
+ \%substs);
+
+ Bugzilla::BugMail::MessageToMTA($msg);
}
SendSQL("SELECT SUM(vote_count) FROM votes WHERE bug_id = $id");
my $v = FetchOneColumn();