Code

Updated mailAccount.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 9 Dec 2008 07:32:45 +0000 (07:32 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 9 Dec 2008 07:32:45 +0000 (07:32 +0000)
-Do not write sieve settings, if the mail account wasn't created yet.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13193 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/mail/personal/mail/class_mailAccount.inc

index a24f75d00d087dab450ac56dcdbd741007e4a3e5..2a549a1f52ba1dae0f231cf20cefd70712d77ec4 100644 (file)
@@ -71,7 +71,6 @@ class mailAccount extends plugin
   var $mailMethod      = NULL;
   var $MailDomain      = "";
   var $sieveManagementUsed = FALSE;
-  var $multiple_support = FALSE;
   var $vacationTemplates = array();
   var $sieve_management = NULL;
   var $forward_dialog = FALSE;
@@ -88,6 +87,7 @@ class mailAccount extends plugin
       "gosaMailForwardingAddress");
   var $objectclasses= array("gosaMailAccount");
 
+  var $multiple_support = TRUE;
 
   /*! \brief  Initialize the mailAccount 
    */
@@ -940,8 +940,18 @@ class mailAccount extends plugin
         }
 
         if (!is_integer(strpos($this->gosaMailDeliveryMode, "C"))){
-          if(!$this->mailMethod->saveSieveSettings()){
-            msg_dialog::display(_("Mail error"), $this->mailMethod->get_error(), ERROR_DIALOG);
+
+
+          /* Do not write sieve settings if this account is new and 
+             doesn't seem to exist.
+           */
+          if(!$this->initially_was_account && !$this->mailMethod->account_exists()){
+            @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__,
+                "Skipping sieve settings, the account doesn't seem to be created already.</b>","");
+          }else{
+            if(!$this->mailMethod->saveSieveSettings()){
+              msg_dialog::display(_("Mail error"), $this->mailMethod->get_error(), ERROR_DIALOG);
+            }
           }
         }else{