Gaurav Jain | 24 May 01:52 2015

Find out if user already exist - ejabberd admin

I create users with ejabberd_admin register command. I do not use in-band regsitration. 

For the same I wanted to find out, if user already exist. I get following error from ejabberd when sent a request thru node.js server.

What should I look for in the error message to consistently find out if user already exists?

Is there any other API to do the same?


  "stdout": "User user124 <at> already registered at node ejabberd <at> localhost\n",

  "stderr": "",

  "error": {

    "killed": false,

    "code": 1,

    "signal": null



Best Regards,

ejabberd mailing list
ejabberd <at>
David Miranda Aragon | 21 May 16:42 2015

export and import users, password and contacts

good morning list
that command must be used to save my users with their password and their 
contacts created in my ejabberd server. the problem is I want to change 
my ejabberd and install debian 8


Lic. David Miranda Aragón
Unidad de Investigación para la Construcción Cienfuegos. ENIA-MICONS
Administrador de Red
Email: david <at>
Jabber: david <at>
Teléfono: (043) 525128
Ave 56 # 5101 (Altos), Cienfuegos - CUBA

ejabberd mailing list
ejabberd <at>
Isaac Chivende | 14 May 14:31 2015

is it possible to use ejabberd to synchronize database

is it possible to synchronize a database to the master using ejabberd, eg MS SQL or MySQL. if possible how do i go about it
ejabberd mailing list
ejabberd <at>
Real Writter | 12 May 13:30 2015

mod_log_chat compilation error


I am trying to install mod_log_chat module on a ejabberd-15.03 installation using the command ejabberdctl command. But it fails with following error. Can someone help me on this please?

root <at> 04:/home# /opt/apps/jabber15.03/sbin/ejabberdctl module_install mod_log_chat
src/mod_log_chat.erl:20: redefining macro 'LAGER'
Error: {compilation_failed,"src/mod_log_chat.erl"}

ejabberd mailing list
ejabberd <at>
Richard Hall | 5 May 16:16 2015

Custom Erlang Authentication Module, and Client IP Address


I am currently writing an auth module (ejabberd_auth_…), and am having an issue. While running the auth
module is running fine, I need to access the client’s IP address that they are connecting to the Ejabberd
server with. Is there an easy way to do this from the auth module?

ejabberd mailing list
ejabberd <at>
Santiago Ignacio Poli | 30 Apr 15:09 2015

Can someone tell me what am I doing wrong?

Recently I've been trying to implement my own IQ Handlers in ejabberd. I've been using the hook mechanism for some time now but I think IQ Handlers are more suitable for the features I need to implement.

I've made a simple IQ handler to learn how to do this and encountered a problem: Every time I send my custom IQ from my client, ejabberd throws this exception (and don't return anything to the client):

09:59:28.135 [error] gen_fsm <0.574.0> in state session_established terminated with reason: bad argument in call to xml:element_to_binary({xmlel,<<"iq">>,[{<<"from">>,<<"localhost">>},{<<"to">>,<<"1 <at> localhost/11909950391430398765210138">>},...],...}) in ejabberd_c2s:send_element/2 line 1908
09:59:28.136 [error] CRASH REPORT Process <0.574.0> with 0 neighbours exited with reason: bad argument in call to xml:element_to_binary({xmlel,<<"iq">>,[{<<"from">>,<<"localhost">>},{<<"to">>,<<"1 <at> localhost/11909950391430398765210138">>},...],...}) in ejabberd_c2s:send_element/2 line 1908
09:59:28.136 [error] Supervisor ejabberd_c2s_sup had child undefined started with {ejabberd_c2s,start_link,undefined} at <0.574.0> exit with reason bad argument in call to xml:element_to_binary({xmlel,<<"iq">>,[{<<"from">>,<<"localhost">>},{<<"to">>,<<"1 <at> localhost/11909950391430398765210138">>},...],...}) in ejabberd_c2s:send_element/2 line 1908 in context child_terminated

The code inside the handler is called correctly (I echoed things to test that) but the problem is when the function tries to return the response.

Here's my code:




-define(IQ_CUSTOM, <<"test:iq:custom">>).

start(Host, _) ->
error_logger:error_msg("Started mod_block"),
gen_iq_handler:add_iq_handler(ejabberd_local, Host, ?IQ_CUSTOM, ?MODULE, process_local_iq, one_queue),

stop(Host) ->
gen_iq_handler:remove_iq_handler(ejabberd_local, Host, ?IQ_CUSTOM),

process_local_iq(From,_ ,IQ) ->
User = From#jid.luser,
error_logger:error_msg("User: ~s", [User]),
IQ#iq{type = result,
sub_el =
name = <<"query">>,
attrs = [{<<"xmlns">>, ?IQ_CUSTOM}, {<<"test">>,1}],
children = []
The problem occurs when I send stanzas like this:
<iq id="test1" to="localhost" type="get"><query xmlns="test:iq:custom"/></iq>

Thanks in advance!
ejabberd mailing list
ejabberd <at>
Gaurav Jain | 27 Apr 18:43 2015

gen_server terminated with reason: bad return value:

I have code - this was the last function that was executed.

process_packet(From, To, Packet) ->

    #jid{luser = LUser, lserver = LServer} = To,

    gen_mod:get_module_proc(To#jid.lserver, ?PROCNAME) !

            #offline_msg{us = {LUser, LServer},

                       from = From, to = To, packet = Packet},


