I'm running a web server with Apache2 and several virtual domains. Also, there's a mail server for these domains, exposing a web interface. For each virtual domain example.com, I have the subdomain mail.example.com pointing to my webmail interface (Roundcube). It works nicely with the following configuration:
<VirtualHost *:80>
ServerAdmin me@example.com
ServerName mail.example.com
ServerAlias mail.vname1.com, mail.vname2.com, mail.vname3.com, #...
DocumentRoot /srv/www/mail/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /srv/www/mail>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/mail.error.log
LogLevel warn
CustomLog /var/log/apache2/mail.access.log combined
</VirtualHost>
However, for each new customer, I have - among other things - to add the corresponding domain name to the list of ServerAliases.
Is there a way to automatically associate all mail.* subdomains with /srv/www/mail/?