Project

General

Profile

What is the max length of a message?

Mauricio Giacomello
Added over 1 year ago

Hey guys,

here in the company we're developing a chat application and one of our requirements is to limit the size of a message to a certain amount of characters.

We're wondering if Tigase Server & Tigase Message Archiving have a limit of message length they can handle. We're using SQL Server and both latests Tigase/MA by the way.

Thanks in advance,

Mauricio Giacomello.


Replies (10)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc Tigase team member over 1 year ago

There is currently no limit on the message size. There are however, several limits on the Stanza which is sent through the server. They all can be adjusted. One of them limits number of characters sent as CData within any XML element. So this could be, in theory used as the message size limit. It is currently set to 1,048,576 characters, however, you have to remember that if you change it, it will affect all XML data sent through the server not just messages.

We could add some message limiting logic but then, there is a question, what should happen if the limit is exceeded? Cut the message, reject the message, disconnect user?

Added by Mauricio Giacomello over 1 year ago

Right. Got the point! We'll go ahead and set a limit only in the front-end side, unfortunately.

Thanks for the quick response,

Best regards.

Mauricio Giacomello.

Added by Igor Khomenko about 1 year ago

It would be greate if it will be possible to limit message.body CDATA because it's kind of the most popular case how people can spam server.

if the limit is exceeded then a reject message can be sent back

Added by Wojciech Kapcia Tigase team member about 1 year ago

Igor, we are currently working on smarter SPAM filters so I'm not sure that this particular feature will be needed.

Added by Igor Khomenko 4 months ago

Hi Wojciech,

could you please provide more details here regarding SPAM component with doc links? will it be released as a part of Tigase 7.2 ?

Added by Wojciech Kapcia Tigase team member 4 months ago

There won't be tigase 7.2 - we will release this codebase as Tigase XMPP Server 8.0.0 and anti-spam functionality is already included in the nightly binaries. You can check it's documentation here: http://docs.tigase.org/tigase-spam/snapshot/Tigase_SPAM_Guide/html/

Added by Igor Khomenko 3 months ago

There are however, several limits on the Stanza which is sent through the server. They all can be adjusted. One of them limits number of characters sent as CData within any XML element.

could you please assist which config parameter is used for this

I found this page which says "These values may be changed." but does not provide any guides how to do it
http://docs.tigase.org/tigase-server/7.1.1/Development_Guide/webhelp/stanzaLimitations.html

Added by Wojciech Kapcia Tigase team member 3 months ago

Please take a look at --elements-number-limit

Added by Igor Khomenko 3 months ago

Thanks Wojciech, good to know

One more questions - from my understanding we are still able to 'hack' a server, for example by sending too big single element, e.g message.body.

We can limit --elements-number-limit to 1 but still can send too big CDATA of a single element

Is there a way to limit CDATA ?

Added by Wojciech Kapcia Tigase team member 3 months ago

Currently there is no such limitations (on per element basis) but you can adjust --cm-traffic-throttling settings so particular user won't be able to transfer more data than the limit.

    (1-10/10)