Simple Autdiscover/Autoconfig XML generator written in PHP.
Autodiscover was developed by Microsoft to simply set an email client according to Active Directory.
It tried to do it as simple as possible.
Tested with:
- Android E-mail app
- Thunderbird
- Mail (Windows 10 native client)
- Microsoft Outlook 2010
- Evolution (Gnome native client)
Alternative way how to autoconfigure mail clients is
- SRV DNS records according to RFC6186
You should have:
- correctly set mail server (great instructions written by Sam Hobbs for Raspberry Pi).
- correctly configured DNS records for subdomains
autodiscover.<domain>
andautoconfig.<domain>
- valid TLS certificates for your subdomains
autodiscover.<domain>
andautoconfig.<domain>
(eg. Let's Encrypt). - installed composer, project depends on some other PHP libraries
There are differencies how clients calls for autoconfiguration:
autodiscover.<domain>
, eg. autodiscover.example.com (used by Exchange-like accounts)autoconfig.<domain>
, eg. autoconfig.example.com (used by Thunderbird)
Clone project to your web root
cd /var/www
git clone https://github.com/hmlkao/php-autodiscover.git autodiscover
cd autodiscover
composer install
Copy autodiscover.php file to your web root for each of your domains, eg. /var/www/autodiscover/example-1.php
NOTE: If is your configuration same for all domains it requires only different Web server settings
The process how is Outlook looking for settings is well described here
- Open File > Add account
- Enter your mail
- Version 2010 tries only URL
GET https://autodiscover.<domain>/autodiscover/autodiscover.xml
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/mobilesync/requestschema/2006"> <Request> <EMailAddress>%email%</EMailAddress> <AcceptableResponseSchema>http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006</AcceptableResponseSchema> </Request> </Autodiscover>
Native application available for Mail, Calendar and Contatcts in Microsoft Windows 10.
- Add account > Other (POP, IMAP)
- Enter your mail address and password
- Open Menu > Preferences > Account Settings
- In the left bottom corner open Account Actions > Add Mail Account...
- Enter 'Email address' and 'Password' and click on Continue
- Thunderbird tries open URL
GET https://autoconfig.<domain>/mail/config-v1.1.xml?emailaddress=%email%
where%email%
is requested email address, eg.[email protected]
You HAVE TO add account directly in Gnome settings, not it Evolution (it doesn't work from some reason)
- Settings > Online Accounts > click on More at the bottom > IMAP and SMTP
- Enter your mail address and password
- You will see IMAP settings at first
- Then SMTP settings
- Evolution tries open URLs
POST https://<domain>/autodiscover/autodiscover.xml
andPOST https://autodiscover.<domain>/autodiscover/autodiscover.xml
with data:where<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/requestschema/2006"> <Request> <EMailAddress>%email%</EMailAddress> <AcceptableResponseSchema>http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a</AcceptableResponseSchema> </Request> </Autodiscover>
%email%
is requested email address, eg.[email protected]
- After all you find your mailbox in Evolution
NOT SUPPORTED - it sends mobilesync request
- Go to Settings > Add account > Microsoft Exchange
- Application tries open URL
POST https://autodiscover.<domain>/autodiscover/autodiscover.xml
with data:where<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/mobilesync/requestschema/2006"> <Request> <EMailAddress>%email%</EMailAddress> <AcceptableResponseSchema>http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006</AcceptableResponseSchema> </Request> </Autodiscover>
%email%
is requested email address, eg.[email protected]
You should choose Exchange as a source for email.
- Nginx examples
- Apache examples
- Factory to create response