mod_firewall pattern case sensitivity

4 views
Skip to first unread message

Tom

unread,
Mar 21, 2021, 2:20:16 AM3/21/21
to Prosody IM Users Group, Prosody IM Developers Group
In mod_firewall, is there a way when say, the filtering for badwords
example (https://modules.prosody.im/mod_firewall.html)

># Define a search location called 'body' which fetches the text of the
>'body' element %SEARCH body: body#
># Define a pattern called 'word' which matches any sequence of letters
>%PATTERN word: [A-Za-z]+
># Finally, we also need our list of "bad" words:
>%LIST badwords: file:/etc/prosody/bad_words.txt
>
># Now we can use these to SCAN incoming stanzas
># If it finds a match, bounce the stanza
>SCAN: body for word in badwords
>BOUNCE=policy-violation (This word is not allowed!)


to convert to lowercase BEFORE comparing with the list, that way
you don't need to have every single capitalization variation of a word
in your badwords.txt; Or for my usecase have every single case
variation of a known spammer URL in my spamurls.txt list to DROP.?
Reply all
Reply to author
Forward
0 new messages