[ejabberd] Hosts, LDAP, multiple domains

Konstantin Khomoutov flatworm at users.sourceforge.net
Wed Aug 18 15:31:13 MSD 2010

On Wed, 18 Aug 2010 13:41:51 +0300
Take <take at nerd.fi> wrote:

> On 08/18/2010 01:04 PM, Konstantin Khomoutov wrote:
> > XMPP domains served by an ejabberd instance (that's what the "hosts"
> > option actually defines) do not have to correlate one-to-one with
> > LDAP domains or whatever. Basically, you use the ldap_uids option
> > to define
> Yes, I understand that I can run ejabberd for myhost.foo and let user
> john.doe at example.com authenticate to that. But the goal here is that
> john.doe at example.com could use his email address as an JID.
> And when I add jane.smith at foo.bar to LDAP I'd like that she could use
> her email address as an JID as well. For this (AFAIK) I have to add
> example.com and foo.bar to hosts-line in configuration file and I'd
> like to get rid of that and read allowed domains directly from the
> LDAP (or generate an file from LDAP and include it).
AFAIK, this is currently impossible.
I think even the addition of new vhosts at runtime (another name for
XMPP domains from the point of view or ejabberd) is impossible at the
I should note that XMPP domains mean more than just being parts of the
users' JIDs to the XMPP infrastructure; for instance, proper DNS setup
is often required for each XMPP domain. ejabberd also surely keeps
certain data bound to virtual hosts (as can be easily noted from the
web admin interface, for instance).

As to "generate an file from LDAP and include it" -- you can implement
this yourself: create a template for your config file (say, by
replacing the hosts directive with something like
{hosts, @HOSTS@}.
and then have a script to regen the actual config file from the
template, substituting the fetched list of unique domains instead of
the @HOSTS@ token.

More information about the ejabberd mailing list