I wrote up autoconfig
(Thunderbird/Mozilla standard) + autodiscover
(Microsoft standard) and RFC 6186 as an Ansible 'role' - but with plenty of text to explain what's going on. Summary: Setup RFC 6186 first to see if that is sufficient, and setup the others if that's not enough.
Here's extracts from the role's explanation; see the Ansible role for more info, and the rest of the text there - it should be comprehensible even if you don't know Ansible (esp. see tasks
and templates
directories); further down you'll find how to test autoconfig
/ autodiscover
setups:
RFC 6186
In case you're not aware of RFC 6186, my advice is: Setup RFC 6186 records for your domain before bothering with autodiscover/autoconfig: This is a simpler and more modern way of configuring autodiscover/autoconfig via DNS SRV
records; set that up first before using this role, which is really to provide completeness so that [esp. legacy] email clients that aren't RFC-6186-aware can still find their configuration. If you're after a quick-fix for autodiscover/autoconfig, setup RFC-6186 first - for example in your domain's zone file (from the RFC),
_imap._tcp SRV 0 1 143 imap.example.com.
_pop3._tcp SRV 10 1 110 pop3.example.com.
_submission._tcp SRV 0 1 587 mail.example.com.
If you still need autodiscover/autoconfig after setting up RFC 6186 records for your domain, read on...
Requirements
For Microsoft autodiscover: PHP (edit: I've used PHP in the Ansible role; other server-side languages are available...) (the XML template needs to generate the <LoginName
> field based on supplied POST data from the mail client's web query).
Except for a simple single-domain setup, some DNS setup may be needed. A possible DNS setup might look like this,
- Thunderbird:
autoconfig.example.org CNAME--> some.central.domain
- Microsoft:
_autodiscover._tcp.example.org SRV --> some.central.domain
in named/BIND syntax for a given zone/domain, that would be,
autoconfig IN CNAME some.central.domain
_autodiscover._tcp IN SRV 0 0 443 some.central.domain
Testing autoconfig
Once you've setup a host for autoconfig with this role, you can test the result by issuing command-line requests such as,
curl http://autoconfig_target_domain/.well-known/autoconfig/mail/config-v1.1.xml
curl http://autoconfig_target_domain/mail/config-v1.1.xml
where autoconfig_target_domain
refers to the target domain of a DNS CNAME
record for _autoconfig._tcp.
your_domain, or for simpler setups (without SRV
record) may just be your_domain and/or autoconfig.
your_domain.
Testing autodiscover
Once you've setup a host for autodiscover with this role, you can test the result by issuing a command-line POST request such as,
curl -XPOST -d @req.xml --header "Content-Type:text/xml" https://autodiscover_target_domain/autodiscover/autodiscover.xml
where autodiscover_target_domain
refers to the target domain of a DNS SRV
record for _autodiscover._tcp.
your_domain, or for simpler setups (without SRV
record) may just be your_domain and/or autodiscover.
your_domain.
where req.xml
looks like this,
<?xml version="1.0" encoding="utf-8"?>
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/requestschema/2006">
<Request>
<AcceptableResponseSchema>http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a</AcceptableResponseSchema>
<EMailAddress>someone@your.domain.here</EMailAddress>
</Request>
</Autodiscover>
esp. helpful on getting this right was this site.