3

I work for a local ISP, Web and Email Hosting provider. I've been able to setup autoconfig/autodiscover and .mobileconfig for Thunderbird, Outlook, and IOS, respectively. This covers most of our user-base, except for beloved Android. It's tested. It works. We're using it regularly.

How can we setup something similar for Android? So far, the only option seems to be requesting the user to install a third-party app such as Outlook from the Play Store.

There has to be a way for this to work on the built-in Android Mail app.

To be explicit, our setup is as follows:

IMAP: port 993, SSL, plain password (by default protected by the SSL) SMTP: port 465, SSL, plain password (by default protected by the SSL)

Both server names are the same, but differ from the domain in the email address.

Username is the full email address.

We have many domains under our belt, so setting up DNS specifics for each domain is expensive in terms of man-power.

The ones we have delineated work well, and are universal in terms of DNS, so no DNS records needed to be added or changed, meaning we could just offer it up as part of our service and it would cover all our clientele.

Their has to be something similar for Android by now.

Is there a way to auto-configure the settings for Android Mail app based on just the email address and password yet?

Still no answers on this.

Does anyone know what Android Mail is checking when it says its attempting to automically check for settings?

jdmayfield
  • 271
  • 2
  • 11
  • AFAIK Android uses the Outlook autodiscovery method. – Sven Oct 12 '18 at 08:48
  • Which email app on android? every major phone vendor provides a different app. – Gerald Schneider Oct 12 '18 at 08:52
  • @gerald, Hi, just the basic standard Android Mail app. Not sure if Samsung uses their own, but we do get a lot of traffic for Samsung phones. Any ideas on that? – jdmayfield Oct 12 '18 at 09:37
  • @sven, Outlook has a series of fallbacks. Just from memory, the first is to check autodiscover.yourdomain.com... first, then yourdomain.com/.. I forget the url path offhand but it's working for Outlook, no SRV or other DNS record changes needed. I got this straight from MS's current online documentation. Do you know if Android Mail is only using the first method? Or not trying the second if the first seems 'unworthy'? Trying to cover about 300 domains, preferably shotgun-style. – jdmayfield Oct 12 '18 at 09:46
  • Sorry, I can't really tell, I've never actually did this, just remembered that I once learned Android works like Outlook from a few years back when I took an initial look how this whole stuff works. – Sven Oct 12 '18 at 09:54
  • @sven, no big but thanks for the input. I've read the same thing. Their seems to be no real documentation on it, just random posts everywhere that don't work. But then IOS/Mac Mail works totally different and had me on a wild goose-chase for a day, till I was able to procure a template of an email setup file. If there was a way to generate a setup file for Android Mail that would be more than acceptable. – jdmayfield Oct 12 '18 at 10:09
  • Which app? Android no longer ships a separate email app and hasn't for several years. They "integrated" it into the Gmail app, which AFAIK does no autodiscovery at all, and requires semi-manual setup. It is of course possible to use third party email apps, which may do their own autodiscovery. – Michael Hampton Dec 11 '18 at 03:16
  • Nope, no autodiscovery at all. Maybe the old Email app did, but I don't even know anyone with a device that old anymore; for me that was three phones ago. You'll definitely have to find out specifically what app, and even then there may be no autodiscovery at all. Personally I use BlueMail, which perfectly guessed my IMAP and SMTP servers as mail.example.com with no effort on my part to set up anything in the DNS or web server at all. – Michael Hampton Dec 11 '18 at 03:41

1 Answers1

7

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.

Andrew Richards
  • 324
  • 3
  • 8