Author Topic: multi domain problem?  (Read 905 times)

Offline lefko

  • Jr. Member
  • **
  • Posts: 12
multi domain problem?
« on: March 29, 2019, 03:12:54 AM »
Hi,
we have 3 different imap servers mail.x1.com mail.x2.com mail.x3.com authenticating our users. Roundcube doesn't run dovecot(dovecot runs on the imap servers) and it is installed on a different machine than the mailservers. I have created the config files for multi domain deployment and set the parameter to true. I get this error in the roundcube logfile.

 <kfmatkon> IMAP Error: Login failed for user from x.x.x.x. AUTHENTICATE PLAIN: * BYE Internal error occurred. Refer to server log for more information. in /var/www/html/roundcube/program/lib/Roundcube/rcube_imap.php on line 196 (POST /?_task=login&_action=login)

any ideas how to troubleshoot this?

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,218
Re: multi domain problem?
« Reply #1 on: March 29, 2019, 06:24:33 AM »
That message comes from your IMAP server not Roundcube. The username and/or password you tried must have been incorrect.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline lefko

  • Jr. Member
  • **
  • Posts: 12
Re: multi domain problem?
« Reply #2 on: April 01, 2019, 07:45:59 AM »
Thank you for the reply!
the user credentials are correct -what i think is that I am not sure how this multi domain setup works.
How can I make users to login to the appropriate mailhost ? Don't want to use a drop down menu.

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,218
Re: multi domain problem?
« Reply #3 on: April 01, 2019, 10:43:02 AM »
please provide more info on your set. you said you have 3 URLs for you webmail mail.x1.com mail.x2.com mail.x3.com and you've setup host config files for each one. so you have config files like mail.x1.com.inc.php right? and in each of those files you've definded a different server in $config['default_host']?
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline lefko

  • Jr. Member
  • **
  • Posts: 12
Re: multi domain problem?
« Reply #4 on: April 03, 2019, 02:34:16 AM »
Hi again,
we have 3 different imap servers mail.x1.xx.xx- mail.x2.xx.xx and mail.x3.xx.xx. I've created 3 config in the config folder, below i give you an example of one of them:
mail.x1.xx.xx.inc.php
<?php
$config['default_host']= 'mail.x1.xx.xx'
$config['username_domain']= 'x1.xx.xx'
users just type in their username without the domain extension.
thank you

Offline lefko

  • Jr. Member
  • **
  • Posts: 12
Re: multi domain problem?
« Reply #5 on: April 03, 2019, 03:03:22 AM »
i forgot to ask something more
what should i do with my config.inc.php file ? should i leave blank the default host option for the IMAP server?

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,218
Re: multi domain problem?
« Reply #6 on: April 03, 2019, 07:55:43 AM »
you could leave it blank. personally i think i'd pick one of my imap servers to be the default and put that in there.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline lefko

  • Jr. Member
  • **
  • Posts: 12
Re: multi domain problem?
« Reply #7 on: April 04, 2019, 03:21:00 AM »
hi again i've picked one of my imap servers for the default- still nothing with the rest of my imap servers. can't login to them. i can only login to the default one :-(

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,218
Re: multi domain problem?
« Reply #8 on: April 04, 2019, 04:02:08 AM »
please confirm you are using 3 different urls to acces your roundcube and they match the names of your host config files like mail.x1.com.inc.php
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline lefko

  • Jr. Member
  • **
  • Posts: 12
Re: multi domain problem?
« Reply #9 on: April 04, 2019, 04:35:20 AM »
roundcube is hosted on one server running apache in a test environment -no i cannot access roundcube from mail.x1.xx.xx because that is the dns name of one of the IMAP servers running on a different machine

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,218
Re: multi domain problem?
« Reply #10 on: April 04, 2019, 04:57:09 AM »
ah then host config files are not going to help you. these work based on the hostname used to access roundcube, not on the hostname of the imap server.

if the domain the user puts after the @ in their username when logging in identifies the imap server then the %s macro in the default_host option might help you. but if not then you'll need a plugin to determin the correct imap host during the login process. something like the virtuser_query plugin shipped with roundcube, specifically the user2host option is what you'd need.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline lefko

  • Jr. Member
  • **
  • Posts: 12
Re: multi domain problem?
« Reply #11 on: April 05, 2019, 08:10:28 AM »
thanks JohnDoh for getting back to me I will try your suggestion and get back to you next week
really appreciate your help

Offline lefko

  • Jr. Member
  • **
  • Posts: 12
Re: multi domain problem?
« Reply #12 on: April 09, 2019, 03:06:06 AM »
Hi again,
I've checked the virtuser_query plugin- but it doesn't seem to be doing anything for me- it was included in my config file already. I had a look at the code and what i gathered is that ideally i would like to set virtuser_dsn option to my Openldap server where all the right information is stored for users- mailhosts, cns etc
at the moment i have set the default host option to point to the "root"  mailhost and only users belonging there can login to roundcube- below i give you an example of the mailhost names
mail.com.org ---root mailhost1
mail.x1.com.org --mailhost2
mail.x2.com.org ----mailhost3
any other ideas?

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,218
Re: multi domain problem?
« Reply #13 on: April 09, 2019, 01:39:52 PM »
I don't think any of the plugins shipped with rc use ldap to do user2host lookups. perhaps you could use some of the info from the new_user_identity plugin and virtuser_query to work out how to do user2host from ldap. if you cannot derive the host from the username then a plugin is your only option.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline lefko

  • Jr. Member
  • **
  • Posts: 12
Re: multi domain problem?
« Reply #14 on: May 06, 2019, 08:11:22 AM »
Hi again it's been a while but i was busy with other things....
today while looking around i've found this plugin "roundcube-virtuser_ldap" which might do what i want - not sure how to use it though
ideally i would like to get the plugin's results at the login stage rather than the user creation stage
« Last Edit: May 07, 2019, 02:29:02 AM by lefko »