Mercurial > prosody-wiki
changeset 336:b33e70726d6a
Describe Lua pattern-matching capabilities in JID matching
author | MWild1@gmail.com |
---|---|
date | Fri, 05 Apr 2013 13:10:13 +0000 |
parents | 225827f3940e |
children | da79793316ff |
files | mod_firewall.wiki |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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: <<admin%d*>>@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).