diff -r d4bc434a60a4 -r c6fd8975704b mod_firewall/conditions.lib.lua --- a/mod_firewall/conditions.lib.lua Sun Feb 19 21:08:30 2017 +0000 +++ b/mod_firewall/conditions.lib.lua Sun Feb 19 21:10:26 2017 +0000 @@ -252,4 +252,15 @@ return ("not not session.firewall_marked_"..idsafe(name)); end +-- CHECK LIST: spammers contains $<@from> +function condition_handlers.CHECK_LIST(list_condition) + local list_name, expr = list_condition:match("(%S+) contains (.+)$"); + if not list_name and expr then + error("Error parsing list check, syntax: LISTNAME contains EXPRESSION"); + end + local meta_deps = {}; + expr = meta(("%q"):format(expr), meta_deps); + return ("list_%s:contains(%s) == true"):format(list_name, expr), { "list:"..list_name, unpack(meta_deps) }; +end + return condition_handlers;