Hey,
(Lets suppose that you are using Debian distro)
You have to create a new virtual host for your apache template and a new dns record in the DNS templates as well so that you can automatically create the domain name to webmail.domain.com then you have to rebuild you web domains so that they can take effect.
e.g:
You have to modify the template for apache2 first going to
Code: Select all
/usr/local/vesta/data/templates/web/apache2/
and editing the apache template that you are using for your hosted domains, in my case I'm using phpfcgid.tpl.
As soon as you are there, edit the file with your favorite text viewer.
And at the end of the file qhere you can see </VirtualHost> add this:
Code: Select all
# email subdomain support for each user
<VirtualHost %ip%:%web_port%>
ServerName webmail.%domain_idn%
ServerAdmin %email%
DocumentRoot /var/lib/roundcube
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
Alias /vstats/ %home%/%user%/web/%domain%/stats/
Alias /error/ %home%/%user%/web/%domain%/document_errors/
CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes
CustomLog /var/log/%web_system%/domains/%domain%.log combined
ErrorLog /var/log/%web_system%/domains/%domain%.error.log
Alias /roundcube/program/js/tiny_mce/ /usr/share/tinymce/www/
Alias /roundcube /var/lib/roundcube
# Access to tinymce files
<Directory "/usr/share/tinymce/www/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
allow from all
</Directory>
<Directory /var/lib/roundcube/>
Options +FollowSymLinks
# This is needed to parse /var/lib/roundcube/.htaccess. See its
# content before setting AllowOverride to None.
AllowOverride All
order allow,deny
allow from all
</Directory>
# Protecting basic directories:
<Directory /var/lib/roundcube/config>
Options -FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/lib/roundcube/temp>
Options -FollowSymLinks
AllowOverride None
Order allow,deny
Deny from all
</Directory>
<Directory /var/lib/roundcube/logs>
Options -FollowSymLinks
AllowOverride None
Order allow,deny
Deny from all
</Directory>
</VirtualHost>
Then save the file
Then you have to modify your DNS template at:
Code: Select all
/usr/local/vesta/data/templates/dns
(I'm using default.tpl)
And add this at the end of the file:
Code: Select all
ID='10' RECORD='webmail' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
Edit the ID to the correlative number if needed.
Then save the file:
Rebuild you users for web and dns templates from the front end on the panel.
And thats it!
Hope this works