webmail URL & Login


I am getting ready to transfer some of my client sites over to my new VPS and I have a couple of email-related questions...

1) My clients are used to typing in this URL to get their webmail: mail.domain.com. Is there a way that they can keep that url as we move to Knownhost? (otherwise, they would have to change to domain.com/webmail)

2) When somebody accesses webmail, they have to log in twice -- once for cpanel and then again for the actual webmail. Can I eliminate the cpanel login? Actually, I have installed RoundCube as my webmail service -- I would like for my clients to be able to go directly to their Roundcube account. Is this possible?

You can configure Apache to route requests to Roundcube very easily since you have full access to your httpd.conf file. Either define a new virtual host for each domain or do some mod_rewrite trickery that will handle every domain. cPanel will not be involved at all.
Well you can pretty much copy one of the existing virtual host definitions and plug appropriate values into the fields if you want to go that route. If you want to use mod_rewrite then I'm afraid there are far too many variables involved for me to simply paste a generic solution in that will actually work for you. The general idea would probably be something similar to the "Dynamic Mirror" configuration detailed here: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
I went a slightly different route by creating a subdomain -- mail.domain.com

and then creating a .htaccess file in the "mail" folder which was created. The .htaccess file contains this:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mail.DOMAIN.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.mail.DOMAIN.com$
RewriteRule ^(.*)$ http://DOMAIN.com:2095/roundcube/index.php$1 [R=301,L]
I'm not exactly sure what the
$1 [R=301,L]
means, but it seems to do the trick.

I still have to do a double-login (once for c-panel and then again for RoundCube), but at least it is a little more user friendly for my clients.
You're redirecting them to port 2095 which is why cPanel is becoming involved. If you want to remove this redundancy then you'll need to install Roundcube yourself in another location and route the requests to that installation.

You also don't need to do any conditional testing if you've gone to the trouble of creating a new virtual host definition and subdomain folder. The only requests that will ever be directed to that folder governed by that .htaccess file are just about guaranteed to be requests for that subdomain, so the RewriteCond declarations are just wasting cycles parsing those regular expressions.
I thought you may like to see this writeup about installing Roundcube so it appears alongside CPanel's other webmail applications.

Me personally I prefer to put in a serverwide installation and make it available to all domains on the server. Trying to overwrite CPanel's aliases (such as domain.com/webmail) can cause a quite a bit of grief and I wouldn't recommend it. Only trouble I have ran into was making all the files readable by all users and I ended up adding users to the wheel group then chowning all folders and files to root:wheel.

Roundcube is pretty nice. Still a bit buggy in areas though. I recommend going with the latest SVN rather than the beta install. There are a huge amount of features that have been added and (so far at least) it has been 100% stable.