[RCU] (no subject)

Dirk F. Raetzel d00443 at spaetzle.de
Tue Dec 31 00:20:42 CET 2019


Hi Marc,

On 30/12/2019 21:59, Marc Roos wrote:
> I would like to keep things simple, for a temporary work-a-round. 
> Everyone is using the same https url. 
> 
> I thought about something like creating a small array of usernames and 
> then add something like
> 
> if (in_array('%u', $userarr)) { $config['smtp_server'] = 
> 'out2.example.com'; } 
> 
> Preferably in the config, so I can update roundcube to newer versions 
> easily. 

Use the virtuser_query plugin. No need for installation as it comes with
the normal roundcube installation. You just need to activate and
configure in your config file.

In your case you could do something like:

$config['virtuser_query'] = array('host' => "SELECT case when '%u' in
(....) then 'out2.example.com' else 'out1.example.com' end")

For more complicated cases store the relationship in your sql database
or build a stored procedure on the sql server. Any SQL statement which
gives back the host is allowed. %u will be expanded to the user login.

With the plugin you can also adjust other variables per user like the
email-address.

Best Regards

Dirk


More information about the users mailing list