X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialEmailuser.php;h=6b0d1ec73bbe28bae8bb00c668be16d79899ac18;hb=e2af4108ae9b0cdada47bf2ca66497384ac9016a;hp=c55fa94c4f8153bddaff58f2fc36d4be3db3721a;hpb=61b2f07f6b4eb3ff676130126b40f519e125690c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialEmailuser.php b/includes/specials/SpecialEmailuser.php index c55fa94c4f..6b0d1ec73b 100644 --- a/includes/specials/SpecialEmailuser.php +++ b/includes/specials/SpecialEmailuser.php @@ -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 ); }