outlook autodiscover

Hi all !!

I’m trying to setup autodiscover for our customers. I have a centos mail server.
I setup autodiscover dns record and autodiscover.xml on a web server to support multiple domains (using php).

Test here https://testconnectivity.microsoft.com is ok but from Outlook I can not login correctly.

Probably the problem is that username on mail server are like this: user_domain

This is an example of my php (xml) file, can you see something wrong? Do you think that my target is not achievable?

Thanks a lot.

<?php $data = file_get_contents("php://input"); preg_match("/\(.*?)\<\/EMailAddress\>/", $data, $matches); header("Content-Type: application/xml"); list($account, $domain) = split('@' ,$matches[1]); ?> <?php echo '<?xml version="1.0" encoding="utf-8" ?>'; ?> email settings POP3 <?php echo 'pop3.'.$domain; ?> 110 <?php echo "{$account}_$domain"; ?> off off off on off SMTP <?php echo 'smtp.'.$domain; ?> 25 off <?php echo "{$account}_$domain"; ?> off off on on off