Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 6th July 2008, 00:07
c0mrade c0mrade is offline
Junior Member
 
Join Date: May 2008
Posts: 17
Thanks: 3
Thanked 0 Times in 0 Posts
Default Mail Server Setup With Exim, MySQL, Cyrus-Imapd, Horde Webmail On Centos 5.1 - issue

Hi all,

This howto is really great by the way.. and I think I did everything properly .. I double checked the tutorial .. and done everything twice and I get the same result.. so maybe someone can tell me what did I do wrong?
Quote:
A fatal error has occurred
Could not connect to database for SQL SessionHandler.
Details have been logged for the administrator.
I get this message when I try to run the horde mail for the first time .. you can see it yourself here I used google to look up some possible solutions .. came up with this link but still it didn't help. I'm stuck and really don't know what to do next .. here is my horde.log file
Code:
Jul 04 19:16:05 HORDE [emergency] [horde] Could not connect to database for SQL SessionHandler. [on line 319 of "/usr/share/horde/lib/Horde/S
essionHandler/mysql.php"]
Jul 04 19:16:07 HORDE [emergency] [horde] Could not connect to database for SQL SessionHandler. [on line 319 of "/usr/share/horde/lib/Horde/S
essionHandler/mysql.php"]
Jul 04 19:16:43 HORDE [emergency] [horde] Could not connect to database for SQL SessionHandler. [on line 319 of "/usr/share/horde/lib/Horde/S
essionHandler/mysql.php"]
Jul 04 19:19:01 HORDE [emergency] [horde] Could not connect to database for SQL SessionHandler. [on line 319 of "/usr/share/horde/lib/Horde/S
essionHandler/mysql.php"]
Jul 04 19:20:59 HORDE [emergency] [horde] Could not connect to database for SQL SessionHandler. [on line 319 of "/usr/share/horde/lib/Horde/S
essionHandler/mysql.php"]
Jul 04 19:24:07 HORDE [emergency] [horde] Could not connect to database for SQL SessionHandler. [on line 319 of "/usr/share/horde/lib/Horde/S
essionHandler/mysql.php"]
Jul 04 19:24:23 HORDE [emergency] [horde] Could not connect to database for SQL SessionHandler. [on line 319 of "/usr/share/horde/lib/Horde/S
essionHandler/mysql.php"]
Jul 04 19:25:04 HORDE [emergency] [horde] Could not connect to database for SQL SessionHandler. [on line 319 of "/usr/share/horde/lib/Horde/S
essionHandler/mysql.php"]
Jul 05 12:59:32 HORDE [emergency] [horde] Could not connect to database for SQL SessionHandler. [on line 319 of "/usr/share/horde/lib/Horde/S
essionHandler/mysql.php"]
Jul 05 15:03:24 HORDE [emergency] [horde] Could not connect to database for SQL SessionHandler. [on line 319 of "/usr/share/horde/lib/Horde/S
essionHandler/mysql.php"]
Jul 05 15:04:50 HORDE [emergency] [horde] Could not connect to database for SQL SessionHandler. [on line 319 of "/usr/share/horde/lib/Horde/S
essionHandler/mysql.php"]
Jul 05 15:06:48 HORDE [emergency] [horde] Could not connect to database for SQL SessionHandler. [on line 319 of "/usr/share/horde/lib/Horde/S
essionHandler/mysql.php"]
here is content of line 319 of /usr/share/horde/lib//Horde/S
essionHandler/mysql.php
Code:
 if (!$this->_db = @$connect($this->_params['hostspec'],
                                    $this->_params['username'],
                                    $this->_params['password'])) {
            Horde::fatal(PEAR::raiseError('Could not connect to database for SQL SessionHandler.'), __FILE__, __LINE__);
        }
I really can't figure out what is wrong, maybe my admin.sql ? here it is
Code:
USE horde;
REPLACE INTO horde_users (user_uid,user_pass)
    VALUES (
        'emir@mail.panel.komentari.info',
        md5('ccc1234xxx'),
);
and I get this error from
Code:
ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 5
so I changed admin.sql to this
Code:
USE horde;
REPLACE INTO horde_users (user_uid,user_pass)
    VALUES ('emir@mail.panel.komentari.info',md5('ccc1234xxx'));
and it executed without sql error .. so that is possible error but I really can't figure out what went wrong .. Any hints ? Thank you in advance

Last edited by c0mrade; 6th July 2008 at 00:17.
Reply With Quote
Sponsored Links
  #2  
Old 6th July 2008, 09:04
topdog topdog is offline
Senior Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 153 Times in 150 Posts
Default

The problem is that horde cannot connect to the mysql database to store the session information.

Please ensure that the details in your horde conf.php are correct and the user can connect to the database from the command line.
__________________
----
http://www.topdog.za.net - Got Linux problems ? - I can help.
http://www.baruwa.org - Try it.
Reply With Quote
The Following User Says Thank You to topdog For This Useful Post:
c0mrade (7th July 2008)
  #3  
Old 7th July 2008, 01:44
c0mrade c0mrade is offline
Junior Member
 
Join Date: May 2008
Posts: 17
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Thank you for your answer, you were right .. I didn't modify the conf.php properly
Code:
$conf['sessionhandler']['params']['username'] = 'horde';
$conf['sessionhandler']['params']['password'] = 'myhorde';
these fields .. anyways I just pasted these so others can solve the problem if they encounter it .. I have another question though now I can't login to horde at all .. I've checked table horde_users and it does have entry and password with md5 in the mysql but still I cannot login, do you perhaps know what is the problem this time .. Thank you
Reply With Quote
  #4  
Old 7th July 2008, 08:38
topdog topdog is offline
Senior Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 153 Times in 150 Posts
Default

What is the error in the horde log file ?
__________________
----
http://www.topdog.za.net - Got Linux problems ? - I can help.
http://www.baruwa.org - Try it.
Reply With Quote
  #5  
Old 7th July 2008, 12:31
c0mrade c0mrade is offline
Junior Member
 
Join Date: May 2008
Posts: 17
Thanks: 3
Thanked 0 Times in 0 Posts
Default

this doesn't appear to be an error but still I don't get transfered anywhere from index or login here is horde.log
Code:
Jul 06 16:19:26 HORDE [error] [horde] FAILED LOGIN for horde [77.77.197.68] to Horde [on line 116 of "/usr/share/horde/login.php"]
Jul 06 16:28:49 HORDE [notice] [horde] Login success for emir@mail.panel.komentari.info [77.77.197.68] to Horde [on line 90 of "/usr/share/ho
rde/login.php"]
Jul 06 16:30:56 HORDE [error] [horde] FAILED LOGIN for admin@mail.panel.komentari.info [77.77.197.68] to Horde [on line 116 of "/usr/share/ho
rde/login.php"]
Jul 06 16:31:40 HORDE [error] [horde] FAILED LOGIN for alma@mail.panel.komentari.info [77.77.197.68] to Horde [on line 116 of "/usr/share/hor
de/login.php"]
Jul 06 16:33:32 HORDE [notice] [horde] Login success for emir@mail.panel.komentari.info [77.77.197.68] to Horde [on line 90 of "/usr/share/ho
rde/login.php"]
Jul 06 16:38:22 HORDE [notice] [horde] Login success for emir@mail.panel.komentari.info [77.77.197.68] to Horde [on line 90 of "/usr/share/ho
rde/login.php"]
Jul 06 16:41:57 HORDE [notice] [horde] Login success for emir@mail.panel.komentari.info [77.77.197.68] to Horde [on line 90 of "/usr/share/ho
rde/login.php"]
Reply With Quote
  #6  
Old 7th July 2008, 14:27
topdog topdog is offline
Senior Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 153 Times in 150 Posts
Default

even when you login as emir@mail.panel.komentari.info ? because that gets logged as a success
__________________
----
http://www.topdog.za.net - Got Linux problems ? - I can help.
http://www.baruwa.org - Try it.
Reply With Quote
  #7  
Old 13th April 2009, 19:04
ask2me007 ask2me007 is offline
Junior Member
 
Join Date: Dec 2008
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default Mail server setup with Exim,mysql,cyrus-imapd,horde

Dear Topdog

Thanks for your great effort in creating a howto for the mailserver setup.I have installed the mail server as per your how to.Even though I managed to login to horde, i cant sent mail through imp.When I click the sent button, it shows a error message

"There was an error sending your message: Failed to connect to localhost:25 [SMTP: Invalid response code received from server (code: 451, response: Temporary local problem - please try later)]"

When i checked the horde log, it showed the following error.

"Apr 13 21:13:12 HORDE [error] [imp] Failed to connect to localhost:25 [SMTP: Invalid response code received from server (code: 451, response: Temporary local problem - please try later)] [on line 1059 of "/usr/share/horde/imp/compose.php"]
Apr 13 21:13:12 HORDE [debug] [horde] SQL Query by SessionHandler_mysql::read(): query = "SELECT session_data FROM horde_sessionhandler WHERE session_id = 'rooich0eqtsntihoj3q83e03j0' AND session_lastmodified > 1240067952 FOR UPDATE" [on line 105 of "/usr/share/horde/lib/Horde/SessionHandler/mysql.php"]"
I am struck up with the installation.
My configuration file is


nf['debug_level'] = E_ALL;
$conf['debug_level'] = debug;
$conf['max_exec_time'] = 0;
$conf['compress_pages'] = true;
$conf['umask'] = 077;
$conf['use_ssl'] = 2;
$conf['server']['name'] = $_SERVER['SERVER_NAME'];
$conf['server']['port'] = $_SERVER['SERVER_PORT'];
$conf['session']['name'] = 'Horde';
$conf['session']['use_only_cookies'] = true;
$conf['session']['cache_limiter'] = 'nocache';
$conf['session']['timeout'] = 0;
$conf['cookie']['domain'] = $_SERVER['SERVER_NAME'];
$conf['cookie']['path'] = '/';
$conf['sql']['username'] = 'horde';
$conf['sql']['password'] = 'hordepassword';
$conf['sql']['socket'] = '/var/lib/mysql/mysql.sock';
$conf['sql']['protocol'] = 'unix';
$conf['sql']['database'] = 'horde';
$conf['sql']['charset'] = 'iso-8859-1';
$conf['sql']['phptype'] = 'mysqli';
$conf['auth']['admins'] = array('Administrator', 'ask@ksfe.com');
$conf['auth']['checkip'] = true;
$conf['auth']['checkbrowser'] = true;
$conf['auth']['alternate_login'] = false;
$conf['auth']['redirect_on_logout'] = false;
$conf['auth']['params']['driverconfig'] = 'horde';
$conf['auth']['params']['table'] = 'horde_users';
$conf['auth']['params']['username_field'] = 'user_uid';
$conf['auth']['params']['password_field'] = 'user_pass';
$conf['auth']['params']['encryption'] = 'md5-hex';
$conf['auth']['params']['show_encryption'] = false;
$conf['auth']['driver'] = 'sql';
$conf['signup']['allow'] = false;
//$conf['log']['priority'] = PEAR_LOG_NOTICE;
$conf['log']['priority'] = LOG_DEBUG;
$conf['log']['ident'] = 'HORDE';
$conf['log']['params'] = array();
$conf['log']['name'] = '/tmp/horde.log';
$conf['log']['params']['append'] = true;
$conf['log']['type'] = 'file';
$conf['log']['enabled'] = true;
$conf['log_accesskeys'] = false;
$conf['prefs']['params']['driverconfig'] = 'horde';
$conf['prefs']['driver'] = 'sql';
$conf['datatree']['params']['driverconfig'] = 'horde';
$conf['datatree']['driver'] = 'sql';
$conf['group']['driver'] = 'datatree';
$conf['cache']['default_lifetime'] = 1800;
$conf['cache']['params']['dir'] = Horde::getTempDir();
$conf['cache']['params']['gc'] = 86400;
$conf['cache']['driver'] = 'file';
$conf['token']['driver'] = 'none';
$conf['mailer']['params']['auth'] = '0';
$conf['mailer']['type'] = 'smtp';
$conf['vfs']['params']['driverconfig'] = 'horde';
$conf['vfs']['type'] = 'sql';
$conf['sessionhandler']['params']['persistent'] = false;
$conf['sessionhandler']['params']['rowlocking'] = true;
$conf['sessionhandler']['params']['socket'] = '/var/lib/mysql/mysql.sock';
$conf['sessionhandler']['params']['protocol'] = 'unix';
$conf['sessionhandler']['params']['hostspec'] = 'localhost';
$conf['sessionhandler']['params']['username'] = 'horde';
$conf['sessionhandler']['params']['password'] = 'hordepassword';
$conf['sessionhandler']['params']['database'] = 'horde';
$conf['sessionhandler']['type'] = 'mysql';
$conf['problems']['email'] = 'webmaster@ksfe.com';
$conf['problems']['maildomain'] = 'ksfe.com';
$conf['problems']['tickets'] = false;
$conf['menu']['apps'] = array();
$conf['menu']['always'] = true;
$conf['menu']['links']['help'] = 'authenticated';
$conf['menu']['links']['help_about'] = true;
$conf['menu']['links']['options'] = 'authenticated';
$conf['menu']['links']['problem'] = 'never';
$conf['menu']['links']['login'] = 'all';
$conf['menu']['links']['logout'] = 'authenticated';
$conf['hooks']['permsdenied'] = false;
$conf['hooks']['username'] = false;
$conf['hooks']['preauthenticate'] = false;
$conf['hooks']['postauthenticate'] = false;
$conf['hooks']['authldap'] = false;
$conf['portal']['fixed_blocks'] = array();
$conf['accounts']['driver'] = 'null';
$conf['imsp']['enabled'] = false;
$conf['kolab']['enabled'] = false;

Pls help me to settle this problem.

Thanks in advance
Reply With Quote
  #8  
Old 14th April 2009, 09:04
topdog topdog is offline
Senior Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 153 Times in 150 Posts
Default

The problem is not a horde problem it is an smtp problem you need to check /var/log/exim/main.log and see what the error is.

I suspect that your clamav is not running that is why you are getting that message.
__________________
----
http://www.topdog.za.net - Got Linux problems ? - I can help.
http://www.baruwa.org - Try it.
Reply With Quote
  #9  
Old 17th April 2009, 17:27
ask2me007 ask2me007 is offline
Junior Member
 
Join Date: Dec 2008
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by topdog View Post
The problem is not a horde problem it is an smtp problem you need to check /var/log/exim/main.log and see what the error is.

I suspect that your clamav is not running that is why you are getting that message.
Thanks Mr.Topdog
When i checked the exim log i found the error message

2009-04-17 18:39:23 malware acl condition: clamd: ClamAV returned /var/spool/exim/scan/1LwcCZ-0001x2-Ne: lstat() failed: Permission denied. ERROR
2009-04-22 18:39:23 H=localhost.localdomain (localhost) [127.0.0.1] F=<ask@example.com> temporarily rejected after DATA
-MsgID: 1Lwcin-0003kU-6k:
2009-04-22 19:13:14 malware acl condition: clamd: ClamAV returned /var/spool/exim/scan/1Lwcin-0003kU-6k: lstat() failed: Permission denied. ERROR
2009-04-22 19:13:14 H=localhost.localdomain (pop.example.com) [127.0.0.1] F=<ask@example.com> temporarily rejected after DATA
-MsgID: 1LwdBa-0003vv-1D:
2009-04-22 19:42:26 malware acl condition: clamd: ClamAV returned /var/spool/exim/scan/1LwdBa-0003vv-1D: lstat() failed: Permission denied. ERROR
2009-04-22 19:42:26 H=localhost.localdomain (localhost) [127.0.0.1] F=<admn@example.com> temporarily rejected after DATA
0 messages delivered immediately to 0 total recipients

When I tested smtp it was ready to accept connection.But it makes problem at the time of sending data.I suspect that ther is some dns problem .The problem has already seen in my previous installation.When i send mail using horde, it only shows the username and never shows the domain name at the end of the From email address and the Recepients address.
I know this is not at all a horde problem or the howto.If you dot mind, your help is always welcome.
Thank you
Reply With Quote
  #10  
Old 19th April 2009, 18:11
topdog topdog is offline
Senior Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 153 Times in 150 Posts
Default

That seems like a permissions problem with selinux try disabling it and see if clamav works, you can then create a custom policy using audit2allow.
__________________
----
http://www.topdog.za.net - Got Linux problems ? - I can help.
http://www.baruwa.org - Try it.
Reply With Quote
Reply

Bookmarks

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
MySQL problem satimis Server Operation 5 25th June 2008 15:41
Filtering emails using Spamassassin and Clamav for Exchange 2000 Server Rocky Server Operation 19 11th March 2008 08:27
Install ISPConfig on CentOS Server, in brief gfts Tips/Tricks/Mods 11 4th April 2006 08:29
Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP-AUTH, Quota, SpamAs ebbay Installation/Configuration 9 4th March 2006 11:47
The Perfect Setup Suse 9.3 - Postfix problems new_bee05 HOWTO-Related Questions 20 25th November 2005 02:30


All times are GMT +2. The time now is 16:46.


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