1 local st
= require
"util.stanza";
3 local whitelist
= module
:get_option_inherited_set("s2s_whitelist", {});
5 module
:hook("route/remote", function (event
)
6 if not whitelist
:contains(event
.to_host
) then
7 module
:send(st
.error_reply(event
.stanza
, "cancel", "not-allowed", "Communication with this domain is restricted"));
12 module
:hook("s2s-stream-features", function (event
)
13 if not whitelist
:contains(event
.origin
.from_host
) then
15 condition
= "policy-violation";
16 text
= "Communication with this domain is restricted";