[horde] sql based sessions still not working in 3.0.5-rc2

Aleksandar Milivojevic alex at milivojevic.org
Fri Jul 22 05:39:04 PDT 2005


Aleksandar Milivojevic wrote:

> I'll post Horde's and IMP's config files to the list later today, when I get
> home.  However I don't think it is configuration problem.  Who knows, maybe
> there's not that many people who attempted to change session handler from
> default PHP to PostreSQL *and* use IMP to perform authentication (which is the
> only combination of settings that triggers the problem).

Hmmm...  Seems postings with attachments are silently dropped by the 
list.  Oh well.

The config files from one of the Horde installations where I noticed the 
problem.  This one is simple, one IMAP server, application (IMP) auth. I 
guess many people will have something almost identical in their config 
files.  If I'm using this configuration, I'm getting authentication 
loops (as described earlier).  If I change either authentication so that 
Horde is handling it directly, or session handler to standard PHP, 
everything works.  Try to combine the two, and it doesn't work.  Horde 
3.0.5-rc2, IMP 4.0.3

I also have another Horde install that is a bit more complicated 
(composite auth, multiple IMAP servers defined in servers.php), and I'm 
observing the same problem on that one also.

This is what I'm observing in the database.  When I get to the login 
screen for the first time, browser's URL bar shows 
f98099a82db349f7cbfa12f4093f5e12 as session ID.  However, two entries 
are created in horde_sessionhandler table as follows:

horde=> select * from horde_sessionhandler;
             session_id            | session_lastmodified | 
                              session_data
----------------------------------+----------------------+-------------------------------------------------------------------------------------------------
  2337fa6b84c134e0e0986692b175a779 |           1122035136 | 
horde_language|s:5:"en_US";hordeMessageStacks|a:2:{s:10:"javascript";a:0:{}s:6:"status";a:0:{}}
  f98099a82db349f7cbfa12f4093f5e12 |           1122035137 | 
horde_language|s:5:"en_US";hordeMessageStacks|a:2:{s:10:"javascript";a:0:{}s:6:"status";a:0:{}}
(2 rows)

When I type username and password, timestamp on one of the entries is 
updated, and also one new entry is inserted into table as follows:

horde=> select * from horde_sessionhandler;
             session_id            | session_lastmodified | 
                              session_data
----------------------------------+----------------------+-------------------------------------------------------------------------------------------------
  2337fa6b84c134e0e0986692b175a779 |           1122035136 | 
horde_language|s:5:"en_US";hordeMessageStacks|a:2:{s:10:"javascript";a:0:{}s:6:"status";a:0:{}}
  f98099a82db349f7cbfa12f4093f5e12 |           1122035139 | 
horde_language|s:5:"en_US";hordeMessageStacks|a:2:{s:10:"javascript";a:0:{}s:6:"status";a:0:{}}
  587794521b4192b1bd447dff26e907cd |           1122035164 | 
horde_language|s:5:"en_US";hordeMessageStacks|a:2:{s:10:"javascript";a:0:{}s:6:"status";a:0:{}}
(3 rows)

In log files, I get successfull login:

Jul 22 07:25:38 zatocnica HORDE[25296]: [imp] 192.168.0.2  [on line 31 
of "/var/www/html/horde-3.0.5-rc2/imp-h3-4.0.3/login.php"]
Jul 22 07:25:55 zatocnica HORDE[22182]: [imp] Login success for alex 
[192.168.0.2] to {localhost:143} [on line 150 of 
"/var/www/html/horde-3.0.5-rc2/imp-h3-4.0.3/redirect.php"]
Jul 22 07:26:03 zatocnica HORDE[22181]: [imp] 192.168.0.2  [on line 31 
of "/var/www/html/horde-3.0.5-rc2/imp-h3-4.0.3/login.php"]

However, as I said, the user is thrown back to the login screen.  The 
login screen looks exactly like the initial one (no error message), and 
browser's URL bar now shows 587794521b4192b1bd447dff26e907cd as session ID.

Bellow are how my config files look like when I'm getting this behaviour.

