* (bug 25728) Added $wgPasswordSenderName to allow customise the name associed with...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 7 Nov 2010 09:30:42 +0000 (09:30 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 7 Nov 2010 09:30:42 +0000 (09:30 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/User.php
includes/UserMailer.php
includes/specials/SpecialEmailuser.php

index 3e221d0..1e7d12f 100644 (file)
@@ -86,6 +86,8 @@ LocalSettings.php. The specific bugs are listed below in the general notes.
 * The FailFunction "error handling" method has now been removed
 * $wgAdditionalMailParams added to allow setting extra options to mail() calls.
 * $wgSecureLogin & $wgSecureLoginStickHTTPS to optionaly login using HTTPS
+* (bug 25728) Added $wgPasswordSenderName to allow customise the name associed
+  with $wgPasswordSender
 
 === New features in 1.17 ===
 * (bug 10183) Users can now add personal styles and scripts to all skins via
index d74d56f..170fd6c 100644 (file)
@@ -968,16 +968,21 @@ $wgEmergencyContact = 'wikiadmin@' . $serverName;
  *
  * The address we should use as sender when a user is requesting his password.
  */
-$wgPasswordSender      = 'MediaWiki Mail <apache@' . $serverName . '>';
+$wgPasswordSender = 'apache@' . $serverName;
 
-unset($serverName); # Don't leak local variables to global scope
+unset( $serverName ); # Don't leak local variables to global scope
+
+/**
+ * Password reminder name
+ */
+$wgPasswordSenderName = 'MediaWiki Mail';
 
 /**
  * Dummy address which should be accepted during mail send action.
  * It might be necessary to adapt the address or to set it equal
  * to the $wgEmergencyContact address.
  */
-$wgNoReplyAddress      = 'reply@not.possible';
+$wgNoReplyAddress = 'reply@not.possible';
 
 /**
  * Set to true to enable the e-mail basic features:
@@ -1000,7 +1005,7 @@ $wgEnableUserEmail = true;
  * which can cause problems with SPF validation and leak recipient addressses
  * when bounces are sent to the sender.
  */
-$wgUserEmailUseReplyTo = false;
+$wgUserEmailUseReplyTo = true;
 
 /**
  * Minimum time, in hours, which must elapse between password reminder
@@ -1033,9 +1038,6 @@ $wgSMTP                           = false;
  */
 $wgAdditionalMailParams = null;
 
-/** For email notification on page changes */
-$wgPasswordSender = $wgEmergencyContact;
-
 /**
  * True: from page editor if s/he opted-in. False: Enotif mails appear to come
  * from $wgEmergencyContact
index 88dd403..63b1a6a 100644 (file)
@@ -2957,12 +2957,13 @@ class User {
         */
        function sendMail( $subject, $body, $from = null, $replyto = null ) {
                if( is_null( $from ) ) {
-                       global $wgPasswordSender;
-                       $from = $wgPasswordSender;
+                       global $wgPasswordSender, $wgPasswordSenderName;
+                       $sender = new MailAddress( $wgPasswordSender, $wgPasswordSenderName );
+               } else {
+                       $sender = new MailAddress( $from );
                }
 
                $to = new MailAddress( $this );
-               $sender = new MailAddress( $from );
                return UserMailer::send( $to, $sender, $subject, $body, $replyto );
        }
 
index 3967406..41a00bd 100644 (file)
@@ -440,7 +440,7 @@ class EmailNotification {
         * @private
         */
        function composeCommonMailtext() {
-               global $wgPasswordSender, $wgNoReplyAddress;
+               global $wgPasswordSender, $wgPasswordSenderName, $wgNoReplyAddress;
                global $wgEnotifFromEditor, $wgEnotifRevealEditorAddress;
                global $wgEnotifImpersonal, $wgEnotifUseRealName;
 
@@ -496,7 +496,7 @@ class EmailNotification {
                # global configuration level.
                $editor = $this->editor;
                $name    = $wgEnotifUseRealName ? $editor->getRealName() : $editor->getName();
-               $adminAddress = new MailAddress( $wgPasswordSender, 'WikiAdmin' );
+               $adminAddress = new MailAddress( $wgPasswordSender, $wgPasswordSenderName );
                $editorAddress = new MailAddress( $editor );
                if( $wgEnotifRevealEditorAddress
                    && ( $editor->getEmail() != '' )
index 6cc6e1d..c098e88 100644 (file)
@@ -256,8 +256,8 @@ class SpecialEmailUser extends UnlistedSpecialPage {
                        // This is a bit ugly, but will serve to differentiate
                        // wiki-borne mails from direct mails and protects against
                        // SPF and bounce problems with some mailers (see below).
-                       global $wgPasswordSender;
-                       $mailFrom = new MailAddress( $wgPasswordSender );
+                       global $wgPasswordSender, $wgPasswordSenderName;
+                       $mailFrom = new MailAddress( $wgPasswordSender, $wgPasswordSenderName );
                        $replyTo = $from;
                } else {
                        // Put the sending user's e-mail address in the From: header.