Author Topic: How to autoselect server based on email domain?  (Read 355 times)

Offline Nicram

  • Newbie
  • *
  • Posts: 1
    • Homepage
How to autoselect server based on email domain?
« on: June 01, 2022, 07:31:01 AM »
Hello.
My users use full email address for login into Roundcube 1.5.2.
I'm setting up another email server, and i would like to use the same Roundcube site.

What i already done are those settings in config.inc.php:
Quote
$config['default_host'] = array('server1.domain.com', 'server2.domain.com');
$config['smtp_server'] = 'tls://%h';

With this, at user login page, there is drop-down list where user can select correct server.
I would prefer, that when user@domainX.com is logging in, it use "server1.domain.com", and when user@domainY.com it use "server2.domain.com".
Is there any possibility to do that using confing.inc.php?
Thank You for help!

Update:
I found this: https://github.com/roundcube/roundcubemail/wiki/Configuration%3A-Multi-Domain-Setup
i made new file called server2.domain.com.inc.php in config directory.
Put inside:
Quote
<?php

$config['default_host'] = 'tls://server2.domain.com.inc.php';
$config['username_domain'] = 'domainY.com';
$config['smtp_server'] = 'tls://server2.domain.com.inc.php';

and i've added $config['include_host_config'] = true; inside config.inc.php. But it also didn't help me.
« Last Edit: June 01, 2022, 01:52:35 PM by Nicram »