Displaying search results for multiple wikis
[lhc/web/wiklou.git] / includes / specials / SpecialEmailuser.php
index c55fa94..6b0d1ec 100644 (file)
@@ -329,34 +329,40 @@ class SpecialEmailUser extends UnlistedSpecialPage {
                }
 
                if ( $config->get( 'UserEmailUseReplyTo' ) ) {
-                       // Put the generic wiki autogenerated address in the From:
-                       // header and reserve the user for Reply-To.
-                       //
-                       // 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).
+                       /**
+                        * Put the generic wiki autogenerated address in the From:
+                        * header and reserve the user for Reply-To.
+                        *
+                        * 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).
+                        */
                        $mailFrom = new MailAddress( $config->get( 'PasswordSender' ),
                                wfMessage( 'emailsender' )->inContentLanguage()->text() );
                        $replyTo = $from;
                } else {
-                       // Put the sending user's e-mail address in the From: header.
-                       //
-                       // This is clean-looking and convenient, but has issues.
-                       // One is that it doesn't as clearly differentiate the wiki mail
-                       // from "directly" sent mails.
-                       //
-                       // Another is that some mailers (like sSMTP) will use the From
-                       // address as the envelope sender as well. For open sites this
-                       // can cause mails to be flunked for SPF violations (since the
-                       // wiki server isn't an authorized sender for various users'
-                       // domains) as well as creating a privacy issue as bounces
-                       // containing the recipient's e-mail address may get sent to
-                       // the sending user.
+                       /**
+                        * Put the sending user's e-mail address in the From: header.
+                        *
+                        * This is clean-looking and convenient, but has issues.
+                        * One is that it doesn't as clearly differentiate the wiki mail
+                        * from "directly" sent mails.
+                        *
+                        * Another is that some mailers (like sSMTP) will use the From
+                        * address as the envelope sender as well. For open sites this
+                        * can cause mails to be flunked for SPF violations (since the
+                        * wiki server isn't an authorized sender for various users'
+                        * domains) as well as creating a privacy issue as bounces
+                        * containing the recipient's e-mail address may get sent to
+                        * the sending user.
+                        */
                        $mailFrom = $from;
                        $replyTo = null;
                }
 
-               $status = UserMailer::send( $to, $mailFrom, $subject, $text, $replyTo );
+               $status = UserMailer::send( $to, $mailFrom, $subject, $text, array(
+                       'replyTo' => $replyTo,
+               ) );
 
                if ( !$status->isGood() ) {
                        return $status;
@@ -367,7 +373,10 @@ class SpecialEmailUser extends UnlistedSpecialPage {
                        if ( $data['CCMe'] && $to != $from ) {
                                $cc_subject = $context->msg( 'emailccsubject' )->rawParams(
                                        $target->getName(), $subject )->text();
+
+                               // target and sender are equal, because this is the CC for the sender
                                Hooks::run( 'EmailUserCC', array( &$from, &$from, &$cc_subject, &$text ) );
+
                                $ccStatus = UserMailer::send( $from, $from, $cc_subject, $text );
                                $status->merge( $ccStatus );
                        }