tbrehm
2009-07-21 9851f94ef7bc26a94022fa0ff6c3d4aca07aa4ea
Fixed: FS#806 - Mailfilter & Folders names w/ spaces
1 files modified
26 ■■■■■ changed files
interface/web/mail/mail_user_filter_edit.php 26 ●●●●● patch | view | raw | blame | history
interface/web/mail/mail_user_filter_edit.php
@@ -114,17 +114,26 @@
        $content = '';
        $content .= '### BEGIN FILTER_ID:'.$this->id."\n";
        
        if($this->dataRecord["active"] == 'y') {
        $TargetNoQuotes = $this->dataRecord["target"];
        $TargetQuotes = "\"$TargetNoQuotes\"";
        $TestChDirNoQuotes = '$DEFAULT/.'.$TargetNoQuotes;
        $TestChDirQuotes = "\"$TestChDirNoQuotes\"";
        $MailDirMakeNoQuotes = $TargetQuotes.' $DEFAULT';
        $EchoTargetFinal = $TargetNoQuotes;
        
            if($this->dataRecord["action"] == 'move') {
        
            $content .= "
`test -e ".'$DEFAULT/.'.$this->dataRecord["target"]."`
if ( ".'$RETURNCODE'." != 0 )
`test -e ".$TestChDirQuotes." && exit 1 || exit 0`
if ( ".'$RETURNCODE'." != 1 )
{
  `maildirmake -f ".$this->dataRecord["target"].' $DEFAULT'."`
  `chmod -R 0700 ".'$DEFAULT/'.$this->dataRecord["target"]."`
  `echo INBOX.".$this->dataRecord["target"]." >> ".'$DEFAULT'."/courierimapsubscribed`
    `maildirmake -f $MailDirMakeNoQuotes`
    `chmod -R 0700 ".$TestChDirQuotes."`
    `echo \"INBOX.$EchoTargetFinal\" >> ".'$DEFAULT'."/courierimapsubscribed`
}
";        
            }
@@ -147,7 +156,8 @@
            $content .= "exception {\n";
        
            if($this->dataRecord["action"] == 'move') {
                $content .= 'to $DEFAULT/.'.$this->dataRecord["target"]."/\n";
            $content .= 'ID' . "$this->id" . 'EndFolder = "$DEFAULT/.' . $this->dataRecord['target'] . '/"' . "\n";
            $content .= "to ". '$ID' . "$this->id" . 'EndFolder' . "\n";
            } else {
                $content .= "to /dev/null\n";
            }
@@ -155,7 +165,7 @@
            $content .= "}\n";
            $content .= "}\n";
        
        }
        //}
        
        $content .= '### END FILTER_ID:'.$this->id."\n";