Author: stephen.f.lawrence
Description:
Email is sent by wiki when registering a new user, but registering user gets message on wiki page after registering stating that the wiki failed to send confirmation email for reason "1". In fact the confirmation email was sent.
wiki configured using wgSMTP, which is documented as:
$wgSMTP = array(
'host' => "localhost",
'IDHost' => "domain for MessageID",
'port' => 25,
'auth' => false,
'username' => "my_user_name",
'password' => "my_password"
);
The error essage is caused by this code in SpecialUserlogin.php
$error = $u->sendConfirmationMail(); if( WikiError::isError( $error ) ) { $wgOut->addWikiText( wfMsg( 'confirmemail_sendfailed', $error->getMessage() ) ); } else { $wgOut->addWikiText( wfMsg( 'confirmemail_oncreate' ) ); }
WikiError::isError( $error ) is evaluating as true and
$error->getMessage() is returning "1".
In the $wgSMTP case, the called functions are:
sendConfirmationMail()
return (sendMail())
sendMail()
$error = userMailer( $to, $sender, $subject, $body ); if( $error == '' ) { return true; } else { return new WikiError( $error ); }
userMailer()
$mail_object =& Mail::factory('smtp', $wgSMTP); if (is_array($dest)) { $chunks = array_chunk($dest, $wgEnotifMaxRecips); foreach ($chunks as $chunk) { $e = send_mail($mail_object, $chunk, $headers, $body); if ($e != '') return $e; } } else return $mail_object->send($dest, $headers, $body);
single destination (recipient), so $dest is not an array.
Mail::factory->send() returns true on success.
So on successful email, I think this is happening:
send() returns true userMailer() returns true sendMail returns new WikiError(true);
I don't know much about php. My guess is that true does not equal ''.
Version: 1.11.x
Severity: normal