}
function to_string() {
- return "";
+ $res = ":0 f\n"
+ . "|formail -I'X-Philter-Or'\n"
+ . "\n";
+
+ foreach($this->rules as $id=>$rule)
+ if($id)
+ $res .= $rule->to_string();
+
+ return $res;
}
function delete_rule($_rid) {
op_s.options[1] = new Option('"._i18n('3_not_contains')."',1,false,data[2]==1);
op_s.options[2] = new Option(' = ',2,false,data[2]==2);
op_s.options[3] = new Option(' != ',3,false,data[2]==3);
- op_s.options[4] = new Option(' >= ',4,false,data[2]==4);
- op_s.options[5] = new Option(' > ',5,false,data[2]==5);
- op_s.options[6] = new Option(' <= ',6,false,data[2]==6);
- op_s.options[7] = new Option(' < ',7,false,data[2]==7);
op_s.selectIndex = data[2];
Node.appendChild(document.createTextNode(' '));
Node.appendChild(txt_i);
}";
}
+
+ function to_string($_data) {
+ $res = trim($_data[1]).':';
+ switch($_data[2]) {
+ case 0: $res = "* ^$res.*{$_data[3]}\n"; break;
+ case 1: $res = "* !$res.*{$_data[3]}\n"; break;
+ case 2: $res = "* $res {$_data[3]}$\n"; break;
+ case 3: $res = "* !$res {$_data[3]}$\n"; break;
+ }
+ return $res;
+ }
}
/********************************************************************************
function to_string($_data) {
global $mail_pool;
- return "! ".$mail_pool->emails[$_data[1]]->email."\n";
+ return " :0 c\n"
+ . " ! ".$mail_pool->emails[$_data[1]]->email."\n\n";
}
}
op_s.options[1] = new Option('$_2_not_contains',1,false,data[2]==1);
op_s.options[2] = new Option(' = ',2,false,data[2]==2);
op_s.options[3] = new Option(' != ',3,false,data[2]==3);
- op_s.options[4] = new Option(' >= ',4,false,data[2]==4);
- op_s.options[5] = new Option(' > ',5,false,data[2]==5);
- op_s.options[6] = new Option(' <= ',6,false,data[2]==6);
- op_s.options[7] = new Option(' < ',7,false,data[2]==7);
op_s.selectIndex = data[2];
Node.appendChild(document.createTextNode(' '));
}
EOF;
}
+
+ function to_string($_data) {
+ switch($_data[1]) {
+ case 0: $res = '^TO'; break;
+ case 1: $res = '^Subject:'; break;
+ case 2: $res = '^From:'; break;
+ case 3: $res = '^To:'; break;
+ case 4: $res = '^Cc:'; break;
+ case 5: $res = '^Reply-To:'; break;
+ case 6: $res = '^Organization:'; break;
+ case 7: $res = '^List-Id:'; break;
+ case 8: $res = '^X-Mailing-List:'; break;
+ }
+ switch($_data[2]) {
+ case 0: $res = "* $res.*{$_data[3]}\n"; break;
+ case 1: $res = "* !$res.*{$_data[3]}\n"; break;
+ case 2: $res = "* $res {$_data[3]}$\n"; break;
+ case 3: $res = "* !$res {$_data[3]}$\n"; break;
+ }
+ return $res;
+ }
}
/********************************************************************************
function to_string() {
global $philter;
- $res = ($this->block ? ":0\n" : ":0 c\n");
- foreach($this->matches as $match)
- $res .= $philter->config['match_plugins'][$match[0]]->to_string($match);
+ $res = $this->block ? ":0\n" : ":0 c\n";
+
+ if($this->all) {
+ foreach($this->matches as $match)
+ $res .= $philter->config['match_plugins'][$match[0]]->to_string($match);
+ } else {
+ $i = 0; $res = '';
+ foreach($this->matches as $match) {
+ $res .= (empty($i) ? ":0 f\n" : ":0 fE");
+ $res .= $philter->config['match_plugins'][$match[0]]->to_string($match);
+ $res .= "| formail -I'X-Philter-Or: yes'\n";
+ $i++;
+ }
+
+ $res.= "\n"
+ . ":0 f\n"
+ . "* ^X-Philter-Or: yes\n"
+ . "| formail -I'X-Philter-Or'\n"
+ . "\n"
+ . ($this->block ? ":0\n" : ":0 c\n");
+ }
+
$res.= "{\n";
foreach($this->actions as $action)
- $res .= $philter->config['actioh_plugins'][$action[0]]->to_string($action);
- $res.= "}\n\n";
+ $res .= $philter->config['action_plugins'][$action[0]]->to_string($action);
+ $res.= " :0\n"
+ . " /dev/null\n"
+ . "}\n\n";
return $res;
}