From 8a3d4469cc85108a194a78ac95f2a6780d2971eb Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Wed, 24 Dec 2008 03:43:36 +0000 Subject: Bug 284184: Allow Bugzilla to use an asynchronous job queue for sending mail. Patch By Max Kanat-Alexander and Mark Smith r=glob, a=mkanat --- Bugzilla/Mailer.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Mailer.pm') diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm index 1ffbd44e3..d3810b72b 100644 --- a/Bugzilla/Mailer.pm +++ b/Bugzilla/Mailer.pm @@ -53,10 +53,15 @@ use Email::MIME::Modifier; use Email::Send; sub MessageToMTA { - my ($msg) = (@_); + my ($msg, $send_now) = (@_); my $method = Bugzilla->params->{'mail_delivery_method'}; return if $method eq 'None'; + if (Bugzilla->params->{'use_mailer_queue'} and !$send_now) { + Bugzilla->job_queue->insert('send_mail', { msg => $msg }); + return; + } + my $email = ref($msg) ? $msg : Email::MIME->new($msg); # We add this header to uniquely identify all email that we -- cgit v1.2.3-24-g4f1b