Spamfilter and \p script

If you have trouble on your server with spam, drones/zombies/bots or proxies

Moderator: Supporters

Post Reply
CrazyCat
Posts: 216
Joined: Thu Apr 28, 2005 1:05 pm
Location: France
Contact:

Spamfilter and \p script

Post by CrazyCat »

Hi there,
I had just tested this feature but seems to not working.
- PCRE2 version : 10.42 2022-12-11
- Spam filter: F regex cp warn 0 115 86400 Sorry_but_only_french_is_allowed CrazyCat!crazycat@netadmin \p{Arabic}

Test:

Code: Select all

<zeolien4679> test سلام
No warn, I got the line in my clients (the tester or my real one). I also tried a spamfilter action block with regex .*\p{Arabic}.* but same result.

I don't understand if I badly define my spamfilter or if I forget something
Syzop
UnrealIRCd head coder
Posts: 2117
Joined: Sat Mar 06, 2004 8:57 pm
Location: .nl
Contact:

Re: Spamfilter and \p script

Post by Syzop »

Since UnrealIRCd 6.0.7 this is supported. But, as mentioned in the the release notes, it requires the following to be present in the configuration file:

Code: Select all

set { spamfilter { utf8 yes; } }
This is an experimental feature, so let us know if things work OK for you. And then I don't mean a quick test with a few sentences (we can do that too), but if you successfully use it in production.. for a longer period.. without any crashes/hangs/issues. If we get multiple reports that it works well then we will make this the default probably. It's a nice feature, not just the \p but also the insensitive matching of accented chars.
CrazyCat
Posts: 216
Joined: Thu Apr 28, 2005 1:05 pm
Location: France
Contact:

Re: Spamfilter and \p script

Post by CrazyCat »

Oh, I didn't well read the notes.
But:
I've well changed the setting:

Code: Select all

Spamfilter: Recompiled 10 spamfilters due to set::spamfilter::utf8 change.
Then remove my filters and redo one of them:

Code: Select all

Spamfilter added: '\p{Arabic}' [type: regex] [targets: cp] [action: warn] [reason: Sorry but only french is allowed]
The test failed, no warn
Syzop
UnrealIRCd head coder
Posts: 2117
Joined: Sat Mar 06, 2004 8:57 pm
Location: .nl
Contact:

Re: Spamfilter and \p script

Post by Syzop »

Works OK here with:
SPAMFILTER add -regex cp warn 0 arabic_test \p{Arabic}

And then other person does this (NOT ircop):
PRIVMSG #test :test سلام
:maintest.test.net 659 user PRIVMSG :Command processed, but a copy has been sent to ircops for evaluation (anti-spam) purposes. [arabic test]

If it doesn't work for you then feel free to raise a bug at bugs.unrealircd.org. I don't really read the forum regularly, or at least not consistently, since it's for support and we already have great people who help out here (including you) :)
CrazyCat
Posts: 216
Joined: Thu Apr 28, 2005 1:05 pm
Location: France
Contact:

Re: Spamfilter and \p script

Post by CrazyCat »

I redo the test and it worked. I'm now using Unreal 6.1.0 so I had at least 1 restart, peharps did it help ?
BTW, it works, it's perfect. Thanx Syzop

Edit : in fact, the trouble came from my test: using "The lounge", characters are not detected. But using kiwiirc, it works. Can't understand why.
Syzop
UnrealIRCd head coder
Posts: 2117
Joined: Sat Mar 06, 2004 8:57 pm
Location: .nl
Contact:

Re: Spamfilter and \p script

Post by Syzop »

Hmm I have some doubts it is that, or at least i hope not, otherwise spammers should use The Lounge ;)
Maybe you have your the lounge IP exempt from spamfilter checks? Like an ELINE with 'F' or an except ban { } block with 'spamfilter' or 'all'. Or you are oper or target is oper, or spamfilter except target. Of course, if that theory is the case, then no spamfilter will be triggered at all (not only this one), so that is easy to test.
CrazyCat
Posts: 216
Joined: Thu Apr 28, 2005 1:05 pm
Location: France
Contact:

Re: Spamfilter and \p script

Post by CrazyCat »

Oh...
The Lounge (a private one only for testing) is installed on a server which also host one of my unrealircd, so its IP must be protected.

Stupid me :)
Post Reply