Author: Brent J. Nordquist (bjn@horde.org)
Author: Jan Schneider (jan@horde.org)
Exemple #1
0
 /**
  * Constructor.
  *
  * @param array $params  A hash containing parameters needed.
  */
 public function __construct($params = array())
 {
     parent::__construct($params);
     // Bug #10113: Need to explicitly define these variables instead of
     // relying on system defaults.
     if ($this->_params['path_style'] == 'maildir') {
         if (!isset($this->_params['variables']['DEFAULT'])) {
             $this->_params['variables']['DEFAULT'] = '$HOME/Maildir/';
         }
         if (!isset($this->_params['variables']['MAILDIR'])) {
             $this->_params['variables']['MAILDIR'] = '$HOME/Maildir';
         }
     }
 }
Exemple #2
0
 /**
  * Generates the scripts to do the filtering specified in the rules.
  *
  * @return array  The scripts.
  */
 public function generate()
 {
     if (!$this->_generated) {
         $this->_generate();
         $this->_generated = true;
     }
     /* Build a list of required sieve extensions. */
     $requires = array();
     foreach ($this->_recipes as $item) {
         $rule = isset($this->_params['transport'][$item['rule']]) ? $item['rule'] : Ingo::RULE_ALL;
         if (!isset($requires[$rule])) {
             $requires[$rule] = array();
         }
         $requires[$rule] = array_merge($requires[$rule], $item['object']->requires());
     }
     foreach ($requires as $rule => $require) {
         $this->_insertItem($rule, new Ingo_Script_Sieve_Require(array_unique($require)), null, 1);
     }
     return parent::generate();
 }