Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: tobi79 on October 18, 2015, 05:25:04 PM

Title: Howto install virtuser_query plugin
Post by: tobi79 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:[email protected]/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
Title: Re: Howto install virtuser_query plugin
Post by: alec on October 19, 2015, 01:57:59 AM
Use %u without quotes, they will be added by the engine.
Title: Re: Howto install virtuser_query plugin
Post by: tobi79 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
Title: Re: Howto install virtuser_query plugin
Post by: alec on October 19, 2015, 02:27:25 PM
Did you check error log? Enable sql_debug to see what queries are executed.
Title: Re: Howto install virtuser_query plugin
Post by: Pilat on December 24, 2015, 03:52:33 AM
I have the same problem. I set

$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
Title: Re: Howto install virtuser_query plugin
Post by: SKaero on December 25, 2015, 05:36:12 AM
Quote from: Pilat on December 24, 2015, 03:52:33 AM
I have the same problem. I set

$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:
Quote from: alec on October 19, 2015, 01:57:59 AM
Use %u without quotes, they will be added by the engine.
Title: Re: Howto install virtuser_query plugin
Post by: natasha01 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