diff options
Diffstat (limited to 'globals.pl')
-rw-r--r-- | globals.pl | 37 |
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(); |