axl_bool valvula_address_rule_match ( ValvulaCtx ctx,
const char *  rule,
const char *  address 
)

Allows to check if the provided address matches the provided rule.

Parameters
ctxThe context where the operation will take place.
ruleThe rule that is being attempted to match.
addressThe address that is being matched.

Examples:

1 rule=NULL address=anything MATCH
2 rule='' address=anything MATCH
3 rule=test.com address=test@test.com MATCH
4 rule=test2.com address=test@test.com NOT MATCH
5 rule=test.com address=test.com MATCH
6 rule=test@test.com address=test@test.com MATCH -- match by domain
7 rule=test2@test.com address=test@test.com NOT MATCH
8 rule=test@ address=test@test.com MATCH -- match by local-part
9 rule=com address=test@test.com MATCH -- match TLD .com with @test.com
Returns
The function returns axl_true in the case everything matches, otherwise axl_false is reported. The function also returns axl_false every time address is NULL and/or ctx is NULL.

References valvula_get_domain(), valvula_get_local_part(), and valvula_get_tld_extension().