Restricting Webmail Client

From Lunarpages Web Hosting Wiki
Jump to: navigation, search

You can restrict which email program your webmail users are allowed to use by doing the following:


  • Login to CPanel or LPCP
  • Click on Subdomains
  • You will see a blank form to fill out with one next to it saying .domainname.com. In that blank spot enter what you want to use as your subdomain. For example, webmail. It may take a minute so be patient!
  • Once you get a confirmation message, click the go back link (do not use the back button!).
  • In the line below the one you just filled out, select the webmail.yourdomain.com in the box and click on Setup Redirection.
  • In the page that loads next enter one of the following URLs for the program you want users to be able to access. The trailing slash must be used:

Cpanel

  • Horde:
http://www.domain.com:2095/horde/index.php/
  • RoundCube:
http://www.domain.com:2095/3rdparty/roundcube/index.php/
  • Squirrel Mail:
http://www.domain.com:2095/3rdparty/squirrelmail/index.php

(The address for Squirrelmail does not work with the trailing slash)

LPCP

  • RoundCube:
https://server.lunariffic.com:20082/3rdparty/roundcubemail/index.php
  • Squirrel Mail:
https://server.lunariffic.com:20082/3rdparty/squirrelmail/index.php

(Replace server with the name of your LPCP server.)

  • Click on Save.
  • Try and access http://webmail.yourdomain.com - Login with your full email address and password, you should automatically be at the program of your choice!

Alternate method using .htaccess

  • Login in to your cpanel interface.
  • Select the Subdomain option, and create the subdomain. (ex: webmail.yourdomain.com)
  • Once it has been created, go to the File Manager option of the cPanel.
  • Navigate to public_html by selecting the folder image beside the text 'public_html'
  • Navigate to the folder that was create by your subdomain. (in the case of the example it would be the 'webmail' folder)
  • Once inside this directory, you will either see or need to create an .htaccess file. If there is no .htaccess read this article: Create_htaccess.
  • To Redirect to the Horde Webmail Client:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail.yourdomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.webmail.yourdomain.com$
RewriteRule ^(.*)$ http://yourdomain.com:2095/horde/$1 [R=301,L]
  • To Redirect to the Squirrel Mail Client:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail.yourdomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.webmail.yourdomain.com$
RewriteRule ^(.*)$ http://yourdomain.com:2095/3rdparty/squirrelmail/index.php$1 [R=301,L]

NOTE: replace 'yourdomain.com' above with your actual domain name.

  • Go to the bottom of the page and click 'Save'.
  • Now go test the subdomain in your browser.


Everything should be setup and fully functional.


You can also use a secure login to the webmail as well, for the line:

RewriteRule ^(.*)$ http://yourdomain.com:2095/horde/$1 [R=301,L]

Change this to:

RewriteRule ^(.*)$ https://yourdomain.com:2096/horde/$1 [R=301,L]

The same applies for Squirrel Mail:

RewriteRule ^(.*)$ http://yourdomain.com:2095/3rdparty/squirrelmail/index.php$1 [R=301,L]

Change this to:

RewriteRule ^(.*)$ https://yourdomain.com:2096/3rdparty/squirrelmail/index.php$1 [R=301,L]


For further help with this situation, please visit the lunarforums.


More about .htaccess can be found here:

More about .htaccess rewrites can be found here:

Share |
Want to read this in another language?