Topic on Project:Support desk

problem to send email (smtp) to exchange server

4
JanTappenbeck (talkcontribs)

hi!

I installed on my Win7 64bit machine Apache 2.4, php 5.6.0, mediawiki and the pear mail-packet. the mediawiki server only should be used in the company - not from the www and we used a Exchange-Server 2010.

I added into localsettings.php following parameter:

$wgSMTP = array(
 'host'     => "ma22-ex-002.local.xxxxx.de", // could also be an IP address. Where the SMTP server is located
 'IDHost'   => "xxxxx.de",      // Generally this will be the domain name of your website (aka mywiki.org)
 'port'     => 25,                 // Port to use when connecting to the SMTP server
 'auth'     => true,               // Should we use SMTP authentication (true or false)
 'username' => "YYY-GIS-Hotline-Email@local.xxxxx.de",   // Username to use for SMTP authentication (if being used)
 #'username' => "gis-hotline@xxxxx.de",   // Username to use for SMTP authentication (if being used)
 'password' => "*******"       // Password to use for SMTP authentication (if being used)
);

we want that only the admin could create accounts ->

$wgGroupPermissions['*']['createaccount'] = false;

when I create a account I get the message: Fehler beim Senden der E-Mail(error by sending email) : authentication failure [SMTP: No supported authentication methods (code: 250, response: MA22-EX-002.local.xxxxx.de Hello [Ip-Adress] SIZE PIPELINING DSN ENHANCEDSTATUSCODES STARTTLS X-ANONYMOUSTLS AUTH NTLM X-EXPS GSSAPI NTLM 8BITMIME BINARYMIME CHUNKING XEXCH50 XRDST XSHADOW)]

my chef-admin try to send emails by telnet - there is no problem!

  • the main question is what are the correct parameters for $wgSMTP - is the username the name at the Exchange-Accout or the email-Adress ?
  • is it require to install a email-client on the server of mediawiki ?

on the other hand I found the tip to active the php-error-log. I add into localsettings.php following:

error_reporting( -1 );
ini_set( 'display_errors', 1 );

I look and see following message: PHP Deprecated: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\PHP-5.6.0\pear\Net\SMTP.php on line 495

can anyone help me ?

it is the last problem on my way to our mediawiki. german answers could be understand better than English.

regards Jan

Ciencia Al Poder (talkcontribs)

Pear-Mail has only support for a few authentication methods: Digest-MD5, CRAMMD5, LOGIN and PLAIN and your server doesn't seem to support any of them.

Try to enable at least one of them on the server.

JanTappenbeck (talkcontribs)

HI !

thanks for answer.

first i will add some parameter of php.ini i forget in the start-posting.

[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = GIS-Hotline@mydomain.de

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
;sendmail_path =

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = On

; The path to a log file that will log all mail() calls. Log entries include
; the full path of the script, line number, To address and headers.
mail.log = c:\temp\mail.log
; Log mail to syslog (Event Log on Windows).
;mail.log = syslog


now to the answer....

sorry - but i did not understand the order.

is mixed Net_SMTP::auth ('sender@mydomain.de', 'mypassword' , 'PLAIN' ) a parameter a had to add into php.ini .... or ??

regards Jan :-)

Ciencia Al Poder (talkcontribs)

Ah, I think I didn't specify well where the problem is ;)

It's the mail server (exchange) the one that doesn't support Digest-MD5, CRAMMD5, LOGIN or PLAIN authentication options. Those are the only authentication options that PHP supports.

You don't need to change anything on PHP, because it will automatically choose one of the authentication option on that list (Digest-MD5, CRAMMD5, LOGIN or PLAIN), the first one that your mail server supports.

You have to enable at least one of those authentication mechanisms on MS Exchange to be able to send emails from PHP using that exchange server. Otherwise you'll have to use another mail server like gmail.

Reply to "problem to send email (smtp) to exchange server"