/** * Generates the procmail script to handle mail forwards. * * @param Ingo_Rule $rule Rule object. */ protected function _generateForward(Ingo_Rule $rule) { if (!count($rule)) { return; } $this->_addItem(Ingo::RULE_FORWARD, new Ingo_Script_Procmail_Comment(_("Forwards"), $rule->disable, true)); $recipe = new Ingo_Script_Procmail_Recipe(array('action' => 'Ingo_Rule_System_Forward', 'action-value' => $rule->addresses, 'disable' => $rule->disable), $this->_params); if ($rule->keep) { $recipe->addFlag('c'); } $this->_addItem(Ingo::RULE_FORWARD, $recipe); }
/** * Generates the procmail script to handle mail forwards. * * @param boolean $disable Disable forwarding? */ public function generateForward($disable = false) { $forward = $this->_params['storage']->retrieve(Ingo_Storage::ACTION_FORWARD); $addresses = $forward->getForwardAddresses(); if (!empty($addresses)) { $this->_addItem(Ingo::RULE_FORWARD, new Ingo_Script_Procmail_Comment(_("Forwards"), $disable, true)); $params = array('action' => Ingo_Storage::ACTION_FORWARD, 'action-value' => $addresses, 'disable' => $disable); $recipe = new Ingo_Script_Procmail_Recipe($params, $this->_params); if ($forward->getForwardKeep()) { $recipe->addFlag('c'); } $this->_addItem(Ingo::RULE_FORWARD, $recipe); } }