===== 8< Horde's conf.php 8<=====
<?php
/* CONFIG START. DO NOT CHANGE ANYTHING IN OR AFTER THIS LINE. */
// $Horde: horde/config/conf.xml,v 1.74.2.12 2005/06/02 10:19:47 selsky 
Exp $
$conf['debug_level'] = E_ALL;
$conf['max_exec_time'] = 0;
$conf['use_ssl'] = 1;
$conf['server']['name'] = $_SERVER['SERVER_NAME'];
$conf['server']['port'] = 443;
$conf['compress_pages'] = true;
$conf['umask'] = 077;
$conf['session']['name'] = 'Horde';
$conf['session']['cache_limiter'] = 'nocache';
$conf['session']['timeout'] = 0;
$conf['cookie']['domain'] = $_SERVER['SERVER_NAME'];
$conf['cookie']['path'] = '/horde';
$conf['sql']['persistent'] = true;
$conf['sql']['hostspec'] = 'localhost';
$conf['sql']['username'] = 'horde';
$conf['sql']['password'] = 'password';
$conf['sql']['protocol'] = 'unix';
$conf['sql']['database'] = 'horde';
$conf['sql']['charset'] = 'iso-8859-1';
$conf['sql']['phptype'] = 'pgsql';
$conf['auth']['admins'] = array('cyrus');
$conf['auth']['checkip'] = true;
$conf['auth']['params']['app'] = 'imp';
$conf['auth']['driver'] = 'application';
$conf['signup']['allow'] = false;
$conf['signup']['approve'] = true;
$conf['signup']['preprocess'] = false;
$conf['signup']['queue'] = false;
$conf['log']['priority'] = PEAR_LOG_NOTICE;
$conf['log']['ident'] = 'HORDE';
$conf['log']['params'] = array();
$conf['log']['name'] = 'LOG_MAIL';
$conf['log']['type'] = 'syslog';
$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']['driver'] = 'file';
$conf['token']['params']['driverconfig'] = 'horde';
$conf['token']['driver'] = 'sql';
$conf['mailer']['params']['auth'] = '0';
$conf['mailer']['type'] = 'smtp';
$conf['vfs']['params']['driverconfig'] = 'horde';
$conf['vfs']['type'] = 'sql';
$conf['sessionhandler']['params']['persistent'] = true;
$conf['sessionhandler']['params']['protocol'] = 'unix';
$conf['sessionhandler']['params']['hostspec'] = 'localhost';
$conf['sessionhandler']['params']['username'] = 'horde';
$conf['sessionhandler']['params']['password'] = 'password';
$conf['sessionhandler']['params']['database'] = 'horde';
$conf['sessionhandler']['type'] = 'pgsql';
$conf['geoip']['datafile'] = '/var/www/html/horde/config/GeoIP.dat';
$conf['problems']['email'] = 'webmaster at example.com';
$conf['menu']['always'] = false;
$conf['menu']['links']['help'] = 'all';
$conf['menu']['links']['options'] = 'authenticated';
$conf['menu']['links']['problem'] = 'all';
$conf['menu']['links']['login'] = 'all';
$conf['menu']['links']['logout'] = 'authenticated';
$conf['hooks']['username'] = false;
$conf['hooks']['preauthenticate'] = false;
$conf['hooks']['postauthenticate'] = false;
$conf['hooks']['authldap'] = false;
$conf['kolab']['enabled'] = false;
/* CONFIG END. DO NOT CHANGE ANYTHING IN OR BEFORE THIS LINE. */
===== 8< End of Horde's conf.php 8< =====

