Okay, since this has been floating around for quite a while, I'd like to make it an official feature request. :)
While Virtualmin users can of course set this up manually/individually, It'd be great to include automatic email client autoconfiguration support in Thunderbird style into Virtualmin. To do that for domain example.com
, one needs to:
- The autoconfig file needs to be served on the subdomain
autoconfig.example.com
. - That domain needs to serve a file with the URL
http://autoconfig.example.com/mail/config-v1.1.xml?emailaddress=user@example.com
. - The contents of the file I listed below
Idea would be to create an Apache RewriteRule to map the autoconfig domain to some central autoconfig storage URL, like it is done with the "admin" and "webmail" subdomains.
Config file contents example:
<?xml version="1.0" encoding="UTF-8"?> <clientConfig version="1.1"> <emailProvider id="example.com"> <domain>example.com</domain> <displayName>Example Mail</displayName> <displayShortName>Example</displayShortName> <incomingServer type="imap"> <hostname>mail.example.com</hostname> <port>993</port> <socketType>SSL</socketType> <authentication>password-cleartext</authentication> <username>%EMAILADDRESS%</username> </incomingServer> <outgoingServer type="smtp"> <hostname>mail.example.com</hostname> <port>465</port> <socketType>SSL</socketType> <authentication>password-cleartext</authentication> <username>%EMAILADDRESS%</username> </outgoingServer> </emailProvider> </clientConfig>
Full details about the file can be found here: https://developer.mozilla.org/en-US/docs/Thunderbird/Autoconfiguration/F...
Issues that I see is the username format, which can be quite versatile per virtual server, and the connection type (SSL, STARTLS, port numbers). Maybe that information can be fetched from somewhere, or entered in the Template page for Email.
The username supports the placeholders "%EMAILADDRESS%" and "%EMAILLOCALPART%". If the Virtual Server uses a different scheme for naming users, like "user@example" without ".com", some script that does the correct conversion is required.
Comments
Submitted by JamieCameron on Mon, 11/26/2012 - 13:18 Comment #1
That sounds like a cool feature, and not too hard to implement.
There probably isn't even any need for a rewrite rule - instead autoconfig.example.com could just be another ServerAlias for example.com in the Apache config, and /mail/config-v1.1.xml could be served by a trivial CGI script that outputs the appropriate XML.
Submitted by Locutus on Mon, 11/26/2012 - 14:52 Comment #2
Very nice!
Without the rewrite rule the CGI script would have to be copied to each domain that uses autoconfig. Works of course, I figured having a central script instance could prevent that.
Submitted by Locutus on Mon, 11/26/2012 - 16:14 Comment #3
You're right... If you make this into a Feature that can be turned on or off, similar to AWStats, it's probably best to copy the CGI script into each domain, and make the "autoconfig" simply a ServerAlias. Maybe make a RedirectMatch to point the URL path to the right file system path, like with AWStats.
Here's my PHP script that I'm currently using. I re-write the autoconfig subdomain to a central domain and keep the query string intact.
Submitted by JamieCameron on Tue, 01/08/2013 - 00:54 Comment #4
I have just finished implementing this, for inclusion in the next (3.98) Virtualmin release. You will be able to enable or disable it for all virtual servers (with mail and a website enabled) at once.
Submitted by Locutus on Tue, 01/08/2013 - 06:18 Comment #5
Very nice! I'm gonna test that, even though I tinkered a manual solution for myself meanwhile.
Submitted by Issues on Tue, 01/22/2013 - 06:46 Comment #6
Automatically closed -- issue fixed for 2 weeks with no activity.