outlook autodiscover

1 post / 0 new
#1 Tue, 05/29/2018 - 11:38
adlsrl

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\>(.*?)\<\/EMailAddress\>/", $data, $matches);
  header("Content-Type: application/xml");
  list($account, $domain) = split('@' ,$matches[1]);
?>
<?php echo '<?xml version="1.0" encoding="utf-8" ?>'; ?>
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
<Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a">
  <Account>
   <AccountType>email</AccountType>
   <Action>settings</Action>
    <Protocol>
     <Type>POP3</Type>
     <Server><?php echo 'pop3.'.$domain; ?></Server>
     <Port>110</Port>
     <LoginName><?php echo "{$account}_$domain"; ?></LoginName>
     <DomainRequired>off</DomainRequired>
     <SPA>off</SPA>
     <SSL>off</SSL>
     <AuthRequired>on</AuthRequired>
     <DomainRequired>off</DomainRequired>
    </Protocol>
    <Protocol>
     <Type>SMTP</Type>
     <Server><?php echo 'smtp.'.$domain; ?></Server>
     <Port>25</Port>
     <DomainRequired>off</DomainRequired>
     <LoginName><?php echo "{$account}_$domain"; ?></LoginName>
     <SPA>off</SPA>
     <SSL>off</SSL>
     <AuthRequired>on</AuthRequired>
     <UsePOPAuth>on</UsePOPAuth>
     <SMTPLast>off</SMTPLast>
    </Protocol>
   </Account>
</Response>
</Autodiscover>