# HG changeset patch # User MWild1@gmail.com # Date 1365167413 0 # Node ID b33e70726d6ae175fba3cf7806660a5710d177c8 # Parent 225827f3940e4dce95f492bdb90d1d3663fe53b2 Describe Lua pattern-matching capabilities in JID matching diff -r 225827f3940e -r b33e70726d6a mod_firewall.wiki --- a/mod_firewall.wiki Fri Apr 05 12:00:12 2013 +0000 +++ b/mod_firewall.wiki Fri Apr 05 13:10:13 2013 +0000 @@ -120,6 +120,13 @@ FROM: admin@<*.example.com> }}} +You can also use [http://www.lua.org/manual/5.1/manual.html#5.4.1 Lua's pattern matching] for more powerful matching abilities. Patterns are a lightweight regular-expression alternative. Simply contain the pattern in double angle brackets. The pattern is automatically anchored at the start and end (so it must match the entire portion of the JID). + +{{{ +# Match admin@example.com, and admin1@example.com, etc. +FROM: <>@example.com +}}} + *Note:* It is important to know that 'example.com' is a valid JID on its own, and does *not* match 'user@example.com'. To perform domain whitelists or blacklists, use Zones. *Note:* Some chains execute before Prosody has performed any normalisation or validity checks on the to/from JIDs on an incoming stanza. It is not advisable to perform access control or similar rules on JIDs in these chains (see the chain documentation for more info).