mod_firewall pattern case sensitivity

Skip to first unread message


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 (

># 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
0 new messages