Code

Updated mail box folder detection
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 18 Dec 2008 09:59:57 +0000 (09:59 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 18 Dec 2008 09:59:57 +0000 (09:59 +0000)
- A search for the account folders of "user/tester@gonicus.de" also returned folders of "user/tester2@gonicus.de"

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

gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc

index 94c7ccc18c43f35441aed0760275dc04102a306a..9152a660b5e8844023079704e6b8d683b3f26b23 100644 (file)
@@ -292,10 +292,10 @@ class mailMethodCyrus extends mailMethod{
        And prepare replacements 
      */ 
     if(preg_match("/\@/",$this->account_id)){
-      $search = preg_replace("/\@/","*@",$this->account_id);
+      $search = preg_replace("/\@/","/*@",$this->account_id);
       $with_domain = TRUE;
     }else{
-      $search = $this->account_id."*";
+      $search = $this->account_id."/*";
       $with_domain = FALSE;
     }
     $folder = $this->account_id;
@@ -304,7 +304,8 @@ class mailMethodCyrus extends mailMethod{
     }
 
     /* Contact imap server */
-    $list = @imap_listmailbox($this->imap_handle, $cfg["connect"], $search);
+    $list = @imap_listmailbox($this->imap_handle, $cfg["connect"], $this->account_id);
+    $list = array_merge($list,@imap_listmailbox($this->imap_handle, $cfg["connect"], $search));
 
     /* Create list of returned folder names */
     if (is_array($list)){