Mail Server Setup With Exim, MySQL, Cyrus-Imapd, Horde Webmail On Centos 5.1 - issue

Discussion in 'HOWTO-Related Questions' started by c0mrade, Jul 6, 2008.

  1. c0mrade

    c0mrade New Member

    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?
    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 (
            '[email protected]',
            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 ('[email protected]',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: Jul 6, 2008
  2. topdog

    topdog Active Member

    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.
     
  3. c0mrade

    c0mrade New Member

    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
     
  4. topdog

    topdog Active Member

    What is the error in the horde log file ?
     
  5. c0mrade

    c0mrade New Member

    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 [email protected] [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 [email protected] [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 [email protected] [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 [email protected] [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 [email protected] [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 [email protected] [77.77.197.68] to Horde [on line 90 of "/usr/share/ho
    rde/login.php"]
    
     
  6. topdog

    topdog Active Member

  7. c0mrade

    c0mrade New Member

    I don't know why but it only seemed to accepts logins when using https .. I tried to create virtual host for mail http://hostname entry in httpd.conf but nevermind . Now when I managed to login things get more weird . This is how things look when I login as admin screenshot here.
    I get message login failed although I successfully logged in. Once I logged in as admin I added one user [email protected] and here is screenshot when I login with created user. Same thing login failed although I logged in successfully "login failed" .. here is my horde.log
    Code:
    Jul 07 07:34:35 HORDE [notice] [horde] Login success for [email protected] [77.77.197.68] to Horde [on line 90 of "/usr/share/ho
    rde/login.php"]
    Jul 07 07:34:47 HORDE [error] [imp] FAILED LOGIN 77.77.197.68 to localhost:143[imap/notls] as [email protected] [on line 258 of
    "/usr/share/horde/imp/lib/Auth/imp.php"]
    Jul 07 07:34:47 HORDE [error] [imp] FAILED LOGIN 77.77.197.68 to localhost:143[imap/notls] as [email protected] [on line 258 of
    "/usr/share/horde/imp/lib/Auth/imp.php"]
    Jul 07 07:34:48 HORDE [error] [horde] Error writing session data: MySQL server has gone away [on line 147 of "/usr/share/horde/lib/Horde/Sess
    ionHandler/mysql.php"]
    Jul 07 07:38:35 HORDE [notice] [horde] Login success for [email protected] [77.77.197.68] to Horde [on line 90 of "/usr/share/ho
    rde/login.php"]
    Jul 07 07:38:47 HORDE [error] [imp] FAILED LOGIN 77.77.197.68 to localhost:143[imap/notls] as [email protected] [on line 258 of
    "/usr/share/horde/imp/lib/Auth/imp.php"]
    Jul 07 07:38:50 HORDE [error] [imp] FAILED LOGIN 77.77.197.68 to localhost:143[imap/notls] as [email protected] [on line 258 of
    "/usr/share/horde/imp/lib/Auth/imp.php"]
    Jul 07 07:40:13 HORDE [error] [imp] FAILED LOGIN 77.77.197.68 to localhost:143[imap/notls] as [email protected] [on line 258 of
    "/usr/share/horde/imp/lib/Auth/imp.php"]
    Jul 07 07:40:13 HORDE [error] [imp] Error writing session data: MySQL server has gone away [on line 147 of "/usr/share/horde/lib/Horde/Sessio
    nHandler/mysql.php"]
    Jul 07 07:40:16 HORDE [error] [imp] FAILED LOGIN 77.77.197.68 to localhost:143[imap/notls] as [email protected] [on line 258 of
    "/usr/share/horde/imp/lib/Auth/imp.php"]
    Jul 07 07:40:17 HORDE [error] [horde] Error writing session data: MySQL server has gone away [on line 147 of "/usr/share/horde/lib/Horde/Sess
    ionHandler/mysql.php"]
    
    .. maybe time to try another webmail or ?
     
  8. topdog

    topdog Active Member

    Okay i see what is happening, you are logging into horde but the imp login to the imap server fails, check the maillog to see why you cannot login to the imap server.
     
  9. c0mrade

    c0mrade New Member

    mm I'd like to check it but I don't know what is the location of maillog .. what is the exact file name so I look it up ?
     
  10. topdog

    topdog Active Member

    /var/log/maillog
     
  11. c0mrade

    c0mrade New Member

    Here is some of last entries .. whole file is too big to paste
    Code:
    Jul  7 09:08:51 emir imap[23932]: badlogin: localhost.localdomain [127.0.0.1] plaintext [email protected] SASL(-13): authenticat
    ion failure: checkpass failed
    Jul  7 09:08:57 emir last message repeated 2 times
    Jul  7 09:09:18 emir update_sanesecurity.sh[7849]: None of '/var/clamav/daily.inc', '/var/clamav/main.inc',
    Jul  7 09:09:18 emir update_sanesecurity.sh[7855]: '/var/clamav/main.cvd' found in your database directory. Either '/var/clamav' is NOT
    Jul  7 09:09:18 emir update_sanesecurity.sh[7861]: the correct database path or there is something wrong with your
    Jul  7 09:09:18 emir update_sanesecurity.sh[7869]: ClamAV installation. This path came from your '/usr/bin/clamscan' so I would guess
    Jul  7 09:09:18 emir update_sanesecurity.sh[7875]: you need to check your clamd.conf file and/or '/var/clamav'
    Jul  7 09:09:18 emir update_sanesecurity.sh[7881]: Exiting.
    Jul  7 09:10:32 emir master[28135]: process 23932 exited, status 0
    Jul  7 09:11:25 emir master[11944]: about to exec /usr/lib/cyrus-imapd/ctl_cyrusdb
    Jul  7 09:11:25 emir master[11945]: about to exec /usr/lib/cyrus-imapd/squatter
    Jul  7 09:11:25 emir squatter[11945]: indexing mailboxes
    Jul  7 09:11:25 emir squatter[11945]: done indexing mailboxes
    Jul  7 09:11:25 emir ctl_cyrusdb[11944]: checkpointing cyrus databases
    Jul  7 09:11:25 emir ctl_cyrusdb[11944]: archiving database file: /var/lib/imap/annotations.db
    Jul  7 09:11:25 emir ctl_cyrusdb[11944]: archiving database file: /var/lib/imap/mailboxes.db
    Jul  7 09:11:25 emir ctl_cyrusdb[11944]: done checkpointing cyrus databases
    Jul  7 09:11:25 emir master[28135]: process 11945 exited, status 0
    Jul  7 09:11:25 emir master[28135]: process 11944 exited, status 0
    Jul  7 09:13:51 emir imap[7669]: accepted connection
    Jul  7 09:13:51 emir master[13659]: about to exec /usr/lib/cyrus-imapd/imapd
    Jul  7 09:13:51 emir imap[13659]: executed
    Jul  7 09:13:51 emir imap[7669]: badlogin: localhost.localdomain [127.0.0.1] plaintext [email protected] SASL(-13): authenticati
    on failure: checkpass failed
    Jul  7 09:13:57 emir last message repeated 2 times
    Jul  7 09:15:25 emir master[28135]: process 7669 exited, status 0
    Jul  7 09:23:51 emir imap[13659]: accepted connection
    Jul  7 09:23:51 emir master[24083]: about to exec /usr/lib/cyrus-imapd/imapd
    Jul  7 09:23:51 emir imap[24083]: executed
    Jul  7 09:23:51 emir imap[13659]: badlogin: localhost.localdomain [127.0.0.1] plaintext [email protected] SASL(-13): authenticat
    ion failure: checkpass failed
    Jul  7 09:23:57 emir last message repeated 2 times
    Jul  7 09:25:03 emir master[28135]: process 13659 exited, status 0
    
     
  12. topdog

    topdog Active Member

    Yes your sasl authentication is failing make sure that the details you used for the pam_mysql configuration is correct and can actually connect to the database using them.
     
  13. c0mrade

    c0mrade New Member

    Hi, sorry I forget to update pam_mysql password from hordepassword to acctual horde password .. anyway I get the same error as in previous screen shots just different things in horde.log now .. what did I miss now ?
    Code:
    Jul 07 11:28:02 HORDE [error] [imp] FAILED LOGIN 77.77.197.68 to localhost:143[imap/notls] as [email protected] [on line 258 of "/usr/share/horde/imp/lib/Auth/imp.php"]
    Jul 07 11:28:04 HORDE [error] [imp] FAILED LOGIN 77.77.197.68 to localhost:143[imap/notls] as [email protected] [on line 258 of "/usr/share/horde/imp/lib/Auth/imp.php"]
    Jul 07 11:29:00 HORDE [error] [imp] FAILED LOGIN 77.77.197.68 to localhost:143[imap/notls] as [email protected] [on line 258 of "/usr/share/horde/imp/lib/Auth/imp.php"]
    Jul 07 11:33:28 HORDE [error] [imp] FAILED LOGIN 77.77.197.68 to localhost:143[imap/notls] as [email protected] [on line 258 of "/usr/share/horde/imp/lib/Auth/imp.php"]
    Jul 07 11:34:01 HORDE [error] [imp] FAILED LOGIN 77.77.197.68 to localhost:143[imap/notls] as [email protected] [on line 258 of "/usr/share/horde/imp/lib/Auth/imp.php"]
    Jul 07 11:34:01 HORDE [error] [horde] Error writing session data: MySQL server has gone away [on line 147 of "/usr/share/horde/lib/Horde/SessionHandler/mysql.php"]
    Jul 07 11:38:26 HORDE [error] [imp] FAILED LOGIN 77.77.197.68 to localhost:143[imap/notls] as [email protected] [on line 258 of "/usr/share/horde/imp/lib/Auth/imp.php"]
    Jul 07 11:39:01 HORDE [error] [imp] FAILED LOGIN 77.77.197.68 to localhost:143[imap/notls] as [email protected] [on line 258 of "/usr/share/horde/imp/lib/Auth/imp.php"]
    Jul 07 11:44:04 HORDE [notice] [horde] Login success for [email protected] [77.77.197.68] to Horde [on line 90 of "/usr/share/horde/login.php"]
    Jul 07 11:44:16 HORDE [error] [imp] FAILED LOGIN 77.77.197.68 to localhost:143[imap/notls] as [email protected] [on line 258 of "/usr/share/horde/imp/lib/Auth/imp.php"]
    Jul 07 11:44:17 HORDE [error] [imp] FAILED LOGIN 77.77.197.68 to localhost:143[imap/notls] as [email protected] [on line 258 of "/usr/share/horde/imp/lib/Auth/imp.php"]
    
     
  14. topdog

    topdog Active Member

    I suggest that you run through the tutorial with the defaults on a testbox first, then do the modifications for your environment later.
     
  15. c0mrade

    c0mrade New Member

    thank you for your replies, by default you mean same values you used ?
     
  16. shernand

    shernand New Member

    sieve problem

    i'm getting this error in the maillog while i login the first time with a new account :

    Jul 12 12:05:19 whiskey imap[15489]: autocreate_sieve: Unable to open sieve script /etc/default_sieve. Check permissions
    Jul 12 12:05:19 whiskey imap[15489]: autocreate_sieve: User [email protected], default sieve script creation failed
    Jul 12 12:05:19 whiskey imap[15517]: accepted connection

    Due to this i'm missing the sent-mail, draft, spam, trash on imp. The folders are created as you can see below, but the user can't access them.

    Jul 12 12:05:19 whiskey imap[15489]: autocreateinbox: User [email protected], subfolder INBOX.sent-mail creation succeeded.
    Jul 12 12:05:19 whiskey imap[15489]: autocreateinbox: User [email protected], subscription to INBOX.sent-mail succeeded
    ...etc

    This seems to be related with this on imapd.conf :

    autocreate_sieve_script: /etc/default_sieve
    autocreate_sieve_compiledscript: /etc/default_sieve_script.bc

    i tryed changing this to another directory and chowned it as cyrus:mail, i even tryied with 777 permissions but still i'm getting this message.

    What could be causing this?

    Thanks

    -- Shernand
     
  17. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    ls -la /etc/default_sieve
    ?
     
  18. topdog

    topdog Active Member

    you only have to enable those options if you want to use the default scripts.
     
  19. shernand

    shernand New Member

    topdog - you are correct, the sieve script issue seems not to be related with the mailbox issue, but i still only can access the inbox with any account. I can't access drafts, sent-mail,etc. Do you have any idea why it's creating the folders and not allowing any users to access them?.

    falko - no such file/directory

    Thanks

    --Shernand
     
  20. topdog

    topdog Active Member

    That is possibly because due to the sieve scripts not existing the auto subscription part did not work.

    Make sure that the auto subscription option in your config has the correct directories, then create a new email address and access it or send a mail to it and see if the subscription does work.

    For the existing accounts you can use cm to subscribe the user to the mailboxes.
     

Share This Page