From 67044a931c9fb6549d7f45e23d0c82ae6fabe586 Mon Sep 17 00:00:00 2001 From: River Tarnell Date: Sun, 6 May 2007 07:14:10 +0000 Subject: [PATCH] - default value of $wgEnotifImpersonal should be false - userMailer() needs to handle multiple recips in mail() path --- includes/DefaultSettings.php | 2 +- includes/UserMailer.php | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 585b1291fb..0dffa5d1f4 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1180,7 +1180,7 @@ $wgEnotifMinorEdits = true; # UPO; false: "minor edits" on pages do not trigger # For pages with many users watching, this can significantly reduce mail load. # Has no effect when using sendmail rather than SMTP; -$wgEnotifImpersonal = true; +$wgEnotifImpersonal = false; # Maximum number of users to mail at once when using impersonal mail. Should # match the limit on your mail server. diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 32dee6574b..d800e82312 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -174,12 +174,16 @@ function userMailer( $to, $from, $subject, $body, $replyto=null ) { $headers .= "{$endl}Reply-To: " . $replyto->toString(); } - $dest = $to->toString(); - $wgErrorString = ''; set_error_handler( 'mailErrorHandler' ); wfDebug( "Sending mail via internal mail() function to $dest\n" ); - mail( $dest, wfQuotedPrintable( $subject ), $body, $headers ); + + if (is_array($to)) + foreach ($to as $recip) + mail( $recip->toString(), wfQuotedPrintable( $subject ), $body, $headers ); + else + mail( $to->toString(), wfQuotedPrintable( $subject ), $body, $headers ); + restore_error_handler(); if ( $wgErrorString ) { -- 2.20.1