Set envelope sender to the same as the From: address when PEAR mail is used. This...
[lhc/web/wiklou.git] / includes / UserMailer.php
index f40e9b8..0a7dc7f 100644 (file)
@@ -159,6 +159,7 @@ class UserMailer {
                        }
 
                        $headers['From'] = $from->toString();
+                       $headers['Return-Path'] = $from->toString();
 
                        if ( $wgEnotifImpersonal ) {
                                $headers['To'] = 'undisclosed-recipients:;';
@@ -213,7 +214,7 @@ class UserMailer {
 
                        $headers = array(
                                "MIME-Version: 1.0",
-                               "Content-type: $contentType", 
+                               "Content-type: $contentType",
                                "Content-Transfer-Encoding: 8bit",
                                "X-Mailer: MediaWiki mailer",
                                "From: " . $from->toString(),
@@ -292,7 +293,7 @@ class UserMailer {
                        return $string;
                }
                $out = "=?$charset?Q?";
-               $out .= preg_replace_callback( "/([$replace])/", 
+               $out .= preg_replace_callback( "/([$replace])/",
                        array( __CLASS__, 'quotedPrintableCallback' ), $string );
                $out .= '?=';
                return $out;
@@ -524,7 +525,7 @@ class EmailNotification {
                         */
                        $keys['$NEWPAGE'] = wfMsgForContent( 'enotif_lastdiff',
                                        $this->title->getFullURL( "oldid={$this->oldid}&diff=next" ) );
-        }
+               }
 
                $body = strtr( $body, $keys );
                $pagetitle = $this->title->getPrefixedText();
@@ -545,8 +546,8 @@ class EmailNotification {
                $adminAddress = new MailAddress( $wgPasswordSender, $wgPasswordSenderName );
                $editorAddress = new MailAddress( $editor );
                if ( $wgEnotifRevealEditorAddress
-                   && ( $editor->getEmail() != '' )
-                   && $editor->getOption( 'enotifrevealaddr' ) ) {
+                       && ( $editor->getEmail() != '' )
+                       && $editor->getOption( 'enotifrevealaddr' ) ) {
                        if ( $wgEnotifFromEditor ) {
                                $from    = $editorAddress;
                        } else {
@@ -558,7 +559,7 @@ class EmailNotification {
                        $replyto = new MailAddress( $wgNoReplyAddress );
                }
 
-               if ( $editor->isIP( $name ) ) {
+               if ( $editor->isAnon() ) {
                        # real anon (user:xxx.xxx.xxx.xxx)
                        $utext = wfMsgForContent( 'enotif_anon_editor', $name );
                        $subject = str_replace( '$PAGEEDITOR', $utext, $subject );
@@ -658,9 +659,11 @@ class EmailNotification {
 
                $body = str_replace(
                                array( '$WATCHINGUSERNAME',
-                                       '$PAGEEDITDATE' ),
+                                       '$PAGEEDITDATE',
+                                       '$PAGEEDITTIME' ),
                                array( wfMsgForContent( 'enotif_impersonal_salutation' ),
-                                       $wgContLang->timeanddate( $this->timestamp, true, false, false ) ),
+                                       $wgContLang->date( $this->timestamp, true, false, false ),
+                                       $wgContLang->time( $this->timestamp, true, false, false ) ),
                                $this->body );
 
                return UserMailer::send( $addresses, $this->from, $this->subject, $body, $this->replyto );