Author Topic: proper virtuser_query configuration  (Read 4440 times)

Offline Pantani

  • Jr. Member
  • **
  • Posts: 18
proper virtuser_query configuration
« on: January 12, 2012, 04:31:46 AM »
I have read the documentation from RC on Howto_Config and hope this is and official howto for this. But I'm still unable to login into RC. When I have normal table "users" as RC expects, everything works fine. When I setup a "CREATE VIEW..." to the mail_account table, everything works. But I want to have the solution of virtuser_query plugin - it seems to be better.

My database:
====================
pgsql=# \d mail_account;
                                     Table "public.mail_account"
   Column   |            Type             |                         Modifiers                        
------------+-----------------------------+-----------------------------------------------------------
 id         | integer                     | not null default nextval('mail_account_id_seq'::regclass)
 email      | character varying(64)       | not null
 home       | character varying(255)      | not null default (NOT NULL::boolean)
 hardquota  | integer                     | default 0
 enabled    | boolean                     | default true
 last_login | timestamp without time zone |

My main.inc.php
====================
// List of active plugins (in plugins/ directory)
$rcmail_config['plugins'] = array('virtuser_query');
$rcmail_config['virtuser_query'] = "SELECT email FROM mail_account WHERE email='%u'";

Database log does not have anything about access to the mail_account table, the RC asks for the user always from his "users" table. Why?

This is error log of RC:
====================
[12-Jan-2012 10:26:13 +0100]: DB Error: prepare: [Error message: Unable to create prepared statement handle]
[Last executed query: DEALLOCATE PREPARE mdb2_statement_pgsql_2679580b88a2838213e80f4975abc88fc587b6050]
[Native message: ERROR:  relation "users" does not exist
LINE 1: SELECT * FROM users WHERE mail_host = $1 AND alias = $2
                      ^]
 in /var/www/html/roundcubemail/program/include/rcube_mdb2.php on line 293 (POST /roundcubemail/?_task=login&_action=login)
[12-Jan-2012 10:26:13 +0100]: PHP Error: Access denied for new user mymail@domain.cz. 'auto_create_user' is disabled in /var/www/html/roundcubemail/program/include/rcmail.php on line 865 (POST /roundcubemail/?_task=login&_action=login)

Offline Pantani

  • Jr. Member
  • **
  • Posts: 18
proper virtuser_query configuration
« Reply #1 on: January 12, 2012, 07:51:45 AM »
I didn't create the "users" table. It's also needed if you want to use the virtuser_query, it's needed for storing user's settings. And also the option "auto_create_user" must be set to "true".

Regards