Roundcube Community Forum

News and Announcements => General Discussion => Topic started by: MM789 on March 30, 2020, 12:44:32 PM

Title: Multi Domain not work
Post by: MM789 on March 30, 2020, 12:44:32 PM
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:

Code: [Select]
<?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:
Code: [Select]
<?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:
Code: [Select]
<?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


Title: Re: Multi Domain not work
Post by: JohnDoh on March 30, 2020, 01:54:43 PM
So what exactly doesn't work?
Title: Re: Multi Domain not work
Post by: MM789 on March 30, 2020, 04:46:45 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
Title: Re: Multi Domain not work
Post by: JohnDoh on March 31, 2020, 04:37:50 AM
whats in your roundcube error log?
Title: Re: Multi Domain not work
Post by: MM789 on March 31, 2020, 04:45:55 PM
whats in your roundcube error log?
error log shows:

Code: [Select]
[31-Mar-2020 22:32:38 +0200]: <rr0evr5d> IMAP Error: Login failed for michael@domain.com 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
Title: Re: Multi Domain not work
Post by: JohnDoh on April 01, 2020, 05:04:25 AM
Code: [Select]
$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
Title: Re: Multi Domain not work
Post by: MM789 on April 01, 2020, 10:54:36 AM
Hello,

Quote
this 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?

Code: [Select]
$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 ..


Why must I concatenation "mail" to the hostname?

Regards
   Michael
Title: Re: Multi Domain not work
Post by: JohnDoh on April 01, 2020, 12:06:47 PM
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.