Code

Updated groupMail
[gosa.git] / include / class_mail-methods-kolab.inc
index a4944df64636f187af39ad4da16f0a65d963c9ad..08280c188eae6ba4b0eb8ee4c33632ccbb6f1e2d 100644 (file)
@@ -35,8 +35,13 @@ class mailMethodKolab extends mailMethodCyrus
     /* Check if the mail account identification attribute
        is overridden in the configuration file
      */
-    if(isset($config->current['MAIL_ATTRIB'])){
-      $this->uattrib = $config->current['MAIL_ATTRIB'];
+    if(isset($config->current['MAIL_ATTRIB']) && !empty($config->current['MAIL_ATTRIB'])){
+      $new_uattrib= strtolower($config->current['MAIL_ATTRIB']);
+      if(in_array($new_uattrib,array("mail","uid"))){
+        $this->uattrib = $new_uattrib;
+      }else{
+        trigger_error(sprintf("Unsupported MAIL_ATTRIB in gosa configuration specified, use 'mail' or 'uid', instead of '%s'.",            $new_uattrib));
+      }
     }
 
     $this->config= $config->data['SERVERS']['IMAP'];
@@ -216,13 +221,13 @@ class mailMethodKolab extends mailMethodCyrus
         }
       }
  
-      /* Save shared folder target */
-      $mailObject->attrs['gosaSharedFolderTarget']= "kolab+shared.".$mailObject->mail;
-
       /* Kolab shared folder names are like ' shared.uid@server.de ' 
         So overwrite uid to match these folder names. Else we can't read quota settings etc. 
         #FIXME is there a better way to detect if it is 'shared.' or 'shared+' or 'kolab+shared.' or what ever ?*/
       $mailObject->uid = "shared.".$mailObject->uid."@".preg_replace("/^.*@/","",$mailObject->mail);
+
+      /* Save shared folder target */
+      $mailObject->attrs['gosaSharedFolderTarget']= "kolab+shared.".$mailObject->cn."@".preg_replace("/^.*@/","",$mailObject->mail); 
   
       /* Assign new acls */
       $mailObject->attrs['acl']= array();