[ejabberd] Routing between Virtual Hosts

Badlop badlop at gmail.com
Sun Mar 1 01:36:34 MSK 2009


2009/2/19 Jeffrey Rogiers <jeffrey.rogiers at gmail.com>:
> I have narrowed this down to using the anonymous login method.
> I logged in using 2 users from each domain.
> ODBC (mysql):
> abc123 at x.org
> qwerty at x.org
> ANON (anonymous):
> abc123 at guest.x.org
> qwerty at guest.x.org
>
> These were the results of my test when trying to request presence.
> abc123 (ODBC) -> qwerty  (ODBC) [Pres - Both]
> abc123 (ANON) -> qwerty  (ANON) [Pres - None]
> abc123 (ODBC) -> abc123 (ANON) [Pres - None]
> abc123 (ANON) -> abc123 (ODBC) [Pres - 1Way]
>
> Im curious if anonymous users intentionally not supposed to have
> roster at all? or if this is definitely a bug.

I tried with ejabberd 2.0.3 and trunk SVN, using mysql auth for a
vhost and login_anon for the other, with a configuration similar to
yours.

If guest.localhost uses mod_roster: roster, subscriptions and
presences work correctly.
If guest.localhost uses mod_roster_odbc: I see the same problems than
you, and ejabberd.log shows:
**************
=ERROR REPORT==== 28-Feb-2009::23:31:44 ===
E(<0.590.0>:ejabberd_hooks:190) : {noproc,
                                   {gen_server,call,
                                    ['ejabberd_odbc_sup_guest.localhost',
                                     which_children,infinity]}}
running hook: {roster_out_subscription,
                  ["badlop","guest.localhost",
                   {jid,"badlop","localhost",[],"badlop","localhost",[]},
                   subscribe]}

=ERROR REPORT==== 28-Feb-2009::23:31:44 ===
E(<0.590.0>:ejabberd_hooks:205) : {noproc,
                                   {gen_server,call,
                                    ['ejabberd_odbc_sup_guest.localhost',
                                     which_children,infinity]}}
running hook: {roster_in_subscription,
                  ["badlop","guest.localhost",
                   {jid,"badlop","localhost",[],"badlop","localhost",[]},
                   subscribed,[]]}

=ERROR REPORT==== 28-Feb-2009::23:31:44 ===
E(<0.424.0>:gen_iq_handler:118) : {noproc,
                                   {gen_server,call,
                                    ['ejabberd_odbc_sup_guest.localhost',
                                     which_children,infinity]}}
**************


You configured in ejabberd.cfg something like this, right?:
{hosts, ["x.org", "guest.x.org"]}.
{modules, [
  %%{mod_roster, []},
  {mod_roster_odbc, []},
  ...
 ]}.

With that setup, ejabberd will use mod_roster_odbc in x.org and also
in guest.x.org
However, mod_roster_odbc does not seem compatible for anonymous authentication.

The solution is to move the mod_roster* definition from the main
modules section to individual vhost definitions:

{hosts, ["x.org", "guest.x.org"]}.
{modules, [
  %%{mod_roster, []},
  %%{mod_roster_odbc, []},
  ...
 ]}.
{host_config, "localhost",
 [{{add, modules},
   [
    {mod_roster_odbc,   []}
   ]
  }
 ]}.

{host_config, "guest.localhost",
 [{{add, modules},
   [
    {mod_roster,   []}
   ]
  }
 ]}.



---
Badlop,
ProcessOne


More information about the ejabberd mailing list