The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Direct login in roundcube webmail

Discussion in 'E-mail Discussions' started by jcorreia, Jul 9, 2008.

  1. jcorreia

    jcorreia Well-Known Member

    Joined:
    Apr 25, 2005
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    Hi,
    I would like that the users when acessing webmail could be logged on directly into roundcube without passing in the cpanel window where they can see the options to;
    "Change Password,Forwarding Options,Auto Responders,Configure Mail Client...etc"

    is this possible or there is already an URL that I don´t know ?

    Thanks,
    Jorge Correia
     
  2. SuperBaby

    SuperBaby Well-Known Member

    Joined:
    Nov 27, 2003
    Messages:
    331
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Thailand
    cPanel Access Level:
    Website Owner
    Twitter:
    Me too want to know.
     
  3. jcorreia

    jcorreia Well-Known Member

    Joined:
    Apr 25, 2005
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    anybody ? is it possible or available ? is it in plans ?

    Thanks
     
  4. jcorreia

    jcorreia Well-Known Member

    Joined:
    Apr 25, 2005
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    well....at least the path to the file so I can change the code of it ?
     
  5. DaveUsedToWorkHere

    DaveUsedToWorkHere Well-Known Member

    Joined:
    Dec 28, 2001
    Messages:
    689
    Likes Received:
    1
    Trophy Points:
    18
    You can click on the Enable AutoLoad link to have Roundcube auto appear after 5 seconds on each login. This is designed to allow the mail user to have access to the other options in the mail interface which can greatly improve their mail experience.

    For example, Mail filtering allows them to set up filters/rules on their account so they don't have to configure them in each email application they use. Mail users can also set up filters to send mail to another account through this interface rather than having to ask the site admin to do so.


    There's not currently a way to edit the login page but you could put in place a custom page using /scripts/postupcp as putting a custom page in /usr/local/cpanel/base/webmail/x3/ will result in the custom page being overwritten after any update.

    To 'hack' a custom page into place See my later post for a cross-browser JavaScript approach:

    Create a file called /root/roundcuberedirect.html that contains this:

    Code:
    <cpanel Email="check_roundcube()">
    <meta http-equiv="refresh" content="0;<cpanel print="$CPVAR{'roundcube'}">/index.php">
    
    Then, create a text file called /scripts/postupcp that contains this:

    Code:
    #!/bin/sh
    (cp /root/roundcuberedirect.html /usr/local/cpanel/base/webmail/x3/index.html)
    
    After those are created, the html file containing the meta-refresh will be copied in place of the webmail home page each time you update cPanel. run /scripts/postupcp to switch the files and you'll be good to go.
     
    #5 DaveUsedToWorkHere, Jul 15, 2008
    Last edited: Apr 28, 2009
  6. jcorreia

    jcorreia Well-Known Member

    Joined:
    Apr 25, 2005
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    Thanks for your answer :)

    I know it´s a good thing for them to have this option, but our server is managed, and sometimes a 'user can´t break what they can´t see' :D

    I will try your solution. Once again thanks :cool:
     
  7. glicky

    glicky Registered

    Joined:
    Jun 21, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I would like to use the standard roundcubes login page like in their demo and generall installs, not the cpanel popup window method. Is this possible?
     
  8. DaveUsedToWorkHere

    DaveUsedToWorkHere Well-Known Member

    Joined:
    Dec 28, 2001
    Messages:
    689
    Likes Received:
    1
    Trophy Points:
    18
    This is not possible. You need to login to the cPanel webmail interface before accessing roundcube. As discussed above, once logged into the webmail interface, the user can be taken directly to roundcube.
     
  9. Ado`

    Ado` Registered

    Joined:
    Jul 5, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Works for Firefox but not IE ! ?

    Hi cpaneldave,
    This workaround works in Firefox however in Internet Explorer it simply creates an endless loop after submitting the login details. Any possibility you know of a reason as to why this is and what would fix it ?
     
  10. whplus

    whplus Well-Known Member

    Joined:
    Dec 8, 2007
    Messages:
    66
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Behind your business
    why not using httaccess ?

    (1) create subdomain, i.e webmail.domain.com
    (2) create .htaccess file in there that contains:
    Code:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^webmail.domain.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.webmail.domain.com$
    RewriteRule ^(.*)$ https://domain.com:2096/3rdparty/roundcube/index.php?_task=mail$1 [R=301,L]
    susan,
     
  11. Ado`

    Ado` Registered

    Joined:
    Jul 5, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi Susan,
    I realise .htaccess can be used to achieve the same thing however this then means that a .htaccess rule has to be created for each and every hosting account, further to this a webmail.XXXXXX.XXX subdomain. Both of these are tasks i'd rather not have to perform manually for each and every hosting account.
     
  12. DaveUsedToWorkHere

    DaveUsedToWorkHere Well-Known Member

    Joined:
    Dec 28, 2001
    Messages:
    689
    Likes Received:
    1
    Trophy Points:
    18
    Sorry about that. I'm not on Win so I only tested in FF and Safari. Here's content for the index.html page that will allow it to work with IE. It's less elegant (JavaScript) but handles those w/ out JavaScript by giving them a link to click.

    Code:
    <cpanel Email="check_roundcube()">
    <h2>Redirecting to Roundcube WebMail.....please click <a href="<cpanel print="$CPVAR{'roundcube'}">/index.php">here</a> if you are not redirected in 5 seconds.</h2>
    <script type="text/javascript">
    function goToRoundCube(){
            document.location.href="<cpanel print="$CPVAR{'roundcube'}">/index.php";
    }
    </script>
    <script>goToRoundCube();</script>
     
  13. Asver

    Asver Registered

    Joined:
    Jan 19, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi.
    First of all, sorry for my spell mistakes.
    I have exactly the same problem, and i dont have access to cPanel directory, but still I want to put some log-in form on my webpage that send users directly to roundcube client.
    Is anything changed in this matter? Is this option now avaiable?
    And if not, maybe someone will help me with this:
    When I entering url directly to my roundcube cilent (like "https://myDomain:2096/3rdparty/roundcube/?_task=mail") withoun being log in, I get some kind of pop-up window with log-in form. When I type my log/pass Im send directly to roundcube. It is exactly the effect what I want, but withaut the pop-up window. I want form on my site.
    My question is: How I can communicate with this window to automatically send log/pass? Or, how this window works? Or where it sends the data?
     
  14. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    The browser pop-up window is displayed because your server is configured to use HTTP Authentication. To log-in using an HTML-form you will need to disable HTTP Authentication so that cookie authentication will be used, which will avoid the pop-up-style log-in prompt.

    This change can be accomplished using WebHost Manager via the following menu path (with linked documentation): WHM: Main >> Server Configuration >> Tweak Settings >> Security >> Enable HTTP Authentication [?] Enable HTTP Authentication for cPanel/WebMail/WHM Logins. This risks certain types of XSRF attacks that rely on cached HTTP Auth credentials. Disabling forces cookie authentication.
     
  15. beddo

    beddo Well-Known Member

    Joined:
    Jan 19, 2007
    Messages:
    157
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    England
    cPanel Access Level:
    DataCenter Provider
    Hi,
    I am trying to set up something similar and the roundcuberedirect.html file seems to work only if you do not use security tokens. Can anyone suggest the extra code needed to make the redirect security token aware?
    Thanks.
     
  16. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    With security session tokens enabled, I'm able to directly access Roundcube webmail via the following URLs; replace "server" with your server hostname, IP address, or cPanel account domain name:
    Code:
    http://server:2095/3rdparty/roundcube/
    https://server:2096/3rdparty/roundcube/
    If proxy sub-domains are enabled, the following URLs, using the "webmail." sub-domain, will also go directly to Roundcube; replace "domain" with your cPanel account domain name:
    Code:
    http://webmail.domain:2095/3rdparty/roundcube/
    https://webmail.domain:2096/3rdparty/roundcube/
     
  17. Asver

    Asver Registered

    Joined:
    Jan 19, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I see. Thanks for fast and solid reply.
    But even if it spread some light on cause of my problem, it does not solve it. :)
    I don’t have access to this security setting, neither I want to disable it. All I want is to allow my users to log in directly to roundcube with use of little form located somewhere on my website.

    Now I am wondering if it is possible to log in using help of curl?
    I done some tests, but they don’t work... I don’t know much about sniffing with Curl, and breaking security stuff, but if there is no other option... :( any suggestions will be nice.
    Here is code that I gathered in last few days (witch don’t work, of course).
    PHP:
    $curl curl_init();
    curl_setopt($curlCURLOPT_HTTPAUTHCURLAUTH_ANY ) ;
    curl_setopt($curlCURLOPT_USERPWD"login:pass");
    curl_setopt($curlCURLOPT_SSLVERSION,3);
    curl_setopt($curlCURLOPT_SSL_VERIFYPEERFALSE);
    curl_setopt($curlCURLOPT_SSL_VERIFYHOST2);
    curl_setopt($curlCURLOPT_HEADERtrue);
    curl_setopt($curlCURLOPT_POSTtrue);
    curl_setopt($curlCURLOPT_POSTFIELDS"user=login&pass=password");
    curl_setopt($curlCURLOPT_RETURNTRANSFERtrue);
    curl_setopt($curlCURLOPT_USERAGENT"Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
    curl_setopt($curlCURLOPT_URL'https://myDomain:2096/3rdparty/roundcube/?_task=mail');
     
  18. beddo

    beddo Well-Known Member

    Joined:
    Jan 19, 2007
    Messages:
    157
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    England
    cPanel Access Level:
    DataCenter Provider
    We actually use the proxy sub-domains exclusively due to the certificate name. direct access to the ports is actually firewalled off.

    All I need is a little bit of code in the roundcube redirector that picks up the right variable being posted and then passes it on. Surely there is some documentation for developers on how to make things token compatible?

    Edit:

    I figured it out myself. All it takes is an extra print statement in the clickable link and javascript redirect. Here it is for anyone else interested.

    Code:
    <cpanel Email="check_roundcube()">
    <h2>Redirecting to Roundcube WebMail.....please click <a href="<cpanel print="$ENV{'cp_security_token'}"><cpanel print="$CPVAR{'roundcube'}">/index.php">here</a> if you are not redirected in 5 seconds.</h2>
    <script type="text/javascript">
    function goToRoundCube(){
            document.location.href="<cpanel print="$ENV{'cp_security_token'}"><cpanel print="$CPVAR{'roundcube'}">/index.php";
    }
    </script>
    <script>goToRoundCube();</script>
    
     
    #18 beddo, Feb 4, 2011
    Last edited: Feb 4, 2011
  19. thisxstyle

    thisxstyle Registered

    Joined:
    Jun 6, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hey,

    I'm stuck in a tough spot with this. I did the method described in the first two posts with the script and the redirect, but how would I go about undoing this to revert it back to how cpanel webmail was before I put it in place?

    Thanks
     
  20. beddo

    beddo Well-Known Member

    Joined:
    Jan 19, 2007
    Messages:
    157
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    England
    cPanel Access Level:
    DataCenter Provider
    I didn't see this one when it was posted, hope you figured it out but in case anyone else is interested removing is a case of deleting the relevant line from /scripts/postupcp and running /scripts/upcp. That'll put the stock pages back in and prevent the redirect from being copied over.
     
Loading...

Share This Page