comparison mod_firewall.wiki @ 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 ecf8bfe998ec
comparison
equal deleted inserted replaced
335:225827f3940e 336:b33e70726d6a
118 {{{ 118 {{{
119 # The user 'admin' on any subdomain of example.com 119 # The user 'admin' on any subdomain of example.com
120 FROM: admin@<*.example.com> 120 FROM: admin@<*.example.com>
121 }}} 121 }}}
122 122
123 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).
124
125 {{{
126 # Match admin@example.com, and admin1@example.com, etc.
127 FROM: <<admin%d*>>@example.com
128 }}}
129
123 *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. 130 *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.
124 131
125 *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). 132 *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).
126 133
127 == Actions == 134 == Actions ==