Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 14th August 2012, 17:51
breauxlg breauxlg is offline
Junior Member
 
Join Date: Jul 2009
Posts: 27
Thanks: 3
Thanked 0 Times in 0 Posts
Default Redirect webmail.domain.com to mail.domain.com/squirrelmail

I know this is probably very simple and I'm just not getting it, but I want my users to be able to type in webmail.domain.com and have ispconfig3 redirect to mail.domain.com/squirrelmail. I love squirrelmail, but I've had to answer one too many questions about the name. I can do the cname pointing, but don't know how to make Ispconfig3 handle it.
Reply With Quote
Sponsored Links
  #2  
Old 15th August 2012, 04:18
tahunasky tahunasky is offline
Member
 
Join Date: Jul 2012
Location: Buenos Aires
Posts: 84
Thanks: 1
Thanked 8 Times in 8 Posts
Default

For CentOS 6.3 what i have done, is when a user types in mail.domain.com (or mail.domain1.com, mail.domain2.com 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.

Code:
    
CNAME 	mail 	domain.com.
then create a file as below:

/etc/httpd/conf/sites-available/_default.vhost
Code:
  
<VirtualHost *:80>
    ServerName mail.domain.com
    ServerAlias mail.*
    DocumentRoot /usr/lib/squirrelmail
    ServerAdmin webmaster@domain.com
# put the below 3 lines if you require SSL connectiom
    RewriteEngine  on
    RewriteCond    %{HTTPS} !=on
    RewriteRule ^mail(.*) https://mail.{HTTP_HOST}
</VirtualHost>

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

Code:
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 04:34.
Reply With Quote
  #3  
Old 15th August 2012, 07:29
fbartels fbartels is offline
Junior Member
 
Join Date: Feb 2012
Location: Hanover, Germany
Posts: 21
Thanks: 0
Thanked 4 Times in 4 Posts
Default

The cheapest trick probably would be to put this php file into the directory of webmail.domain.com. This way your customer will be automatically redirected to http://mail.domain.com/squirrelmail

Code:
<?php
header("Status: 301 Moved Permanently");
header("Location:http://mail.domain.com/squirrelmail");
exit;
?>

Last edited by fbartels; 15th August 2012 at 18:12. Reason: Changed the forward code and therefore also the decription how the redirect works
Reply With Quote
  #4  
Old 15th August 2012, 11:57
Sir Henry Sir Henry is offline
Member
 
Join Date: Jan 2012
Posts: 53
Thanks: 1
Thanked 5 Times in 5 Posts
Default

I think he does not even want his users to know where the redirection goes to.

With ISPConfig this issue is as simple as creating a site domain.com and a subdomain mail.domain.com with a proper redirect. If the real files are outside the web directory you could solve this with a symbolic link. You will then also have to add the real path to the PHP open_basedir in the Options tab.
__________________
Cheers, Sir Henry
Reply With Quote
  #5  
Old 21st August 2012, 19:24
breauxlg breauxlg is offline
Junior Member
 
Join Date: Jul 2009
Posts: 27
Thanks: 3
Thanked 0 Times in 0 Posts
Default Now squirrelmail doesn't even come up

Now, when I goto squirrelmail, I get this box that pops up:
You have chosen to open

which is a: application/x-httpd-suphp (671 bytes)
from:www.domainname.com

What should Firefox do with this file?
Reply With Quote
  #6  
Old 21st August 2012, 20:24
fbartels fbartels is offline
Junior Member
 
Join Date: Feb 2012
Location: Hanover, Germany
Posts: 21
Thanks: 0
Thanked 4 Times in 4 Posts
Default

you have been presented three different ways to achieve what you want. Which way have you chosen?
Reply With Quote
  #7  
Old 22nd August 2012, 01:33
tahunasky tahunasky is offline
Member
 
Join Date: Jul 2012
Location: Buenos Aires
Posts: 84
Thanks: 1
Thanked 8 Times in 8 Posts
Default

It could be an error from rewriting the address... What have you done ?

I would try this in the squirrelmail.conf or what ever other file you have used with the alias:

Code:
Alias /webmail /opt/squirrelmail
Alias /sm /opt/squirrelmail

<Directory /opt/squirrelmail>
  Options +FollowSymLinks
  Order allow,deny
  allow from all

  RewriteEngine  on
  RewriteCond    %{HTTPS} !=on
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</Directory>
Reply With Quote
  #8  
Old 26th August 2012, 14:36
Sir Henry Sir Henry is offline
Member
 
Join Date: Jan 2012
Posts: 53
Thanks: 1
Thanked 5 Times in 5 Posts
 
Default

Quote:
Originally Posted by breauxlg View Post
Now, when I goto squirrelmail, I get this box that pops up:
You have chosen to open

which is a: application/x-httpd-suphp (671 bytes)
from:www.domainname.com

What should Firefox do with this file?
You have to enable suPHP for the directory, see this article for a similar issue.
__________________
Cheers, Sir Henry
Reply With Quote
Reply

Bookmarks

Tags
redirect, squirrelmail, webmail

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sieve Redirect PaulDG General 1 22nd June 2012 18:35
Redirect Problems in ISPConfig 3.0.4.1 midcarolina General 0 27th November 2011 17:34
New feature request: Frame redirect funtion for ISPConfig3 Hans Feature Requests 1 12th January 2011 00:43
Infinite redirect loop stolenpants General 13 23rd August 2010 17:36
Redirect Wireless Client to Late-Pay Notice giganet Server Operation 1 19th June 2009 08:57


All times are GMT +2. The time now is 22:48.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.