diff --git a/plugins/vacation_sieve/transfer/local.php b/plugins/vacation_sieve/transfer/local.php index 01562c8..ac3f632 100644 --- a/plugins/vacation_sieve/transfer/local.php +++ b/plugins/vacation_sieve/transfer/local.php @@ -24,7 +24,7 @@ public function SaveScript($path,$script) # Create the folder if not exists if ( !is_dir($folder) ) - $try = @mkdir($folder,true); + $try = @mkdir($folder,0755,true); if ( !$try ) { @@ -43,8 +43,16 @@ public function SaveScript($path,$script) } # Compile the script - if ( $success ) - $success = (system("$this->params['sievecbin'] $path") == 0); + if ( $success && $this->params['sievecbin'] != '' ) + { + $output = system($this->params['sievecbin'] . " $path 2>&1", $rc); + $success = ($rc == 0); + if ( !$success ) + { + $msg = sprintf('Cannot execute "%s" to compile the script: %s', $this->params['sievecbin'], $output); + throw new Exception($msg); + } + } return $success; }