[ejabberd] Shared Roster - JID by IP works, JID by DNS name does not

Jim Wagner jwagner at graffadmin.com
Thu Feb 11 02:01:31 MSK 2010


I had ejabberd running on an old RedHat 9 box, accessible only from our 
LAN, providing instant messaging service for about 75-80 employees.  
This server recently died.  I replaced it with a new box running FreeBSD 
8.0.  I installed ejabberd from the ports system and am currently 
running 2.0.5.

I thankfully had some warning that the server was dying, so I had time 
to install and configure a new box to replace it.  It now provides DNS 
service, and I have it set up to resolve a bogus domain name for my 
store; since it's not accessible from outside our LAN, it shouldn't pose 
a problem.  If I ping location1.store, I get a response from the IP of 
the server, w.x.y.z.  All of the clients use GAIM 1.5, either on Windoze 
or Linux, and are set up to have User_Name at w.x.y.z as the user name of 
their jabber ID.  I thought it would be nice to have people set up so 
that you have User_Name at location1.store instead of the IP address.  I 
was able to get ejabberd to recognize registrations (done via the 
command line - in band registration is disabled due to my co-workers 
having the maturity of junior high school kids) to location1.store and 
w.x.y.z by adding another host to the hosts line in the ejabberd.cfg 
file:  {hosts, [ "location1.store", "w.x.y.z" ]}.

However, there is a problem.  (Of course - why else would I be posting 
this message if I didn't have a problem? ;) )

I had everybody set up in a shared roster for their specific department 
- all sales people were in one group, all administrative people were in 
another, all managers in another, etc.  All the groups were allowed to 
see all the other groups, which effectively made the shared roster an 
index of the people online at my location and it worked well.  To get 
things working last night when replacing the server, I used the @all@ 
trick (added well after the old server was set up) to create a single 
shared roster with everybody in it - no groups at all.

When I register User_Name at location1.store with ejabberd and log on with 
a PC with an 'everybody' shared roster, there are no users shown online, 
whether they are on or not.  If you send a person who is shown as 
offline a message, they get it immediately, indicating to me that it's a 
presence notification problem.  However, if I set up the box to have 
only w.x.y.z as the host and log on with the corresponding accounts, the 
shared roster works perfectly albeit without the groups I had before.  
(I may play with the groups if I can get this figured out; might not be 
worth the administrative hassle every time somebody is hired or leaves.)

I know that the problem has got to be something relatively simple in my 
configuration and I'm just not understanding.  Ideally, I'd like to have 
a single shared roster with User_Name at location1.store with presence 
notification going out to anybody who is online.  If a message is sent 
to User_Name at w.x.y.z, it's dumped to User_Name at location1.store and vice 
versa (since they're the same User_Name on the same box), at least until 
the store is migrated to using location1.store for everybody's jabber IDs.

In the future, I'll probably add User_Name at location2.store to designate 
people working at other locations (with location2.store resolving via 
DNS to the same IP of location1.store) and I'd like to have the online 
presence of all people in the shared roster be reported correctly in 
everybody's buddy list.  This is definitely for the future though.

Any help would be appreciated.  Thanks in advance.

Jim



PS - I did discover a possibly untended behavior in ejabberd while in 
this process.  If you do not have mod_roster enabled and do have 
mod_shared_roster, you can see the shared roster, but everybody appears 
as being offline.  Enable mod_roster and the status of everybody in your 
shared roster is then reported accurately.




More information about the ejabberd mailing list