Merge pull request #256 from mkuron/forwardinghosts

Optionally enable spam filter for forwarding hosts
This commit is contained in:
André Peters
2017-05-08 19:00:42 +02:00
committed by GitHub
6 changed files with 54 additions and 13 deletions

View File

@@ -31,19 +31,52 @@ catch (PDOException $e) {
?>
settings {
<?php
/*
// Start whitelist for forwarding hosts
*/
<?php
try {
$stmt = $pdo->query("SELECT `host` FROM `forwarding_hosts`");
$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 {