outlook autoconfiguration doesn't push all the script aliases into the apache file

Despite the code here only the last ScriptAlias, /autodiscover/autodiscover.xml , is pushed into the configuration.

Luckily this seem to be the one documented to work.

The earlier two items aren't pushed

/usr/share/webmin/virtual-server/feature-mail.pl

                if (!$found_outlook) {
                        local $cgidir = &cgi_bin_dir($d);
                        push(@sc, "/AutoDiscover/AutoDiscover.xml ".
                                  "$cgidir/autoconfig.cgi");
                        push(@sc, "/Autodiscover/Autodiscover.xml ".
                                  "$cgidir/autoconfig.cgi");
                        push(@sc, "/autodiscover/autodiscover.xml ".
                                  "$cgidir/autoconfig.cgi");
                        &apache::save_directive("ScriptAlias", \@sc,
                                                $vconf, $conf);
                        }

This occurs when saving over the Server Templates -> {template} -> Mail client autoconfiguration, (select XML template below) -> save.

Virtualmin version 4.18

Status: 
Active

Comments

I don't quite follow .... are you saying that the updated script doesn't get copied to domains' cgi-bin directories?

Only ScriptAlias /autodiscover/autodiscover.xml ...cgi-bin/autoconfig.cgi. gets added to the apache config.

The other case different variants aren't added. The resulting apache file is:

<VirtualHost 113.212.99.194:80 [2400:c400:a000:ace::2]:80>
SuexecUserGroup "#1200" "#1104"
ServerName X
ServerAlias www.X
ServerAlias webmailX
ServerAlias admin.X
ServerAlias autoconfig.X
DocumentRoot /home/X/public_html
ErrorLog /var/log/virtualmin/X_error_log
CustomLog /var/log/virtualmin/X_access_log combined
ScriptAlias /cgi-bin/ /home/X/cgi-bin/
ScriptAlias /awstats/ /home/X/cgi-bin/
ScriptAlias /autodiscover/autodiscover.xml /home/X/cgi-bin/autoconfig.cgi

Alias /awstats-icon/ /usr/share/awstats/icon/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/S/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksifOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/X/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/X/fcgi-bin/php5.fcgi .php5
</Directory>
<Directory /home/X/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
</Directory>
...
Redirect /mail/config-v1.1.xml /cgi-bin/autoconfig.cgi
</VirtualHost>

hence missing:

ScriptAlias /AutoDiscover/AutoDiscover.xml /home/X/cgi-bin/autoconfig.cgi
ScriptAlias /Autodiscover/Autodiscover.xml /home/X/cgi-bin/autoconfig.cgi

I suspect these where added because of some Outlook implementation expecting a different case variant.

The cgi-bin script is created and copied correctly to all users (though it doesn't report error out if the user is over quota - end up with a 0 byte script).