Code

Moved headers to etc
[gosa.git] / gosa-plugins / mail / personal / mail / class_mail-methods-cyrus.inc
index 6bfde61c709364bea1e9103c39ec6d025e9c2ca8..e054fa29ef85ecd45e0456e9e1a40e4eb6127e78 100644 (file)
@@ -434,6 +434,21 @@ class mailMethodCyrus extends mailMethod{
   {
     mailMethod::saveSieveSettings();
 
+    // Check file integrity 
+    $files = array();
+    foreach(array("sieve-header.txt","sieve-spam.txt","sieve-mailsize.txt","sieve-vacation.txt","sieve-discard.txt") as $file){
+      if(!file_exists(CONFIG_DIR."/".$file) || ! is_readable(CONFIG_DIR."/".$file)){
+        $files[] = CONFIG_DIR."/".$file;
+        @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__ , CONFIG_DIR."/".$file,
+            "<b>Sieve template missing, please locate and move the template file: </b>");
+      }
+    }
+    if(count($files)){
+      $msg = sprintf(_("File '%s' does not exist!"),implode($files,", "));
+      $msg .= "&nbsp;"._("The sieve script may not be written correctly.");
+      msg_dialog::display(_("Warning"),$msg,WARNING_DIALOG);
+    }
+
     /* Map attribute from parent class 
      */
     $mail = $this->parent->mail;
@@ -503,6 +518,7 @@ class mailMethodCyrus extends mailMethod{
       Build up new sieve script here.
      *****/
 
+
     /* Only create a new one, if it is not empty */
     $script= "";
     if (is_integer(strpos($gosaMailDeliveryMode, "R")) ||