[ejabberd] max_stanza_size not working in mod_http_bind?

Xia Qingran qingran.xia at gmail.com
Tue Apr 14 10:19:54 MSD 2009


2009/4/14 Xia Qingran <qingran.xia at gmail.com>:
>
>
> Sorry to give you reply so late. I was testing this for these days and
> found that the max_stanza_limit of c2s is not working because I can
> send even 5 times bigger length of message. I only take use of this to
> protect my ejabberd server against bad guys sending long and useless
> message.
>
> I took use of a simple python script to send message with assigned
> character numbe and all the sent messages are received by target user:
>
> import xmpp
> login = 'testtest8'
> pwd   = 'password'
> cnx = xmpp.Client('mydomain.org')
> cnx.connect(('127.0.0.1', 5222))
> cnx.auth(login, pwd, 'TEST')
> a = '1'
> cnx.send( xmpp.Message( "testtest1 at mydomain.org" ,a.zfill(4000) ) )
> cnx.disconnect()
>
>
> With Pidgin 2.5.2 and Gajim 0.12.1, I can also sent a message with
> about 5 times bigger than max_stanza_size.
>
> I installed ejabberd-2.0.5 with linux x86 32-bits installer and run it
> on ubuntu-8.10-i386 by my laptop.
> The contents of ejabberd.cfg are listed as follows:
> ==========================================
> {loglevel, 5}.
>
> {hosts, ["mydomain.org"]}.
>
> {listen,
>  [
>
>  {5222, ejabberd_c2s, [
>            {certfile, "/usr/local/ejabberd-2.0.4/conf/server.pem"}, starttls,
>            {access, c2s},
>            {shaper, c2s_shaper},
>            {max_stanza_size, 65536}

Sorry for this, I set the max_stanza_size to 2000, it is :

  {5222, ejabberd_c2s, [
                        {certfile,
"/usr/local/etc/ejabberd/xmppserver.pem"}, starttls,
                        {access, c2s},
                        {shaper, c2s_shaper},
                        {ip, {127, 0, 0, 1}},
                        {max_stanza_size, 2000}
                       ]},

>               ]},
>
>  {5280, ejabberd_http, [
>             http_bind,
>             web_admin
>            ]}
>  ]}.
>
>
> {auth_method, external}.
> {extauth_program, "/usr/local/bin/ejabberd_extauh.py"}.
>
> {odbc_server, {pgsql, "localhost", "ejabberd", "ejabberd", "ejabberd"}}.
> {odbc_pool_size, 5}.
>
> {pgsql_users_number_estimate, true}.
>
> {shaper, normal, {maxrate, 5000000}}.
>
>
> {shaper, fast, {maxrate, 50000000}}.
>
>
> {acl, admin, {user, "qingran", "mydomain.org"}}.
>
> {acl, local, {user_regexp, ""}}.
>
> {access, max_user_sessions, [{5, all}]}.
>
> {access, local, [{allow, local}]}.
>
> {access, c2s, [{deny, blocked},
>           {allow, all}]}.
>
> {access, c2s_shaper, [{none, admin},
>              {normal, all}]}.
>
> {access, s2s_shaper, [{deny, all}]}.
>
>
> {access, announce, [{allow, admin}]}.
>
> {access, configure, [{allow, admin}]}.
>
>
> {access, muc_admin, [{allow, admin}]}.
>
>
> {access, muc, [{allow, all}]}.
>
> {access, register, [{deny, all}]}.
>
>
> {access, pubsub_createnode, [{allow, all}]}.
>
> {language, "en"}.
>
>
> %%%   =======
> %%%   MODULES
>
> %%
> %% Modules enabled in all ejabberd virtual hosts.
> %%
> {modules,
>  [
>  {mod_adhoc,    []},
>  {mod_announce, [{access, announce}]}, % requires mod_adhoc
>  {mod_caps,     []},
>  {mod_configure,[]}, % requires mod_adhoc
>  {mod_disco,    []},
>
>  {mod_http_bind,[ {max_inactivity, 10} ]},
>
>  {mod_offline,  []},
>  {mod_privacy_odbc,  []},
>  {mod_private_odbc,  []},
>
>  {mod_pubsub,   [ % requires mod_caps
>          {access_createnode, pubsub_createnode},
>          {plugins, ["default", "pep"]}
>         ]},
>  {mod_roster_odbc,   []},
>
>  {mod_shared_roster,[]},
>
>  {mod_time,     []},
>  {mod_vcard_odbc,    []},
>  {mod_version,  []}
>  ]}.
>
> ===============================================================
>
> --
> 夏清然
> Xia Qingran
> qingran.xia at gmail.com
> Sent from Beijing, 11, China
> Vince Lombardi  - &quot;Show me a good loser, and I'll show you a
> loser.&quot; - http://www.brainyquote.com/quotes/authors/v/vince_lombardi.html
>



-- 
夏清然
Xia Qingran
qingran.xia at gmail.com
Sent from Beijing, 11, China
Vince Lombardi  - &quot;Show me a good loser, and I'll show you a
loser.&quot; - http://www.brainyquote.com/quotes/authors/v/vince_lombardi.html


More information about the ejabberd mailing list