Page 1 of 1

[SOLVED] Rate limit private messages to specific user per sender base

Posted: Sat Jan 11, 2025 2:36 pm
by R4tt
I just checked the https://www.unrealircd.org/docs/Anti-flood_settings but couldn't find an option to rate limit private messages to a specific user on user base. Looks like if I use private-privmsg as target-flood the limit goes for all received messages by that target instead counting on sender base?

Example. Let's say I've a bot who receive private commands by different people and one person start sending a lot of commands/private messages in a short period of time. Is there a possibility to just rate limit the sending person?

Re: Rate limit private messages to specific user per sender base

Posted: Sun Jan 12, 2025 1:38 pm
by Valware
Hi R4tt.
In short, no, you cannot rate-limit a specific person using the server about targetted messages after the fact using automation, however you can use Security Groups in your unrealircd.conf (as mentioned on that page) to define some kind of criteria which matches certain users which will always implement your chosen rate limit.
I would say that in the case of IRC bots, your IRC bot should be implementing its own rate-limit and any overrides to the limitations instead of relying on the server.

Re: Rate limit private messages to specific user per sender base

Posted: Sun Jan 12, 2025 5:00 pm
by R4tt
Hi Valware,

thanks for your reply.

I don't understand how Security Groups could be help in this case. I want protect specific targets (a bot in this case) for receiving to many messages. Such messages can sent from anybody, including trusted users (i.e. misconfigured scripts/tools). So trusting doesn't help here.

Yes, implementing rate/flood limit stuff directly into the bot is always a possibility. But I thought it would be better to handle such stuff a layer before the bot. Furthermore, that could be helpful for other bots/services too. That was my idea behind this question.

Maybe it's an idea to add a module for such cases. I will evaluate this later. Just wanted to be sure, I'm not missing something, before I implement anything, and there were in-build stuff for that already.

Re: Rate limit private messages to specific user per sender base

Posted: Sun Jan 12, 2025 5:52 pm
by Valware
Indeed, there are certain things to take into consideration, such as what should happen when there are too many messages from a user? Should you discard it, delay it, report it or something else? How can you automate an intelligence of the importance of the message aimed at the bot? I think in any case it's probably a good idea for the server to leave the bot in charge of choosing how it should deal with those messages and so, in my opinion, making something that could be used for other targets too seems like moving individual controls away from the individuals and trying to granulate them further up the line seems like it doesn't add much. I think such a layer could cause as much problems as it solves, personally, and doesn't sound a right fit for something server-side to me.