Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Mail Server
  • Search

Webmail and Subdomain redirection

Questions regarding the Mail Server
Dovecot, Exim, RoundCube
Post Reply
  • Print view
Advanced search
4 posts • Page 1 of 1
Genome_Error
Posts: 1
Joined: Mon Sep 15, 2014 1:33 pm

Webmail and Subdomain redirection
  • Quote

Post by Genome_Error » Mon Sep 15, 2014 1:45 pm

Hi,

It's possible to associate a subdomain to the Webmail url ? like :

www.toto.com/webmail

to

toto.titi.com ?

I've tried to change in the httpd.com the document root path of my web server by the path of the Webmail, and i've changed the right to my user, it's work but when i try to log on Roundcube, its say "invalid session"...it work only if i use the root domain name.

It's possible to change the default URL Webmail by a subdomaine name ?

(sorry for my English, i hope you understand what i say...)

Thanks in advance.
Top

rasdotsu
Posts: 2
Joined: Tue Oct 07, 2014 5:52 pm
Contact:
Contact rasdotsu
Website

Re: Webmail and Subdomain redirection
  • Quote

Post by rasdotsu » Tue Oct 07, 2014 7:30 pm

Hi,

Yes, possible, but need create custom temlates and at config exist MAIL_URL variable. But any way need change some vestacp code, cause with this solution can be done just single mail.domain.com link at panel menu.

Best Regards.
Top

kallovsky
Posts: 19
Joined: Thu Mar 05, 2015 12:00 pm

Re: Webmail and Subdomain redirection
  • Quote

Post by kallovsky » Thu Mar 05, 2015 7:13 pm

Hey,

I was stumbeling about this thread, because I had the same whishes to do this.
For me it worked to edit the regarding templates in "/usr/local/vesta/data/templates/web/apache2" (Debian Distro).
I just created another Virtualhost, pointing to the Maildirectory. Of course I deleted the roundcube.conf from
/etc/apache2/conf.d
and took the content to make the template from it.

Just add this code into your template file (e.g.: /usr/local/vesta/data/templates/web/apache2/phpfcgid.tpl).
For https support you have to modify the code a bit, similar to the the *.stpl files.

Code: Select all

# email subdomain support for each user
<VirtualHost %ip%:%web_port%>

    ServerName mail.%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>
After creating the templates, you have to rebuild the user Apache2 config files. To do that run the following in terminal:

Code: Select all

v-rebuild-web-domains *USERNAME*
for just one single user or

Code: Select all

for user in $(v-list-sys-users plain); do v-rebuild-web-domains $user; done
for each user in your vestacp system.
Ah! Of course you can setup the VirtualHost with fcgi! So every client get it's own process instance based on the user account while accessing the subdomain.
I just disabled it as a workarround to get the possibility of using roundcubes password plugin to change email passwords.

I guess while running an update, the templatefiles gonna reset to default. Also v-update-webtemplates *username* does. You should store a copy of your templates in case of an update somewhere.
Currently I don't really get the way vesta is creating these templates. However, in a way it's just a workarround. I'm looking forward for better solutions.

Best regards,
Kalle
Top

Lombar
Posts: 3
Joined: Sun Dec 27, 2015 12:54 pm

Re: Webmail and Subdomain redirection
  • Quote

Post by Lombar » Sun Dec 27, 2015 1:12 pm

It's easy if you create a general rule on roundcube config for the server.
Solution here: viewtopic.php?f=12&t=8925&p=36627#p36627
Top


Post Reply
  • Print view

4 posts • Page 1 of 1

Return to “Mail Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password