/**
* Generates the procmail script to handle the whitelist specified in
* the rules.
*
* @param Ingo_Rule $rule Rule object.
*/
protected function _generateWhitelist(Ingo_Rule $rule)
{
if (!count($rule)) {
return;
}
$this->_addItem(Ingo::RULE_WHITELIST, new Ingo_Script_Procmail_Comment(_("Whitelisted Addresses"), $rule->disable, true));
foreach ($rule->addresses as $address) {
$recipe = new Ingo_Script_Procmail_Recipe(array('action' => 'Ingo_Rule_User_Keep', 'disable' => $rule->disable), $this->_params);
$recipe->addCondition(array('field' => 'From', 'value' => $address, 'match' => 'address'));
$this->_addItem(Ingo::RULE_WHITELIST, $recipe);
}
}