Roundcube Community Forum

 

Multi Domain not work

Started by MM789, March 30, 2020, 12:44:32 PM

Previous topic - Next topic

MM789

Hello community,

I have configured the multi domain as I see in the documentation (unfortenly there is not example given)

The config.inc.php file is:

<?php
$config
['db_dsnw'] = 'mysql://mail:password@localhost';
$config['support_url'] = '';
$config['include_host_config'] = 1;
$config['include_host_config'] = array(
    
'domain1.com' => 'doman1_config.inc.php',
    
'domain2.at' => 'domain2_config.inc.php',
);

$config['plugins'] = array(
'acl',
'additional_message_headers',
'archive',
'attachment_reminder',
'autologon',
'enigma',
'example_addressbook',
'filesystem_attachments',
'help',
'identity_select',
'jqueryui',
'newmail_notifier',
'password',
'show_additional_headers',
'subscriptions_option',
'userinfo',
'vcard_attachments',
'virtuser_file',
'zipdownload',
'carddav',
'caldav_calendar',
);

$config['language'] = 'de_DE';
$config['spellcheck_engine'] = 'atd';
$config['mail_pagesize'] = 100;
$config['htmleditor'] = 1;


The content from file 'doman1_config.inc.php' is:
<?php
$config
['default_host'] = 'ssl://xxx.domain.at';
$config['default_port'] = 993;
$config['smtp_server'] = 'ssl://xxx.domain.at';
$config['smtp_port'] = 465;
$config['des_key'] = 'xyxyxyxyxy';
$config['username_domain'] = 'domain1.com';


and the content from 'domain2_config.inc.php' is:
<?php
$config
['default_host'] = 'ssl://xxx.domain.at';
$config['default_port'] = 993;
$config['smtp_server'] = 'ssl://xxx.domain.at';
$config['smtp_port'] = 465;
$config['des_key'] = 'xyxyxyxy';
$config['username_domain'] = 'domain2.at';


If I have not multi domains, it works fine.
What is wrong with my multi domain configuration?

Regards
   Michael



JohnDoh

So what exactly doesn't work?
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

MM789

Quote from: JohnDoh on March 30, 2020, 01:54:43 PM
So what exactly doesn't work?

Ohh, sorry - of course: I can't login, then occured the error "Connection to storage server failed"

Thank's
   Michael

JohnDoh

whats in your roundcube error log?
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

MM789

Quote from: JohnDoh on March 31, 2020, 04:37:50 AM
whats in your roundcube error log?
error log shows:

[31-Mar-2020 22:32:38 +0200]: <rr0evr5d> IMAP Error: Login failed for [email protected] against localhost from 195.xxx.xxx.xxx. Could not connect to localhost:143: Connection refused in /var/www/html/mail/program/lib/Roundcube/rcube_imap.php on line 200 (POST /mail/?_task=login&_action=login)


Perhaps has everybody a correct example for multi domain?

Regards
   Michael

JohnDoh


$config['include_host_config'] = array(
    'domain1.com' => 'doman1_config.inc.php',
    'domain2.at' => 'domain2_config.inc.php',
);


this looks correct. the array key should be the host name you use to access Roundcube. There is a little info here https://github.com/roundcube/roundcubemail/wiki/Configuration:-Multi-Domain-Setup
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

MM789

Hello,

Quotethis looks correct. the array key should be the host name you use to access Roundcube

OK, my hostname is roundcube.net and roundcube.com

In this example is showing "mail.roundcube.net". The real host name would be "roundcube.net" and not "mail.roundcube.net" - or?

$config['include_host_config'] = array(
    'mail.roundcube.net' => 'net_config.inc.php',
    'mail.roundcube.com' => 'com_config.inc.php',
);


How works this algorithm? I think ..


  • I type my e-mail in the login mask e.g. [email protected]
  • rc cuts the hostname => roundcube.net
  • rc go in the config.inc.php and search in the array
  • rc load the corresponding file => in this example net_config.inc.php, and execute it

Why must I concatenation "mail" to the hostname?

Regards
   Michael

JohnDoh

The host name used for the per host config is what you put in your browser's address bar, in PHP server variables terms it should be one of $_SERVER['HTTP_HOST'], $_SERVER['SERVER_NAME'] or $_SERVER['SERVER_ADDR'].

For example if you put https://www.mydomain.com/webmail then its www.mydomain.com and if you put https://webmail.mydomain.com/ then its webmail.mydomain.com.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...