View Single Post
Old 27th June 2006, 12:54
todvard todvard is offline
Join Date: Aug 2005
Posts: 85
Thanks: 1
Thanked 6 Times in 5 Posts

Originally Posted by monster
Do i have to insert this for every domain i add?
no, only once as a new apache virtualhost:

STEP 1.: create a new web in ISPconfig, with name mail.YOURDOMAIN.COM. Install Squirrelmail into this web. Make sure it is working, accessible from outside and you can log in. Create SSL certificate for this website if you would like to log in to webmail through HTTPS.

STEP 2. create a new virtualhost in apache (eg.: /etc/apache2/sites-available/webmail.conf) with this content:

ServerName mail.*:80
ServerAdmin webmaster@YOURDOMAIN.COM

DocumentRoot /var/www/sharedip

RewriteEngine On
RewriteCond %{HTTP_HOST} ^webmail..+..+$ [NC]
RewriteCond %{HTTP_HOST} !^mail.YOURDOMAIN.COM$
RewriteRule ^(.*)$ https://mail.YOURDOMAIN.COM$1 [R=301]

Note: replace IP address with your IP address and YOURDOMAIN.COM with your domain name. If you dont want to server webmail over HTTPS replace
RewriteRule ^(.*)$ https://mail.YOURDOMAIN.COM$1 [R=301] with
RewriteRule ^(.*)$ http://mail.YOURDOMAIN.COM$1 [R=301]

STEP 3. link it to sites-enabled:
ln -s /etc/apache2/sites-available/webmail.conf /etc/apache2/sites-enabled/webmail.conf
STEP 4. go back to ISPconfig - DNS Manager and create "webmail" host for every domain which should access your webmail site through webmail.OTHERDOMAIN.COM
Reply With Quote