mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2024-12-14 10:52:49 +02:00
rspamd: disable greylisting for forwarding hosts
This commit is contained in:
parent
33b0167bcc
commit
a4ccd780c6
@ -28,7 +28,8 @@ function in_net($addr, $net) {
|
||||
return substr($addr_bin, 0, $mask) == substr($net_bin, 0, $mask);
|
||||
}
|
||||
|
||||
try {
|
||||
if (isset($_GET['host'])) {
|
||||
try {
|
||||
foreach ($redis->hGetAll('WHITELISTED_FWD_HOST') as $host => $source) {
|
||||
if (in_net($_GET['host'], $host)) {
|
||||
echo '200 PERMIT';
|
||||
@ -36,9 +37,19 @@ try {
|
||||
}
|
||||
}
|
||||
echo '200 DUNNO';
|
||||
}
|
||||
catch (RedisException $e) {
|
||||
}
|
||||
catch (RedisException $e) {
|
||||
echo '200 DUNNO';
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
foreach ($redis->hGetAll('WHITELISTED_FWD_HOST') as $host => $source) {
|
||||
echo $host . "\n";
|
||||
}
|
||||
}
|
||||
catch (RedisException $e) {
|
||||
exit;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
1
data/conf/rspamd/local.d/greylist.conf
Normal file
1
data/conf/rspamd/local.d/greylist.conf
Normal file
@ -0,0 +1 @@
|
||||
whitelisted_ip = "http://172.22.1.251:8081/forwardinghosts.php";
|
Loading…
Reference in New Issue
Block a user