From 13392647c8135e460cbd44275e219bab8a2de9ab Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Wed, 27 Oct 2010 15:52:02 +0000 Subject: [PATCH] Introduced $wgAdditionalMailParams to allow adjusting extra email options. Based on patch by Alejandro Mery. --- CREDITS | 1 + RELEASE-NOTES | 1 + includes/DefaultSettings.php | 5 +++++ includes/UserMailer.php | 6 +++--- 4 files changed, 10 insertions(+), 3 deletions(-) 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(); -- 2.20.1