Add multimap and forced actions for forwarded_hosts, removed from settings

This commit is contained in:
andryyy
2017-05-08 23:09:21 +02:00
parent 5861bec0c3
commit d64ed65575
4 changed files with 50 additions and 101 deletions

View File

@@ -31,67 +31,7 @@ catch (PDOException $e) {
?>
settings {
/*
// Start whitelist for forwarding hosts
*/
<?php
try {
$stmt = $pdo->query("SELECT `host` FROM `forwarding_hosts` WHERE `filter_spam` = 1");
$rows = $stmt->fetchAll(PDO::FETCH_COLUMN);
}
catch (PDOException $e) {
$rows = array();
}
if (!empty($rows)) {
?>
whitelist_forwarding_hosts_with_spam_filter {
priority = high;
<?php
foreach ($rows as $host):
?>
ip = "<?=$host;?>";
<?php
endforeach;
?>
apply "default" {
actions {
reject = 999.9;
greylist = 999.8;
}
}
symbols [
"WHITELIST_FORWARDING_HOST"
]
}
<?php
}
try {
$stmt = $pdo->query("SELECT `host` FROM `forwarding_hosts` WHERE `filter_spam` = 0");
$rows = $stmt->fetchAll(PDO::FETCH_COLUMN);
}
catch (PDOException $e) {
$rows = array();
}
if (!empty($rows)) {
?>
whitelist_forwarding_hosts {
priority = high;
<?php
foreach ($rows as $host):
?>
ip = "<?=$host;?>";
<?php
endforeach;
?>
want_spam = yes;
}
<?php
}
/*
// Start custom scores for users