From 4e2bfc82a0a1d70e3e0e79d27b9bcee8dfc25077 Mon Sep 17 00:00:00 2001 From: "gerv%gerv.net" <> Date: Sat, 1 Jan 2005 21:44:15 +0000 Subject: Bug 59351 - move all calls to sendmail to a central place. Patch by mkanat; r=gerv,vladd; a=justdave. --- Bugzilla/BugMail.pm | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'Bugzilla/BugMail.pm') diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index 0e089fa12..638b8a413 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -864,20 +864,29 @@ sub NewProcessOnePerson ($$$$$$$$$$$$$) { my $msg = PerformSubsts($template, \%substs); - my $sendmailparam = "-ODeliveryMode=deferred"; - if (Param("sendmailnow")) { - $sendmailparam = ""; + MessageToMTA($msg); + + push(@sentlist, $person); + return 1; +} + +# XXX: Should eventually add $mail_from and $mail_to options to +# control the SMTP Envelope. -mkanat +sub MessageToMTA ($) { + my ($msg) = (@_); + + my $sendmailparam = ""; + unless (Param("sendmailnow")) { + $sendmailparam = "-ODeliveryMode=deferred"; } if ($enableSendMail == 1) { open(SENDMAIL, "|/usr/lib/sendmail $sendmailparam -t -i") || die "Can't open sendmail"; - + print SENDMAIL trim($msg) . "\n"; close SENDMAIL; } - push(@sentlist, $person); - return 1; } 1; -- cgit v1.2.3-24-g4f1b