View Single Post
Old 15th August 2012, 05:18
tahunasky tahunasky is offline
Join Date: Jul 2012
Location: Buenos Aires
Posts: 84
Thanks: 1
Thanked 9 Times in 9 Posts

For CentOS 6.3 what i have done, is when a user types in (or, etc) it goes to roundcube, but can be the same for squirrelmail.

Create a DNS mail CNAME record for each domain you want to redirect the subdomain mail to squirrelmail. I think ispconfig automatically makes an A record for mail, but if you are going to the same IP address i prefer the CNAME as if i change the IP address i dont need to change every subdomains records IP address, just the main domain A record..

SO in DNS create the CNAME record.

CNAME 	mail
then create a file as below:

<VirtualHost *:80>
    ServerAlias mail.*
    DocumentRoot /usr/lib/squirrelmail
# put the below 3 lines if you require SSL connectiom
    RewriteEngine  on
    RewriteCond    %{HTTPS} !=on
    RewriteRule ^mail(.*) https://mail.{HTTP_HOST}

# the below section is only need if you have above 3 lines and want SSL
<VirtualHost *:443>
    ServerAlias mail.*
    DocumentRoot /usr/lib/squirrelmail
    SSLEngine On
    SSLCertificateFile /usr/local/ispconfig/interface/ssl/ispserver.crt
    SSLCertificateKeyFile /usr/local/ispconfig/interface/ssl/ispserver.key
then i create a link to the /etc/httpd/conf/sites-enabled/ directory:

ln -s /etc/httpd/conf/sites-available/_default.vhost /etc/httpd/conf/sites-enabled/000-default.vhost
this way it doesnt matter what domain is used, if the put in the mail subdomain they will all go to the same place, and any new domains you add with the mail subdomain will also be sent to squirrelmail without any extra configuring.

Last edited by tahunasky; 15th August 2012 at 05:34.
Reply With Quote