I get this error:

2015-04-27 01:27:26.012 [error] <0.384.0> gen_server 'offline_test' terminated with reason: bad return value: {offline_msg,{<<"abcdef">>,<<"">>},{jid,<<"ghijklm">>,<<"">>,<<"phone">>,<<"ghijklm">>,<<"">>,<<"phone">>},{jid,<<"abcdef">>,<<"">>,<<>>,<<"abcdef">>,<<"">>,<<>>},{xmlel,<<"message">>,[{<<"type">>,<<"chat">>},{<<"to">>,<<"abcdef <at>">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"Update: Some">>}]},{xmlel,<<"thread">>,[],[]},{xmlel,<<"subject">>,[],[{xmlcdata,<<"someData">>}]},...]}}


%% gen_server callbacks


init([Host, Opts]) ->


        ejabberd_hooks:add(offline_message_hook, Host, ?MODULE, process_packet, 49),

        {ok, #state{host = Host}}.

handle_call(stop, _From, State) ->

    {stop, normal, ok, State}.

handle_cast(_Msg, State) -> {noreply, State}.

handle_info(#offline_msg{us = _UserServer,

                from = From, to = To, packet = Packet} = _Msg, State) ->

    CustomStatus = read_custom_status(From#jid.user, To#jid.user),

    if CustomStatus == <<"available">> ->

                process_offline_packet(From, To, Packet);

       true -> ok


    {noreply, State};

handle_info(_Info, State) ->

    {noreply, State}.

terminate(_Reason, State) ->

    Host =,

    ejabberd_hooks:delete(offline_message_hook, Host, ?MODULE, process_packet, 49),


Would you be able to tell the issue?

Best Regards,

ejabberd mailing list
ejabberd <at>
Isaac Chivende | 26 Apr 00:02 2015

how do i intergrated ejabberd with my web app

i am trying to intergrate my web app with ejabberd. i dnt knw
where to start from. i have downloaded and install ejabberd on my
machine. i tried to look for online help but am not getting any
meaningfull help. please help
Jérôme Sautret | 24 Apr 16:18 2015

[ANN] ejabberd Community 15.04


ejabberd 15.04 keeps the project delivering new features and
improvements at the same fast pace.

The focus for this release is to consolidate and improve what was
delivered in the previous release, and also to integrate contributions
which has been critical for most deployment these days.

## New features

We integrated useful contributions around groupchat (mod_admin_extra
and mod_muc_admin) into ejabberd core. This means ejabberd admins get
a new set of powerful ejabberdctl command and API they can rely on
with standard ejabberd deployments.

We also made XEP-0033 Extended Stanza Addressing a default component.
This is extremely useful to build chat service that use adhoc chat
mechanisms. It brings to ejabberd the ability to send messages to
multiple recipients at once without using Multi User chat or PubSub.
You can see it a bit like email cc or bcc features. This allows to
build extremely simple and lightweight multi party chat features.

Among new features, we now have a SQLite backend that can replace
Mnesia for those who prefer a basic backend for small and simple
standalone deployments.

## Improvements

We've improved a lot of modules, added some major PubSub improvements,
better RFC compliance, many bug fixes and small tweaks all over the
place thanks to your feedback. The cluster script helpers have been
improved to work in more situations.

## Elixir

We are still pushing Elixir integration further: this new version of
ejabberd can be embedded in any Elixir application, for example in a
Phoenix Web application. Here is a tutorial showing how it works:

## PubSub

PubSub improvements include code refactor, bug fixes, minor
optimizations and removal of old mod_pubsub_odbc. mod_pubsub now uses
db_type parameter like all other ejabberd modules.
NOTE: Users of old mod_pubsub_odbc will need to alter pubsub_node
table changing the type attribute: set flat when it was flat_odbc,
hometree when it was hometree_odbc, and pep when it was pep_odbc.
Without this manual change in your database, the new mod_pubsub will
not work.

## Changelog overview

- R16B03-1 is now the minimal required Erlang/OTP version
- SQLite support
- Default db_type can be specified with global default_db option
- Included mod_muc_admin, mod_admin_extra and mod_multicast modules
- Removed ejabberd_http_poll
- PubSub improvements
- Better RFC compliance
- Several other bugfixes

ProcessOne installer now includes Erlang/OTP 17.5, with added new
configuration option in ejabberd: sqlite, redis and elixir support.
The Linux 32bit installer is no longer maintained.

## Feedback

As usual, the release is tagged in the Git source code repository on Github:

The source package and binary installers are available at ProcessOne:

If you suspect you found a bug, please search or fill a bug report on Github:
Santiago Ignacio Poli | 23 Apr 19:45 2015

Self-Contained ejabberd


I would like to know if there is a way to build a self-contained ejabberd installation (a single Linux executable containing an Erlang distribution and the ejabberd server itself).

If that's not a possibility, what is the recommended way of deploying ejabberd in production? I want to use a continuous integration server like bamboo to handle our builds.

Thanks in advance,

Santiago Ignacio Poli
Java Developer  <at> etermax

ejabberd mailing list
ejabberd <at>
ricky gutierrez | 21 Apr 17:11 2015


Hi list, I wanted to ask if anyone on the list has ejabberd monitoring
with nagios?, if you have some specific plugin for this task?