Comparison

mod_firewall/README.markdown @ 2096:b75d29a162cd

mod_firewall: README: Document chains
author Matthew Wild <mwild1@gmail.com>
date Wed, 16 Mar 2016 12:43:17 +0000
parent 2095:3b4a6d255d7a
child 2102:2c225b4b93d2
comparison
equal deleted inserted replaced
2095:3b4a6d255d7a 2096:b75d29a162cd
320 320
321 # Log all stanzas to user@example.com: 321 # Log all stanzas to user@example.com:
322 TO: user@example.com 322 TO: user@example.com
323 LOG=[debug] User received: $(stanza) 323 LOG=[debug] User received: $(stanza)
324 324
325 Chains
326 ------
327
328 Rules are grouped into "chains", which are injected at particular points in Prosody's routing code.
329
330 Available chains are:
331
332 Chain Description
333 -------------- -------------------------------------------------------------------------------------------
334 deliver Applies to stanzas delivered to local recipients (regardless of the stanza's origin)
335 deliver_remote Applies to stanzas delivered to remote recipients (just before they leave the local server)
336 preroute Applies to incoming stanzas from local users, before any routing rules are applied
337
338 By default, if no chain is specified, rules are put into the 'deliver' chain.
339
340 Example of chain use:
341
342 # example.com's firewall script
343
344 # This line is optional, because 'deliver' is the default chain anyway:
345 ::deliver
346
347 # This rule matches any stanzas delivered to our local user bob:
348 TO: bob@example.com
349 DROP.
350
351 # Oops! This rule will never match, because alice is not a local user,
352 # and only stanzas to local users go through the 'deliver' chain:
353 TO: alice@remote.example.com
354 DROP.
355
356 # Create a 'preroute' chain of rules:
357 ::preroute
358 # These rules are matched for outgoing stanzas from local clients
359
360 # This will match any stanzas sent to alice from a local user:
361 TO: alice@remote.example.com
362 DROP.