Author Topic: How do Autodiscover work for IMAP/SMTP?  (Read 7115 times)

Itakfule

  • Guest
How do Autodiscover work for IMAP/SMTP?
« on: July 06, 2017, 11:59:38 am »
Hello,

i try to Autoconfigure AquaMail, but i fail every time. If i try "Microsoft's remote Connectivity Analyzer", it finds successfully the IMAP and SMTP Server for my E-Mail Address. But if i try AquaMail it fails and i must use manual setup. My Provider has setup a SRV entry in DNS _autodiscover._tcp.mydomain.com which points to https://autoconfigure.myprovider.com:443/Autodiscover/Autodiscover.xml. Additionally, i have created a Subdomain autodiscover.mydomain.com. In the Webroot of this Subdomain, i have a .htaccess File with the following content:

Code: [Select]
RedirectMatch 302 (?i)^/Autodiscover/(.*)$ https://autoconfigure.myprovider.com:443/Autodiscover/$1
But also with the htaccess file, AquaMail fails to find the correct Information. Is there any way, to get this to work?

StR

  • Hero Member
  • *****
  • Posts: 1558
Re: How do Autodiscover work for IMAP/SMTP?
« Reply #1 on: July 06, 2017, 10:44:59 pm »
I am not aware of any "native" autodiscover mechanisms for IMAP/SMTP, except for those based on common server names, such as imap.domain.com and smtp.domain.com.
(Exchange is different.)
If you were to google "IMAP autodiscover", you could find people discussing various hacks, mostly for Outlook client. I believe "autodiscover" is exclusively Microsoft's feature, and "autodiscover" for IMAP is an attempt to adapt it to IMAP, but without a standard it would be hard. (Or, maybe there is an RFC that I just don't know?)

As for Aquamail, having used its IMAP for over 3 years, I don't think it has any logic set up for those hacks.

I am just curious, why do you need to use such a complicated way, rather then setting {imap,smtp}.domain.com in the DNS?

Itakfule

  • Guest
Re: How do Autodiscover work for IMAP/SMTP?
« Reply #2 on: July 07, 2017, 07:10:02 am »
The problem is, that my providers IMAP and SMTP server are on a different Domain than mine own domain or better the domainame of my Mailaddress. All other Clients on the Desktop can find the correct servers automatically with the above settings, but not AquaMail.

Itakfule

  • Guest
Re: How do Autodiscover work for IMAP/SMTP?
« Reply #3 on: July 07, 2017, 08:02:18 am »
Could a CNAME Record be a Workaround?

Should it work, if i setup 2 new Subdomains for my Domain called imap.mydomain.com and smtp.mydomain.com. To point this new Subdomains to the real Server i could enter a CNAME, so that these 2 Sudomains resolve to imap.provider.com and smtp.provider.com.

Could this work or will this be also problematic?

StR

  • Hero Member
  • *****
  • Posts: 1558
Re: How do Autodiscover work for IMAP/SMTP?
« Reply #4 on: July 07, 2017, 12:10:27 pm »
I see... So, you do not have control over the IMAP and smtp servers.
The trick with CNAME probably will not work, because the TLS certificaties (aka SSL certificates) will not contain IMAP.yourdomain.com and smtp.yourdomain.com  in the alternative names field. So, Aquamaill (and any other client) should complain about wrong certs.

I might be forgetting some alternative,  but I suspect,  in this case, your best bet is to configure Aquamail manually. (Did you see the button "manual"?)
« Last Edit: July 07, 2017, 12:12:08 pm by StR »

Itakfule

  • Guest
Re: How do Autodiscover work for IMAP/SMTP?
« Reply #5 on: July 07, 2017, 12:48:31 pm »
Currently i didn't have the Control over these 2 Servers. Maybe i setup my own Server on a small Raspberry Pi, but i don't know if this machine has enough Power to serve E-Mail, AntiSpam and AntiVirus. Another Problem would be to configure the SMTP Server in that way, that the sended E-Mail would not be sorted as Spam for all the Recipients... This would have also the Advantage, that i could better deal with some IMAP Feature, which my Provider currently does not support.

Anyhow i will test this with another Subdomain, before i try my maindomain for this.

In the meantime, i can live with the Problem that i have to manually accept the SSL Certificate. Since currently there are only 7 Users this Domain (it's a Family Domain only), its also not that Problem for the Rest of the Users. Maybe AquaMail could support in the future the same mechanism as eM Client, Outlook and/or Thunderbird on the Desktop.

Itakfule

  • Guest
Re: How do Autodiscover work for IMAP/SMTP?
« Reply #6 on: July 07, 2017, 02:38:45 pm »
I have found a similar thread at https://www.aqua-mail.com/forum/index.php?topic=4621.msg26160#msg26160 (i don't know, why i didn't find it before). With that thread, AquaMail does also make a MX Lookup and if it finds it, it looks for corresponding Servers in it's Provider Database. So i think, in my case, it doesnt find my Provider after finding the MX Entry (which points to the correct providerspecific Domain). So maybe AquaMail could add my Provider please? It's a relative big Provider in Germany, so this could be make some sense. You can find all Mail Information here: https://www.strato.de/faq/article/259/Die-STRATO-E-Mail-Server.html

StR

  • Hero Member
  • *****
  • Posts: 1558
Re: How do Autodiscover work for IMAP/SMTP?
« Reply #7 on: July 07, 2017, 08:23:08 pm »
Sorry, I forgot that Aquamail also tries using MX records.

I don't know all the details of how that works.
The developer, Kostya, will probably respond soon  - and he might consider adding that provider to the database if it is not there yet.


Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: How do Autodiscover work for IMAP/SMTP?
« Reply #8 on: July 07, 2017, 10:14:10 pm »
For EWS accounts, the app uses (2 out of 3) Exchange AutoDiscover mechanisms.

For Internet Mail, since that's not the typical case for Exchange, there is no Exchange AutoDiscover.

Instead, the app has a built-in database of mail services.

Failing that, it does an MX lookup on the domain and then tries to match one of those "well known services" by its "well known MX".

Failing that, it tries imap.<domain> and smtp.<domain> -- unless the MX starts with "mail." in which case it tries mail.<domain> for both IMAP and SMTP.

---

In any case, you can just tap the Manual button and enter any server settings you require.
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

ted

  • Newbie
  • *
  • Posts: 1
Re: How do Autodiscover work for IMAP/SMTP?
« Reply #9 on: June 22, 2018, 01:12:14 pm »
How we can add new entries to built-in database of mail services ?

Our support service has informed me that they have an increasing number of customers using AquaMail, therefore we would like to simplify the configuration process by using something similar to Thunderbirds autoconfig or Microsoft autodiscovery.

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: How do Autodiscover work for IMAP/SMTP?
« Reply #10 on: June 26, 2018, 10:39:39 pm »
Quote
Our support service has informed me that they have an increasing number of customers using AquaMail, therefore we would like to simplify the configuration process by using something similar to Thunderbirds autoconfig or Microsoft autodiscovery.

This can be done with an .XML file that'd need to be placed on each phone's storage. Rooting is not required.

Is this possible (maybe you're using MDM)?

Alternatively - would you be able to make DNS entries for imap.<domain> and smtp.<domain>?
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/