The autodiscover method used by Exchange looks great. However I do not have Exchange.
It looks like when setting up a mail account the device/mail client looks for a autodiscover.xml file.
Is there a way to create such a file by myself and serve it on a usual Linux server, pointing to a usual mail Linux server?
First you will need to tell Outlook where to go. Use an SRV record in DNS that points to the server containing your Autodiscover.xml file:
Use the PHP script here: http://virer.net/info/ol-autodiscover/index.html to return the Autodiscover.xml file to clients. It has some PHP embedded so you can return different values depending on the e-mail address entered into Outlook. (Helpful if you want to use one autodiscover file to return results for multiple domains/clients using one config script).
Once that script is on your webserver and working, make sure you enable HTTPS with a valid certificate so Outlook doesn't throw errors when trying to download it.
Just finished configuring autodiscover on my Linux server. Now mail is setup automatically in almost all possible clients.
Here is an easy solution to setup Autodiscovery with POP3/IMAP settings;
DNS:
PHP (autodiscover.php):
.htaccess :
NB! Remember to get a SIGNED SSL Cert.
Actually if your clients are Outlook (I'll assume that because you said they are looking up autodiscover.xml) you want to use Guessmart for autoconfiguration if you're using POP/IMAP and SMTP. Guessmart is basically Outlook using your email address and password to try various hostnames using common POP/IMAP/SMTP ports until it finds one it can successfully log into. It's the same user experience in Outlook as Autodiscover but meant for non Exchange servers.
You can test all this in Outlook by ctrl-right-clicking the notification tray Outlook icon and selecting "Test Email Autoconfiguration". Uncheck the Autodiscover and test Guessmart to see how Outlook works.
I updated Frode Saetre's solution to work on my server.
DNS: (unchanged)
PHP (autodiscover.php): (updated)
.htaccess (unchanged)
No, Autodiscover is specific to Exchange, you won't get that working outside of that environment.
It's not just the .xml file, there are a lot of things at play when it comes to Autodiscover.
To give you some quick background, read through this article, and you will get a better idea of it.
http://www.msexchange.org/articles_tutorials/exchange-server-2010/management-administration/exchange-autodiscover.html