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.

Squirrelmail PHP Error

Discussion in 'E-mail Discussions' started by redcamel, Jun 28, 2005.

  1. redcamel

    redcamel Member

    Joined:
    Jun 23, 2005
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    I get these errors when tring to use squirrelmail...Does any one know the fix

    Warning: main(../config/config.php): failed to open stream: No such file or directory in /usr/local/cpanel/base/3rdparty/squirrelmail/functions/global.php on line 18

    Fatal error: main(): Failed opening required '../config/config.php' (include_path='/usr/local/cpanel/3rdparty/lib/php/:.') in /usr/local/cpanel/base/3rdparty/squirrelmail/functions/global.php on line 18
     
  2. redcamel

    redcamel Member

    Joined:
    Jun 23, 2005
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    I found the fix however the PHP fix however I now have the dual login in problem. Can someone please send me a tar of: /usr/local/cpanel/base/3rdparty/squirrelmail/plugins/cpanel_auth directory

    Thanks. Email: erich0075s@insightbb.com
     
  3. Vatoloco

    Vatoloco Well-Known Member

    Joined:
    Jun 21, 2004
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    I tried running /scripts/fixwebmail and it just returned this:

    chown: failed to get attributes of `/usr/local/etc/cpanel/base/webmail/data': No such file or directory
    chmod: failed to get attributes of `/usr/local/etc/cpanel/base/webmail/data': No such file or directory

    Squirrelmail still gave the same error you were getting so I searched some more and found this post:

    It worked perfect! My /var/cpanel/usecpphp already existed so I just ran the cp command he gave and no more error message. I can login to squirrelmail now with no problems.
     
  4. gupi

    gupi Well-Known Member

    Joined:
    Apr 27, 2004
    Messages:
    125
    Likes Received:
    0
    Trophy Points:
    16
    Yes, I would like a copy of cpanel_auth too.
    email: mail[at]hangarhosting[dot]net

    Thank you
     
  5. Vatoloco

    Vatoloco Well-Known Member

    Joined:
    Jun 21, 2004
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    dual login

    Well, I just realized I'm having the double login problem as well. I even have the cpanel_auth directory and it's still not working. I can login, but I just have to do it twice. Once on the pop-up login when I go to http://www.mysite.com/webmail and then after I click squirrelmail it brings up the squirremail login.

    Here's exactly what's in /usr/local/cpanel/base/3rdparty/squirrelmail/plugins/cpanel_auth. There are only 4 files, 2 of which are just instructional:

    1. index.php
    2. INSTALL
    3. README
    4. setup.php



    index.php
    Code:
    <?php
    
    /**
     * index.php -- Displays the main frameset
     *
     * Copyright (c) 2002-2003 The SquirrelMail Project Team
     * Licensed under the GNU GPL. For full terms see the file COPYING.
     *
     * Redirects to the login page.
     *
     * $Id: index.php,v 1.3 2002/12/31 12:49:35 kink Exp $
     */
    
    header("Location:../../src/login.php\n\n");
    exit();
    
    ?>
    INSTALL
    Code:
    HTTP Auth Installation Procedure
    ================================
    
    
    Requirements
    ------------
    
    - SquirrelMail 1.4.0 or later.
    - In php.ini: "safe_mode = Off", otherwise the password won't be available.
    
    
    Installation
    ------------
    
    1) Uncompress the archive in the plugins/ directory:
    
       $ cd plugins/
       $ tar xzvf /path/to/cpanel_auth-1.1.tar.gz
    
    2) Now choose how you want to install the plugin:
    
     * Automatic installation
    
       Go to your config directory and run conf.pl. Choose option 8 and add the
       plugin. Save and exit.
    
       $ cd ../config/
       $ ./conf.pl
    
     * Manual installation
    
       Add the following line to config/config.php:
    
       $plugins[n] = 'cpanel_auth';
    
       where n is the next available index.
    README
    Code:
    HTTP Auth, version 1.1
    ======================
    
    
    Features
    --------
    
    Automatic login: this plugin will use the username/password pair provided via
    HTTP authentication to bypass the login screen.
    
    If nobody is logged in, the login screen will be displayed.
    
    
    Changes
    -------
    
    1.0	- Initial version.
    
    1.1	- Correct a bug when logging via the login screen
    	  (reported by Joachim Selinger).
    	- Improve performance.
    
    
    Todo
    ----
    
    - Display the login screen when the username/password pair provided via HTTP
      authentication doesn't work with the IMAP server.
    
    
    Contact
    -------
    
    Please send bug reports and feature requests to <fred@connes.com>.
    
    
    Licence
    -------
    
    GNU General Public Licence, Version 2, June 1991
    http://www.gnu.org/copyleft/gpl.html
    
    This program is free software; you can redistribute it and/or modify it under
    the terms of the GNU General Public License as published by the Free Software
    Foundation; either version 2 of the License, or (at your option) any later
    version.
    
    This program is distributed in the hope that it will be useful, but WITHOUT ANY
    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    PARTICULAR PURPOSE.  See the GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License along with
    this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    Place, Suite 330, Boston, MA 02111-1307 USA
    
    
    Copyright
    ---------
    
    Copyright (C) 2003 Frederic Connes
    setup.php
    Code:
    <?php
    
    function squirrelmail_plugin_init_cpanel_auth()
    {
      global $squirrelmail_plugin_hooks;
    
      /* Register the plugin. */
      $squirrelmail_plugin_hooks['login_cookie']['cpanel_auth'] =
        'plugin_cpanel_auth_login_cookie';
      $squirrelmail_plugin_hooks['login_before']['cpanel_auth'] =
        'plugin_cpanel_auth_login_before';
     }
    
    function plugin_cpanel_auth_login_cookie()
    {
      /* SquirrelMail required files. */
      require_once(SM_PATH . 'functions/imap.php');
    
      /* Get username and password from HTTP authentication. */
      $login_username = $_SERVER['REMOTE_USER'];
      $secretkey = $_SERVER['REMOTE_PASSWORD'];
     
      /* If the username and password are set, proceed to automatic login. */
      if (isset($login_username) && isset($secretkey)) {
        header("Location: redirect.php?login_username=$login_username\n\n");
        exit();
      }
    }
    
    function plugin_cpanel_auth_login_before()
    {
      global $secretkey;
    
      /* If the password is not set, get it from HTTP authentication. */
      if (!isset($secretkey))
        $secretkey = $_SERVER['REMOTE_PASSWORD'];
    
    }
    
    ?>
     
  6. Vatoloco

    Vatoloco Well-Known Member

    Joined:
    Jun 21, 2004
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    Just realized I can attach files in this forum. So I zipped up the tar of cpanel_auth. :)
     

    Attached Files:

  7. andreseso

    andreseso Member

    Joined:
    May 20, 2003
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    cpanel_auth missing

    Lovely lovely. This is the second screw up we have had with our cpanel server's squirrelmail in two weeks and the lovely forum system asks to authenticate to download the attatchment so I have to download to my pc and then upload to my server the attatchment.

    Why are the cpanel forums only readable for registered users? It is really annoying
     
  8. andreseso

    andreseso Member

    Joined:
    May 20, 2003
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    squirrelmail working again

    creating the cpanel_auth directory in the /usr/local/cpanel/base/3rdparty/squirrelmail/plugins directory and copying the files from the archive in the post above I managed to get squirrelmail working. In the archive some few posts above it mentions running ./conf.pl in the cpanel_auth INSTALL file. That executable script is not in the squirrelmail config dir.

    There are a lot of plugins in the squirrelmail plugin but none of them is referenced in /usr/local/cpanel/base/3rdparty/squirrelmail/config/config.php. Should I add any of the plugins with the $plugins[n] = 'plugin name'; line? I had to add manually the $plugins[n] = 'cpanel_auth'; line

    I copied the distribution squirrelmail config.php to that directory as the installation was not capable of finding giving the error at the beginning of the thread and I would like to know if there is a way to make squirrelmail better.
     
  9. ProLamer

    ProLamer Active Member

    Joined:
    May 17, 2005
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    After manully add in the plug-in link, the double login proble is solved.
     
  10. kyro_02

    kyro_02 Member

    Joined:
    Sep 23, 2004
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    I get the following as well!!!

    Code:
    Warning: main(../config/config.php): failed to open stream: No such file or directory in /usr/local/cpanel/base/3rdparty/squirrelmail/functions/global.php on line 18
    
    Fatal error: main(): Failed opening required '../config/config.php' (include_path='/usr/local/cpanel/3rdparty/lib/php/:.') in /usr/local/cpanel/base/3rdparty/squirrelmail/functions/global.php on line 18
    
    Someone able to let me/us know how to fix it... I am using CPanel 10..

    thanks.
     
  11. kyro_02

    kyro_02 Member

    Joined:
    Sep 23, 2004
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    I did all what biji said, and no luck.
     
  12. balasainet

    balasainet Registered

    Joined:
    May 4, 2005
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    I did what bijo said and my squirrelmail problem is resolved. but double login problem is still there can some one help
     
  13. asmar

    asmar Well-Known Member

    Joined:
    Jul 16, 2004
    Messages:
    135
    Likes Received:
    0
    Trophy Points:
    16
    Would you please share us how you did that? Where you add and how the plug-in link?

    Thanks
     
  14. luna

    luna Active Member

    Joined:
    Dec 27, 2003
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Hi,

    I would like to know about it, too to resolve the double login problem.
    Please help me.

    Thanks in advance.
     
  15. luna

    luna Active Member

    Joined:
    Dec 27, 2003
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Hi,
    This worked for me to resolve the double login problem.
    Just you need to add $plugins[0] = 'cpanel_auth';

    pico /usr/local/cpanel/base/3rdparty/squirrelmail/config/config.php
     
  16. racomnet

    racomnet BANNED

    Joined:
    Oct 6, 2004
    Messages:
    68
    Likes Received:
    0
    Trophy Points:
    0
    runing S83 and have this problem, after fresh install. I don;t understant how to fix it.
     
  17. nickb

    nickb Well-Known Member

    Joined:
    Feb 25, 2005
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    You only need to follow the steps mentioned in this very thread to resolve the issue.
     
  18. maverick23

    maverick23 Well-Known Member

    Joined:
    Feb 23, 2005
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    DataCenter Provider
    Hi,

    Still it doesn't help...

    First problem i faced:-

    Warning: main(../config/config.php): failed to open stream: No such file or directory in /usr/local/cpanel/base/3rdparty/squirrelmail/functions/global.php on line 18

    Fatal error: main(): Failed opening required '../config/config.php' (include_path='/usr/local/cpanel/3rdparty/lib/php/:.') in /usr/local/cpanel/base/3rdparty/squirrelmail/functions/global.php on line 18

    Resolved after:-

    copying /usr/local/cpanel/base/3rdparty/squirrelmail/config/config_default.php to /usr/local/cpanel/base/3rdparty/squirrelmail/config/config.php

    Next problem i faced of double login and not accepting the username and password

    solved by copying the cpanel_auth module and editing file :- /usr/local/cpanel/base/3rdparty/squirrelmail/config/config.php and entring a line:- "$plugins[0] = 'cpanel_auth';"


    But now what error i get is :-

    Preference file, /home/xxxxxxxx/.sqmaildata/xxxxx@xxxxxx.xxx.pref.tmp, could not be written. Contact your system administrator to resolve this issue.

    Now how do i go about it? Pl Help!!

    Regards,
    Rajat
     
  19. nickb

    nickb Well-Known Member

    Joined:
    Feb 25, 2005
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    check config_local.php file under /usr/local/cpanel/base/3rdparty/squirrelmail/config/

    If this file doesn't exist create it with the following contents >>

    Code:
    <?php
    /* Local config overrides.
       You can override the config.php settings here.  Don't do it unless you know what you're doing.
       Use standard PHP syntax, see config.php for examples. */
    
       $pw = posix_getpwuid(posix_getuid());
       $data_dir = $pw["dir"] . "/.sqmaildata";
       $attachment_dir = $data_dir;
    
       mkdir($data_dir,0700);
    
       $domain = $_SERVER['DNS'];
    
            if (getenv('WEBMAIL') == "1") {
                    $signout_page = "/webmaillogout.cgi";
            } else {
                    $sigout_page = "/";
            }
    
    ?>
    Also verify the permissions and ownerships on .sqmaildata and files under it..
     
  20. maverick23

    maverick23 Well-Known Member

    Joined:
    Feb 23, 2005
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    DataCenter Provider
    Hi,

    Thanks for your reply.

    The file mentioned "/usr/local/cpanel/base/3rdparty/squirrelmail/config/config_local.php" had the same stuff in it...

    but i deleted the directory .sqmaildata in the home folder of the user and recreated it again. After changing the permission to the same user. So finaly after going through a long way i was able to resolve the problem at my box.

    Thanks all for your support.

    Regards,
    Rajat
     
Loading...

Share This Page