From: Max Semenik Date: Wed, 27 Oct 2010 15:52:02 +0000 (+0000) Subject: Introduced $wgAdditionalMailParams to allow adjusting extra email options. Based... X-Git-Tag: 1.31.0-rc.0~34261 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=13392647c8135e460cbd44275e219bab8a2de9ab;p=lhc%2Fweb%2Fwiklou.git Introduced $wgAdditionalMailParams to allow adjusting extra email options. Based on patch by Alejandro Mery. --- diff --git a/CREDITS b/CREDITS index 0ca55dd88f..5b42a967c8 100644 --- a/CREDITS +++ b/CREDITS @@ -68,6 +68,7 @@ following names for their contribution to the product. == Patch Contributors == * Agbad * Ahmad Sherif +* Alejandro Mery * Amalthea * Antonio Ospite * Azliq7 diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 11393a613b..610642fd2f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -78,6 +78,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * $wgUpgradeKey allows unlocking the web installer for upgrades without having to move LocalSettings.php * The FailFunction "error handling" method has now been removed +* $wgAdditionalMailParams added to allow setting extra options to mail() calls. === New features in 1.17 === * (bug 10183) Users can now add personal styles and scripts to all skins via diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 7bc6ab361b..d62957c2b1 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1028,6 +1028,11 @@ $wgNewPasswordExpiry = 3600 * 24 * 7; */ $wgSMTP = false; +/** + * Additional email parameters, will be passed as the last argument to mail() call. + */ +$wgAdditionalMailParams = null; + /** For email notification on page changes */ $wgPasswordSender = $wgEmergencyContact; diff --git a/includes/UserMailer.php b/includes/UserMailer.php index edcdcc53bb..a15f5c886a 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -112,7 +112,7 @@ class UserMailer { */ static function send( $to, $from, $subject, $body, $replyto=null, $contentType=null ) { global $wgSMTP, $wgOutputEncoding, $wgEnotifImpersonal; - global $wgEnotifMaxRecips; + global $wgEnotifMaxRecips, $wgAdditionalMailParams; if ( is_array( $to ) ) { // This wouldn't be necessary if implode() worked on arrays of @@ -208,10 +208,10 @@ class UserMailer { if (is_array($to)) { foreach ($to as $recip) { - $sent = mail( $recip->toString(), wfQuotedPrintable( $subject ), $body, $headers ); + $sent = mail( $recip->toString(), wfQuotedPrintable( $subject ), $body, $headers, $wgAdditionalMailParams ); } } else { - $sent = mail( $to->toString(), wfQuotedPrintable( $subject ), $body, $headers ); + $sent = mail( $to->toString(), wfQuotedPrintable( $subject ), $body, $headers, $wgAdditionalMailParams ); } restore_error_handler();