+91 88 00 563434 sales@webhostingpeople.net

Our Knowledge Base Articles

Company Blog

Autodiscover Information For Mail Clients in DirectAdmin

You are here:

Autodiscover is a system to determine which settings to make use of for the POP/IMAP/SMTP settings, that permits the mail shopper customers to configure their e mail deal with mechanically. We will arrange this in DirectAdmin with fundamental requirement: subdomain and an SRV document.

You may add the SRV document on which area you want to use these settings for. If in case you have any world SSL certificates in exim/dovecot on your hostname, it will likely be higher to ensure the purchasers use the right worth. Therefore they didn’t get SSL certificates errors.

Let’s suspect that you’re connecting your purchasers to server.hostname.com with clientdomain.com for each IMAP and SMTP. Then to begin with have to create a subdomain referred to as ” autodiscover.hostname.com ” to retailer the  XML.

1) Must setup SRV document on the talked about shopper domains “clientdomain.com” DNS zone:

_autodiscover._tcp.clientdomain.com. 3600 IN SRV 10 10 443 autodiscover.hostname.com.

2) Subsequent, have to create the subdomain autodiscover.hostname.com in Directadmin, then can we add the follwing code right into a file referred to as autodiscover.php:

<?php

//get uncooked POST knowledge so we will extract the e-mail deal with

$knowledge = file_get_contents(“php://enter”);

preg_match(“/<EMailAddress>(.*?)</EMailAddress>/”, $knowledge, $matches);

//set Content material-Kind

header(“Content material-Kind: utility/xml”);

echo ‘<?xml model=”1.0″ encoding=”utf-8″ ?>’; ?>

<Autodiscover xmlns=”http://schemas.microsoft.com/trade/autodiscover/responseschema/2006″>

<Response xmlns=”http://schemas.microsoft.com/trade/autodiscover/outlook/responseschema/2006a”>

<Account>

<AccountType>e mail</AccountType>

<Motion>settings</Motion>

<Protocol>

<Kind>IMAP</Kind>

<Server>server.hostname.com</Server>

<Port>993</Port>

<DomainRequired>off</DomainRequired>

<LoginName><?php echo $matches[1]; ?></LoginName>

<SPA>off</SPA>

<SSL>on</SSL>

<AuthRequired>on</AuthRequired>

</Protocol>

<Protocol>

<Kind>POP3</Kind>

<Server>server.hostname.com</Server>

<Port>995</Port>

<DomainRequired>off</DomainRequired>

<LoginName><?php echo $matches[1]; ?></LoginName>

<SPA>off</SPA>

<SSL>on</SSL>

<AuthRequired>on</AuthRequired>

</Protocol>

<Protocol>

<Kind>SMTP</Kind>

<Server>server.hostname.com</Server>

<Port>587</Port>

<DomainRequired>off</DomainRequired>

<LoginName><?php echo $matches[1]; ?></LoginName>

<SPA>off</SPA>

<Encryption>TLS</Encryption>

<AuthRequired>on</AuthRequired>

<UsePOPAuth>off</UsePOPAuth>

<SMTPLast>off</SMTPLast>

</Protocol>

</Account>

</Response>

</Autodiscover>

 SRV document at all times utilizing port 443 for autodiscover.hostname.com, So be sure to have gotten a legitimate certificates setup for this subdomain. You may examine this by getting into the area on https://www.sslshopper.com/ssl-checker.html or can attempt to entry it on a browser with https://autodiscover.hostname.com

3) Lastly, we might want to arrange a .htaccess hidden file in order that we will hint any request to the wanted subdomain like autodiscover.hostname.com leads to the autodiscover.php being referred to as. We have to add the next traces to the .htaccess file underneath the subdomain DocumentRoot.

RewriteEngine On

RewriteCond %REQUEST_FILENAME -s [OR]

RewriteCond %REQUEST_FILENAME -l [OR]

RewriteCond %REQUEST_FILENAME -d

RewriteRule ^.*$ – [NC,L]

RewriteRule ^.*$ autodiscover.php [NC,L]

If you happen to want any additional assist, please do attain our help division.

Leave a Comment