2018-01-16 19:57:27 +02:00
|
|
|
rules {
|
2018-12-15 22:23:42 +02:00
|
|
|
QUARANTINE {
|
|
|
|
backend = "http";
|
|
|
|
url = "http://nginx:9081/pipe.php";
|
2019-10-10 12:38:24 +02:00
|
|
|
selector = "reject_no_global_bl";
|
2018-12-15 22:23:42 +02:00
|
|
|
formatter = "default";
|
|
|
|
meta_headers = true;
|
|
|
|
}
|
|
|
|
RLINFO {
|
|
|
|
backend = "http";
|
|
|
|
url = "http://nginx:9081/pipe_rl.php";
|
|
|
|
selector = "ratelimited";
|
|
|
|
formatter = "json";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
custom_select {
|
|
|
|
ratelimited = <<EOD
|
|
|
|
return function(task)
|
|
|
|
local ratelimited = task:get_symbol("RATELIMITED")
|
|
|
|
if ratelimited then
|
|
|
|
return true
|
|
|
|
end
|
2019-05-01 22:50:38 +02:00
|
|
|
return false
|
2018-12-15 22:23:42 +02:00
|
|
|
end
|
2019-10-10 12:38:24 +02:00
|
|
|
EOD;
|
|
|
|
reject_no_global_bl = <<EOD
|
|
|
|
return function(task)
|
|
|
|
if not task:has_symbol('GLOBAL_SMTP_FROM_BL') and not task:has_symbol('GLOBAL_MIME_FROM_BL') then
|
|
|
|
local action = task:get_metric_action('default')
|
|
|
|
return (action == 'reject')
|
|
|
|
end
|
|
|
|
return false
|
|
|
|
end
|
2018-12-15 22:23:42 +02:00
|
|
|
EOD;
|
2018-01-16 19:57:27 +02:00
|
|
|
}
|