Commit 11c8f36a authored by tbrehm's avatar tbrehm
Browse files

Fixed: FS#758 - disabling mail filter rules doesn't work

parent 1cbeab33
...@@ -114,7 +114,9 @@ class page_action extends tform_actions { ...@@ -114,7 +114,9 @@ class page_action extends tform_actions {
$content = ''; $content = '';
$content .= '### BEGIN FILTER_ID:'.$this->id."\n"; $content .= '### BEGIN FILTER_ID:'.$this->id."\n";
if($this->dataRecord["action"] == 'move') { if($this->dataRecord["active"] == 'y') {
if($this->dataRecord["action"] == 'move') {
$content .= " $content .= "
`test -e ".'$DEFAULT/.'.$this->dataRecord["target"]."` `test -e ".'$DEFAULT/.'.$this->dataRecord["target"]."`
...@@ -125,33 +127,35 @@ if ( ".'$RETURNCODE'." != 0 ) ...@@ -125,33 +127,35 @@ if ( ".'$RETURNCODE'." != 0 )
`echo INBOX.".$this->dataRecord["target"]." >> ".'$DEFAULT'."/courierimapsubscribed` `echo INBOX.".$this->dataRecord["target"]." >> ".'$DEFAULT'."/courierimapsubscribed`
} }
"; ";
} }
$content .= "if (/^".$this->dataRecord["source"].":"; $content .= "if (/^".$this->dataRecord["source"].":";
$searchterm = preg_quote($this->dataRecord["searchterm"]); $searchterm = preg_quote($this->dataRecord["searchterm"]);
if($this->dataRecord["op"] == 'contains') { if($this->dataRecord["op"] == 'contains') {
$content .= ".*".$searchterm."/:h)\n"; $content .= ".*".$searchterm."/:h)\n";
} elseif ($this->dataRecord["op"] == 'is') { } elseif ($this->dataRecord["op"] == 'is') {
$content .= $searchterm."$/:h)\n"; $content .= $searchterm."$/:h)\n";
} elseif ($this->dataRecord["op"] == 'begins') { } elseif ($this->dataRecord["op"] == 'begins') {
$content .= $searchterm."/:h)\n"; $content .= $searchterm."/:h)\n";
} elseif ($this->dataRecord["op"] == 'ends') { } elseif ($this->dataRecord["op"] == 'ends') {
$content .= ".*".$searchterm."$/:h)\n"; $content .= ".*".$searchterm."$/:h)\n";
} }
$content .= "{\n"; $content .= "{\n";
$content .= "exception {\n"; $content .= "exception {\n";
if($this->dataRecord["action"] == 'move') { if($this->dataRecord["action"] == 'move') {
$content .= 'to $DEFAULT/.'.$this->dataRecord["target"]."/\n"; $content .= 'to $DEFAULT/.'.$this->dataRecord["target"]."/\n";
} else { } else {
$content .= "to /dev/null\n"; $content .= "to /dev/null\n";
} }
$content .= "}\n"; $content .= "}\n";
$content .= "}\n"; $content .= "}\n";
}
$content .= '### END FILTER_ID:'.$this->id."\n"; $content .= '### END FILTER_ID:'.$this->id."\n";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment