Mail Autoconfig not working and SSL cert incorrect

I am not exactly new to Virtualmin, but I am now starting to use the email functions for my sites.

In the process I have managed to either screw up or not set up properly the autoconfig.

Here is what I need:

  1. An autoconfig that works
  2. An autoconfig setup for my Virtual Servers that will point them all to my Virtualmin Server’s hostname. (i.e if is trying to configure their email the script will direct them to myhostserver.tld).
  3. Use my virtualmin host servers SSL certificate in Postfix and Dovecot

Here is what I have tried:
Regarding the autoconfig, I went to System Settings–>Server Templates–>Mail client autoconfiguration and set Automatically Generated XML for Thunderbird and Outlook in the Default Settings Template.
I then went to Email Messages–>Mail Client Configuration and disabled the autoconfig and re-enabled the autoconfig. I was then able to confirm that http://mywebsite.tld/cgi-bin/autoconfig.cgi exists.
At this point I thought everything was fine, but I tried to launch Outlook and it could not discover the server settings. I then tried Thunderbird and it too could not autoconfigure, it had to fail back on the use of common server names.
I have not tried changing port numbers or server names yet since I just want to get the damned thing kind of working before I try to send the clients to the host server (instead of virtual server).

With regard to the SSL certificate, I did not realize that Dovecot and Postfix hold only one certificate for the server (makes sense now). So I had clicked copy to from one of my virtual servers in an attempt to get a certificate to match. This of course made all of my clients get a certificate error who were not on this virtual server. This is part of the reason I want to direct all mail clients to the host server name (instead of virtual server) and then try to install the SSL certificate for the host server into Dovecot and Postfix. I am not sure how to do this and didn’t want to bork things up any more.

I am running Virtualimin 1.730 on Ubuntu 14.04.1 (32-bit)

Does anyone out there have an understanding of how the autoconfig process works? I have followed the setup (as noted above) and have the file showing, but clients dont config. So I must be missing something simple.

Is this a really tough topic, or am I just missing something obvious so this thread is getting ignored. I would really appreciate help and will gladly do needed troubleshooting steps. If this is covered elsewhere, please point me that way.

It would appear that installing virtualmin on Ubuntu does not involve CGI being enabled. This prevents the autoconfig script from running properly and clients cannot enumerate it and thus ignore it.

This did the trick at the command line
sudo bash
a2enmod cgi
service apache2 restart

Now just have to investigate the best way to have all mail direct to one virtual host with one SSL cert for dovecot/postfix.

Did you ever get an answer to this? I have been trying to get the autoconfig to use the host SSL and mailer server, but the auto config seems to ignore the hard coded entries in the template and just enters defaults from the individual server. Also, I have hard coded the ports to the IMAP SSL and it sets up port 25 POP3 - go figure. I would love to find a way to force the mail setup to use the host SSL mail server. Would save so many calls and emails of people setting up email with the same old port 25 non-ssl error, especially iPhone users.