Author Topic: Multi Domain not work  (Read 4483 times)

Offline MM789

  • Newbie
  • *
  • Posts: 5
Multi Domain not work
« 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



Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Re: Multi Domain not work
« Reply #1 on: March 30, 2020, 01:54:43 PM »
So what exactly doesn't work?
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline MM789

  • Newbie
  • *
  • Posts: 5
Re: Multi Domain not work
« Reply #2 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

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Re: Multi Domain not work
« Reply #3 on: March 31, 2020, 04:37:50 AM »
whats in your roundcube error log?
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline MM789

  • Newbie
  • *
  • Posts: 5
Re: Multi Domain not work
« Reply #4 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

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Re: Multi Domain not work
« Reply #5 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
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline MM789

  • Newbie
  • *
  • Posts: 5
Re: Multi Domain not work
« Reply #6 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 ..

  • I type my e-mail in the login mask e.g. michael@roundcube.net
  • 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

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Re: Multi Domain not work
« Reply #7 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.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…