function milter_greylist() { $save = false; if (!is_array($GLOBALS["WHITELISTED"])) { return null; } $mi = new milter_greylist(); $whitelisted = $mi->GetWhiteListed(); if ($GLOBALS["VERBOSE"]) { echo "whitelisted=" . count($whitelisted) . "\n"; } while (list($num, $ligne) = each($GLOBALS["WHITELISTED"])) { if ($GLOBALS["VERBOSE"]) { echo "whitelisted[{$num}]=" . $whitelisted[$num] . "\n"; } if (!$whitelisted[$num]) { if ($GLOBALS["VERBOSE"]) { echo "insert new milter-greylist rule for {$ligne}\n"; } $mi->acl[] = "acl whitelist addr {$num} # PostfixAutoBlockWhiteList"; $save = true; } else { if ($GLOBALS["VERBOSE"]) { echo "Already inserted {$ligne}\n"; } } } if ($save) { $mi->SaveToLdap(); } }