Author Topic: Howto install virtuser_query plugin  (Read 7439 times)

Offline tobi79

  • Newbie
  • *
  • Posts: 2
Howto install virtuser_query plugin
« on: October 18, 2015, 05:25:04 PM »
Hi all,

I tryed the last hour to config the virtuser_query, but I didnt find any running config. I activate the plugin and have add these two lines:

$config['virtuser_query_dsn'] = 'mysql://roundcube:pass@172.17.130.83/mailserver';
$config['virtuser_query'] = array('email' => 'SELECT email FROM virtual_users WHERE login = "%u"');

I tryed aswell:
$config['virtuser_query'] = 'SELECT email FROM mailserver.virtual_users WHERE login = "%u"';

But all didnt work. Could anyone help me?

Thx
Tobi

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: Howto install virtuser_query plugin
« Reply #1 on: October 19, 2015, 01:57:59 AM »
Use %u without quotes, they will be added by the engine.

Offline tobi79

  • Newbie
  • *
  • Posts: 2
Re: Howto install virtuser_query plugin
« Reply #2 on: October 19, 2015, 10:25:47 AM »
Hi!

Thx for the quick answer and hint. But if I delete the quotes the select did not work and additional is anything wrong. Currently I think that the option virtuser_query_dsn does not work, the logindata are all ok. Is the used string wrong?

Tobi

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: Howto install virtuser_query plugin
« Reply #3 on: October 19, 2015, 02:27:25 PM »
Did you check error log? Enable sql_debug to see what queries are executed.

Offline Pilat

  • Newbie
  • *
  • Posts: 1
Re: Howto install virtuser_query plugin
« Reply #4 on: December 24, 2015, 03:52:33 AM »
I have the same problem. I set
Code: [Select]
$config['debug_level'] = 1;
$config['sql_debug'] = true;
$config['virtuser_query'] = array('email' => 'select a.alias from dbmail_users u left join dbmail_aliases a on u.user_idnr = a.deliver_to where u.userid="%u"');

$config['plugins'] = array('acl', 'virtuser_query');
There are no one error or any row about using virtuser_query in logs/sql

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Re: Howto install virtuser_query plugin
« Reply #5 on: December 25, 2015, 05:36:12 AM »
I have the same problem. I set
Code: [Select]
$config['debug_level'] = 1;
$config['sql_debug'] = true;
$config['virtuser_query'] = array('email' => 'select a.alias from dbmail_users u left join dbmail_aliases a on u.user_idnr = a.deliver_to where u.userid="%u"');

$config['plugins'] = array('acl', 'virtuser_query');
There are no one error or any row about using virtuser_query in logs/sql
As stated by alec above:
Use %u without quotes, they will be added by the engine.

Offline natasha01

  • Newbie
  • *
  • Posts: 5
Re: Howto install virtuser_query plugin
« Reply #6 on: February 24, 2016, 07:55:06 AM »
To begin, you should note that from RoundCube v1.0 and onwards, the configuration settings are included in one file only, as opposed to previous versions where they were split between two files.

First, locate the following file and make a copy named config.inc.php in the same directory. Use the -p option to preserve mode, ownership, and original timestamp:

# cp -p /etc/roundcubemail/defaults.inc.php /etc/roundcubemail/config.inc.php