Introduced $wgAdditionalMailParams to allow adjusting extra email options. Based...
authorMax Semenik <maxsem@users.mediawiki.org>
Wed, 27 Oct 2010 15:52:02 +0000 (15:52 +0000)
committerMax Semenik <maxsem@users.mediawiki.org>
Wed, 27 Oct 2010 15:52:02 +0000 (15:52 +0000)
CREDITS
RELEASE-NOTES
includes/DefaultSettings.php
includes/UserMailer.php

diff --git a/CREDITS b/CREDITS
index 0ca55dd..5b42a96 100644 (file)
--- 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
index 11393a6..610642f 100644 (file)
@@ -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
index 7bc6ab3..d62957c 100644 (file)
@@ -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;
 
index edcdcc5..a15f5c8 100644 (file)
@@ -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();