function Philter() {
$this->config = array(
'db' => array('host', 'name', 'user', 'pwd', 'link'),
- 'path' => array('procmail', 'spool'),
+ 'path' => array('spool'),
'match_plugins' => array(),
'action_plugins' => array(),
'global_plugins' => array(),
}
/** function that writes the procmailrc.
+ * @param &$procmail the string containing the procmail filter
+ * @param $filename the base filename of the procmailrc filter
* @return true if all is ok
*/
- function write_procmailrc() {
- // TODO
+ function write_procmailrc(&$procmail, $filename) {
+ $file = $this->config['path']['spool']."/".$filename;
+ $f = fopen($file.".tmp", "w");
+ fwrite($f, $procmail, strlen($procmail));
+ fclose($f);
+ rename($file.".tmp", $file);
+ echo "<pre>\n";
+ echo $procmail;
+ echo "</pre>\n";
return true;
}