===== 8< IMP's conf.php 8< =====
<?php
/* CONFIG START. DO NOT CHANGE ANYTHING IN OR AFTER THIS LINE. */
// $Horde: imp/config/conf.xml,v 1.53 2004/12/09 15:33:27 slusarz Exp $
$conf['utils']['gnupg_keyserver'] = array('wwwkeys.pgp.net');
$conf['utils']['gnupg_timeout'] = '10';
$conf['utils']['openssl_cafile'] = '/somewhere/ca-bundle.crt';
$conf['utils']['openssl_binary'] = '/usr/bin/openssl';
$conf['menu']['apps'] = array();
$conf['user']['allow_folders'] = true;
$conf['user']['allow_view_source'] = true;
$conf['user']['allow_resume_all'] = false;
$conf['user']['allow_resume_all_in_drafts'] = false;
$conf['user']['alternate_login'] = false;
$conf['user']['redirect_on_logout'] = false;
$conf['user']['select_sentmail_folder'] = false;
$conf['server']['server_list'] = 'none';
$conf['server']['change_server'] = false;
$conf['server']['change_port'] = false;
$conf['server']['change_protocol'] = false;
$conf['server']['change_folders'] = false;
$conf['server']['sort_limit'] = '0';
$conf['server']['cache_folders'] = false;
$conf['mailbox']['show_attachments'] = false;
$conf['mailbox']['show_preview'] = false;
$conf['mailbox']['show_xpriority'] = false;
$conf['fetchmail']['show_account_colors'] = false;
$conf['fetchmail']['size_limit'] = '4000000';
$conf['msgsettings']['filtering']['words'] = './config/filter.txt';
$conf['msgsettings']['filtering']['replacement'] = '****';
$conf['spam']['reporting'] = false;
$conf['notspam']['reporting'] = false;
$conf['msg']['prepend_header'] = true;
$conf['msg']['append_trailer'] = true;
$conf['compose']['use_vfs'] = false;
$conf['compose']['allow_cc'] = true;
$conf['compose']['allow_bcc'] = true;
$conf['compose']['allow_receipts'] = true;
$conf['compose']['special_characters'] = true;
$conf['compose']['link_all_attachments'] = false;
$conf['compose']['link_attachments'] = true;
$conf['compose']['add_maildomain_to_unexpandable'] = false;
$conf['compose']['attach_size_limit'] = '0';
$conf['compose']['attach_count_limit'] = '0';
$conf['hooks']['vinfo'] = false;
$conf['hooks']['signature'] = false;
$conf['hooks']['trailer'] = false;
$conf['hooks']['fetchmail_filter'] = false;
$conf['hooks']['mbox_redirect'] = false;
$conf['hooks']['mbox_icon'] = false;
$conf['hooks']['spam_bounce'] = false;
$conf['maillog']['use_maillog'] = true;
$conf['tasklist']['use_tasklist'] = true;
/* CONFIG END. DO NOT CHANGE ANYTHING IN OR BEFORE THIS LINE. */
===== 8< End of IMP's conf.php 8< =====

===== 8< IMP's servers.php 8< =====
$servers['_prompt'] = array(
     'name' => _("Choose a mail server:")
);

$servers['cyrus'] = array(
     'name' => 'Cyrus IMAP Server',
     'server' => 'localhost',
     'hordeauth' => false,
     'protocol' => 'imap/notls',
     'port' => 143,
     'folders' => '',
     'namespace' => '',
     'maildomain' => 'milivojevic.org',
     'smtphost' => 'localhost',
     'smtpport' => 25,
     'realm' => '',
     'preferred' => '',
     'admin' => array(
         'params' => array(
             'login' => 'cyradm',
             'password' => 'password',
             // The 'userhierarchy' parameter defaults to 'user.'
             // If you are using a nonstandard hierarchy for personal
             // mailboxes, you will need to set it here.
             'userhierarchy' => 'user.',
             // Although these defaults are normally all that is required,
             // you can modify the following parameters from their default
             // values.
             'protocol' => 'imap/notls',
             'hostspec' => 'localhost',
             'port' => 143
         )
     ),
     'quota' => array(
         'driver' => 'cyrus',
         'params' => array(
             'login' => 'cyradm',
             'password' => 'password',
             // The 'userhierarchy' parameter defaults to 'user.'
             // If you are using a nonstandard hierarchy for personal
             // mailboxes, you will need to set it here.
             'userhierarchy' => 'user.',
             // Although these defaults are normally all that is required,
             // you can modify the following parameters from their default
             // values.
             'protocol' => 'imap/notls',
             'hostspec' => 'localhost',
             'port' => 143
         )
     ),
     'acl' => array(
         'driver' => 'rfc2086',
     ),
     'dotfiles' => false,
     'hierarchies' => array());
===== 8< End of IMP's servers.php 8< =====


More information about the horde mailing list