thunderbird-android icon indicating copy to clipboard operation
thunderbird-android copied to clipboard

Feature Request: Support Mozilla autoconfig

Open phoerious opened this issue 10 years ago • 17 comments

When using K9 mail with IMAP/SMTP servers other than well known mail service providers like GMail, automatic configuration of new mail accounts will almost certainly fail.

It would be great if K9 mail would support autoconfig like proposed by Mozilla: https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Autoconfiguration

Basically, this works as follows: I enter [email protected] as email address. Instead of guessing that my mail server is imap.example.com, my connection security SSL/TLS at port 993 and my username fred, K9 contacts http://autoconfig.example.com/mail/[email protected] which returns an XML configuration file. This XML file tells K9, that the mail server is actually someotherhost.example.net, STARTTLS at port 143 is the preferred connection method and my user name is [email protected].

Microsoft uses similar techniques for their Exchange servers, but instead of querying autoconfig.example.com, the domain autodiscover.example.com is used. See https://msdn.microsoft.com/en-us/library/office/jj900169(v=exchg.150).aspx for more information.

phoerious avatar Oct 24 '15 14:10 phoerious

Also note SRV records for configuring incoming mail servers

DNS-based configuration: created by IETF in 2011. SRV records give

all information for email configuration. Information about this way can be found here: https://tools.ietf.org/html/rfc6186

and we could use MX records to determine SMTP server addresses.

This method doesn't completely autoconfigure it - you'd still have to know the login format - email address / user-part / something else.

NB: This is: https://code.google.com/archive/p/k9mail/issues/2331

philipwhiuk avatar Apr 19 '16 09:04 philipwhiuk

It's a pity that the code from https://github.com/dzan/k-9/tree/experimental/settings-autocomplete-finalfixes was never merged.

Did it need extra work?

JacZig avatar Sep 15 '16 10:09 JacZig

Any progress with this? It works like a charm for Thunderbird and others and setting up a script which auto-creates the files on server side took me less than a day with parsing the postfix and dovecot configurations for proper values for all hosted domains and usernames. A static file is much less work again.

I'd like to see my favourite Android mail programm also support that easy mechanism. Many domain providers support this already out of the box.

Its as easy as download the file (replace example.com and fred with mail address): http://autoconfig.example.com/mail/[email protected] or as second try http://example.com/.well-known/autoconfig/mail/config-v1.1.xml and parse the resulting XML:

The XML format is really easy: https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Autoconfiguration/FileFormat/HowTo

stoecker avatar Feb 25 '17 12:02 stoecker

P.S. The Microsoft methods are complicated, partly undocumented and not even supported by all Microsoft tools (I tested several when I tried to implement usable server support and in the end gave up), so the Thunderbird method is the only useful way ATM.

stoecker avatar Feb 25 '17 12:02 stoecker

Actually there are at least three ways for autoconfiguration:

  • Autodiscover, xml based: created by Microsoft about 12 years ago. Probably mostly for Outlook/Exchange accounts, but also works with any other email account. This site should give all information needed for implementation:
  • Autoconfig, xml based: created by the Mozilla foundation. Quite simple xml configuration information originally created for Thunderbird, in the meantime also being used by other clients.
  • DNS-based configuration: created by IETF in 2011. SRV records give all information for email configuration.

With any of these configuration mechanisms a user would only have to provide his email address and a password to get the correct configuration settings for pop3, imap and smtp (submission).

code-chicken avatar Feb 25 '17 12:02 code-chicken

As said in last comment the Microsoft stuff is very complicated, incompletely documented, differs between client versions and is not even fully supported by Microsoft tools, so I'd drop that in any consideration.

The SRV based stuff is fine, but limited in scope to Autoconfig. It can't provide username and some other details (login methods, preferred ports, ...).

Thought a fine implementation should probably try Autoconfig first and when not provided use SRV based configuration for the server names.

stoecker avatar Feb 25 '17 13:02 stoecker

This issue was worked on at GSOC 2017, see:

  • https://k9mail.github.io/2017/05/05/Google-Summer-of-Code-2017-Projects.html
  • https://daquexian.me/blog/2017/08/29/K9Mail_GSoC_summary/
  • https://github.com/k9mail/k-9/pull/2580

Unfortunately it has not been merged yet :-/

cweiske avatar Oct 09 '17 07:10 cweiske

When the code will be merge ? We need this because end users not use K-9 because they don’t know how to configure emails server information. They currently use N app one by big provider. After i install and configure it they love K9 but they need me if they change their phone.

Nice app, nice work.

HumanG33k avatar Jan 30 '18 14:01 HumanG33k

Any news?

BTW docs seem to be here: https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Autoconfiguration

There seem to be multiple ways that autodiscover is implemented.

rugk avatar May 26 '18 11:05 rugk

It would be great if this feature were finally merged into k9. Bad enough that the android own mail client does not support any of these methods!

smeinecke avatar Nov 06 '18 08:11 smeinecke

@smeinecke Last time I checked the branch that had this feature it had a lot of other changes so it was really hard to cherry-pick and the quality was not that great (but it worked! :) ).

I suppose it would take some time to get it in shape and at least support a minimal subset of autoconfig.xml.

wiktor-k avatar Nov 06 '18 09:11 wiktor-k

Would love to see this implemented soon in the best mail client on Android

computersalat avatar Jan 10 '19 14:01 computersalat

Parts of the solution have been merged in march. If you care for one provider explicitly you can also add the config to providers.xml until this is resolved.

hex-m avatar Oct 08 '19 13:10 hex-m

Hmm, my provider is altready in the XML, but in the last setup I did some time ago, I still had to configure it manually. Was a version with that already released?

rugk avatar Oct 09 '19 15:10 rugk

Hi evreyone, I think that with the rapprochement between thunderbird and K9 this issue is again relevant?

Thank you in advance,

ASLLR avatar Jun 15 '22 10:06 ASLLR

The roadmap for the near future includes improved account setup using Thunderbird account auto-configuration

It was even part of the official announcement :)

fleaz avatar Jun 15 '22 15:06 fleaz

As a follow up to #6250 I would like to add to this thread that I have created a project tat allows you to run a server that supports all currently known autodiscover methods and the code has comments about what real apps use what method. Feel free to leave feedback on https://github.com/wdes/mail-autodiscover-autoconfig I hope it's not too much off topic Anyway, it can help anyone that would want to test autodiscover code/feature

williamdes avatar Aug 25 '22 16:08 williamdes

Thunderbird's Autoconfig mechanism has now been available in K-9 Mail 6.7xx beta versions for a while.

cketti avatar Nov 07 '23 12:11 cketti