Hi All,
I want to use one roundcube install for multiple domains, and allow users to only enter their names (i.e. before the '@'). Right now I'm testing with two domains I use for the family.
I tried setting the following parameters, but so far I keep getting a "login failed" error because the domain is never added to the name (I'm testing internally):
$rcmail_config['username_domain'] = array( 'webmail.thesandhufamily.ca' => 'thesandhufamily.ca', 'webmail.m3freak.com' => 'm3freak.com' );
$rcmail_config['mail_domain'] = array( 'webmail.thesandhufamily.ca' => 'thesandhufamily.ca', 'webmail.m3freak.com' => 'm3freak.com' );
I next tried to use host specific config files. I enabled 'include_host_config', and created a file name 'thesandhufamily.inc.php'. In that, I set the following:
<?php $rcmail_config['username_domain'] = 'thesandhufamily.ca'; $rcmail_config['mail_domain'] = 'thesandhufamily.ca'; ?>
But, I have the same problem: I can't login because the domain name never gets added to the user name, so the IMAP server denies the login.
I'm probably again doing something wrong.
Note: I'm finding the documentation to be somewhat lacking. More concrete examples would be of great help. But, this list has proven very helpful so far. :)
Regards,
Ranbir
On Thursday, May 1 at 10:41 PM, quoth Kanwar Ranbir Sandhu:
I want to use one roundcube install for multiple domains, and allow users to only enter their names (i.e. before the '@'). Right now I'm testing with two domains I use for the family.
I do that; it's pretty easy, once you figure it out, but it's not really an obvious trick.
I next tried to use host specific config files. I enabled 'include_host_config', and created a file name 'thesandhufamily.inc.php'. In that, I set the following:
I've never played with that... I prefer things I can read all at once.
Here's what I do:
$vdomainmapping = array( 'domain1.com' => 'domain1.com', 'www.domain1.com' => 'domain1.com', 'domain2.com' => 'domain2.com', 'www.domain2.com' => 'domain2.com', ); if (isset($vdomainmapping[$_SERVER['HTTP_HOST']])) { $rcmail_config['username_domain'] = $vdomainmapping[$_SERVER['HTTP_HOST']]; } else { $rcmail_config['username_domain'] = ''; }
Hope that helps!
Testing can show the presence of errors, but not their absence. -- E. W. Dijkstra
List info: http://lists.roundcube.net/users/
On Thu, 2008-05-01 at 23:32 -0500, Kyle Wheeler wrote:
I do that; it's pretty easy, once you figure it out, but it's not really an obvious trick.
Why is it a trick, though? There appears to be two documented methods to do multiple domains with one install - either one should be enough
I've never played with that... I prefer things I can read all at once.
Here's what I do:
$vdomainmapping = array( 'domain1.com' => 'domain1.com', 'www.domain1.com' => 'domain1.com', 'domain2.com' => 'domain2.com', 'www.domain2.com' => 'domain2.com', ); if (isset($vdomainmapping[$_SERVER['HTTP_HOST']])) { $rcmail_config['username_domain'] = $vdomainmapping[$_SERVER['HTTP_HOST']]; } else { $rcmail_config['username_domain'] = ''; }
Holy shit. Firstly, where do I put that? Secondly, why the hell is any of that necessary when roundcube is supposed to have easily configurable, built in support for multiple domains?! I'm absolutely dumb founded.
Thanks for the reply. I appreciate it.
Regards,
Ranbir
On Friday, May 2 at 01:54 AM, quoth Kanwar Ranbir Sandhu:
I've never played with that... I prefer things I can read all at once.
Here's what I do:
$vdomainmapping = array( 'domain1.com' => 'domain1.com', 'www.domain1.com' => 'domain1.com', 'domain2.com' => 'domain2.com', 'www.domain2.com' => 'domain2.com', ); if (isset($vdomainmapping[$_SERVER['HTTP_HOST']])) { $rcmail_config['username_domain'] = $vdomainmapping[$_SERVER['HTTP_HOST']]; } else { $rcmail_config['username_domain'] = ''; }
Firstly, where do I put that?
I put it in the config/main.inc.php file.
Secondly, why the hell is any of that necessary when roundcube is supposed to have easily configurable, built in support for multiple domains?! I'm absolutely dumb founded.
Well, I started doing it that way when I first started using roundcube, which was a while ago. If they've improved things since, I haven't noticed.
But some of the comments in the config file are misleading. For example, the comment preceeding username_domain in there says:
Automatically add this domain to user names for login
Only for IMAP servers that require full email-addresses for login
Specify an array with 'host' => 'domain' values to support
multiple hosts
What they don't tell you is that "host" is not matched against $_SERVER['HTTP_HOST'], but is instead matched against the *IMAP SERVER NAME*. As you can see in program/include/rcmail.php, the matching is done against a variable named $host - the test is:
isset($config['username_domain'][$host])
And what is $host? It gets defined just above there, from $config['default_host'], which is the IMAP server.
You may be asking yourself "why in hell would they do that?!?"; the answer is because of a different feature. You can configure RoundCube to serve as a frontend for multiple IMAP servers, with a popup box on the login window allowing you to select them. So you could, for example, set up the same RoundCube to be a frontend for both your personal email and your work email, and all you have to do is select which one you're logging in to. Then all the necessary configuration options automatically change to match the server that you've chosen to log into.
Okay, so, it's still a pretty pointless feature for what most people want to use RoundCube *for*, but that's what they're doing. So in most places in the documentation, where they say "host", they're using an unusual definition of the term. Rather than "the domain on which this webmail is being hosted" what they really mean is "the imap server to which this webmail is connecting". So, for people who just have several virtual domains on the same server, this feature is *entirely useless* because $host is always going to be 'localhost'.
Once you realize that the developers have a unique perspective here, things start to make more sense.
I hadn't seen the "include_host_config" option before. From looking at the source, while this does indeed match based on $_SERVER['HTTP_HOST'] and looks like it would do the right thing... it's only used in a function (load_host_config) that is NEVER ACTUALLY CALLED, so those files will never be read. Which is probably the primary reason why include_host_config isn't documented or included in the main.inc.php file.
~Kyle
P.S. For what it's worth, I just created a bug for this (http://trac.roundcube.net/ticket/1485040)
On Thu, May 1, 2008 at 11:54 PM, Kanwar Ranbir Sandhu wrote:
Roundcube is supposed to have easily configurable, built in support for multiple domains?! I'm absolutely dumb founded.
Dude, I am a new RoundCube user, but I must say that most popular webmail apps support multiple domains, provided the user specifies their email address (username@domain). RoundCube, like IlohaMail and SquirrelMail, supports this out-of-the-box.
To support multiple domains without the user specifying the actual domain usually requires some code modification (like grabbing some environment variables as shown in this thread).
I run one install of RoundCube under a single SSL host for all domains. Thus, I chose to not have any "default" domain(s) and to force my multi-domain users to specify their email address (I don't have an SSL cert for every domain so: http://mail.theirdomain.tld redirects to https://mydomain/mail).
To eliminate confusion on the login page, I changed the 'string bundle' so that "Email Address" was displayed on the login page instead of "Username".
In File: program/localization/en_US/labels.inc :: (and any other langs you support) $labels['username'] = 'Email Address';
This doesn't solve your problem, but the default install worked well for me.
-gnul _______________________________________________ List info: http://lists.roundcube.net/users/
I got around this by just simply having roundcube in one folder for webmail.museumtour.com, and then having another roundcube folder for my other webmail accounts, that for example, webmail.example.com would go to its own webmail that only has the configuration for example.com and webmail.museumtour.com only has the configuration for museumtour.com. This is by far a more simpler way to host multiple domains using the same webmail. Comon how long does it really take to install roundcube, it tooke me all of about 30 minutes to get everything working.