Author: wagnerc
Description:
Solution doesnt solve problem - IIS 5.1 smtp: doesn't support /n as end of line valid charakters is
\\r\n.
see it partially solved:
http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/UserMailer.php?r1=16115&r2=16285
log from smtp (after this change will show other error):
2006-09-29 01:08:19 127.0.0.1 elf SMTPSVC1 ELF 127.0.0.1 0 MAIL - +FROM:<root@biznet.gotdns.org> 250 47
34
2006-09-29 01:08:19 127.0.0.1 elf SMTPSVC1 ELF 127.0.0.1 0 RCPT - +TO:<wagnerc@wp.pl> 250 26 23
2006-09-29 01:08:19 127.0.0.1 elf SMTPSVC1 ELF 127.0.0.1 0 DATA - <ELFFRaqbC8wSA1XvpFV00000006@elf> 250
116 750
2006-09-29 01:08:19 127.0.0.1 elf SMTPSVC1 ELF 127.0.0.1 0 QUIT - elf 0 52 4
2006-09-29 01:08:19 - OutboundConnectionResponse SMTPSVC1 ELF - 25 - - 220+mx.wp.pl+ESMTP 0 18 0
2006-09-29 01:08:19 mx.wp.pl OutboundConnectionCommand SMTPSVC1 ELF - 25 EHLO - elf 0 4 0
2006-09-29 01:08:19 mx.wp.pl OutboundConnectionResponse SMTPSVC1 ELF - 25 - - 250-mx.wp.pl 0 12 0
2006-09-29 01:08:19 mx.wp.pl OutboundConnectionCommand SMTPSVC1 ELF - 25 MAIL -
FROM:<root@biznet.gotdns.org> 0 4 0
2006-09-29 01:08:19 mx.wp.pl OutboundConnectionResponse SMTPSVC1 ELF - 25 - - 250+ok 0 6 0
2006-09-29 01:08:19 mx.wp.pl OutboundConnectionCommand SMTPSVC1 ELF - 25 RCPT - TO:<wagnerc@wp.pl> 0 4 0
2006-09-29 01:08:19 mx.wp.pl OutboundConnectionResponse SMTPSVC1 ELF - 25 - - 250+ok 0 6 0
2006-09-29 01:08:19 mx.wp.pl OutboundConnectionCommand SMTPSVC1 ELF - 25 DATA - - 0 4 0
2006-09-29 01:08:19 mx.wp.pl OutboundConnectionResponse SMTPSVC1 ELF - 25 - - 354+go+ahead 0 12 0
2006-09-29 01:08:19 mx.wp.pl OutboundConnectionResponse SMTPSVC1 ELF - 25 - -
551+stray+new+line+detected,+closing+connection 0 47 0
Valid Code should be for Windows SMTP (insteed uniform solution I placed how to replace code - I don't
have knowledge of MediaWiki globals) -> see datails on
(http://meta.wikimedia.org/wiki/Installing_MediaWiki_on_Windows_XP_-_MediaWiki_1.7.1).
Find follow lines
wfDebug( "Sending mail via internal mail() function to $dest\n" ); mail( $dest, wfQuotedPrintable( $subject ), $body, $headers); restore_error_handler();
and replace to:
wfDebug( "Sending mail via internal mail() function to $dest\n" ); mail( $dest, wfQuotedPrintable( $subject ), str_replace( "\n", "\r\n", $body ),
str_replace("\n", "\r\n", $headers ));
restore_error_handler();
Usermailer.php -> IIS don't support full RFC recommedation, so next patch is need (remove additional
name in e-mail address:
Usermailer.php ->
Find follow lines (this is already solved 4979):
function toString() { if( $this->name != '' ) { $quoted = wfQuotedPrintable( $this->name ); if( strpos( $quoted, '.' ) !== false ) { $quoted = '"' . $quoted . '"'; } return "$quoted <{$this->address}>"; } else { return $this->address; } }
End remove condition on use nicknames by commenting out:
function toString() {
if( $this->name != '' ) {
$quoted = wfQuotedPrintable( $this->name );
if( strpos( $quoted, '.' ) !== false ) {
$quoted = '"' . $quoted . '"';
}
return "$quoted <{$this->address}>";
// } else {
return $this->address;
// }
}
Version: 1.8.x
Severity: normal
OS: Windows XP
Platform: PC
URL: http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/UserMailer.php?revision=16285&view=markup