From 4dc57563fe4d553911e9f2b5ac9e01484e832d5d Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 17 Oct 2006 07:58:07 +0000 Subject: [PATCH] Added seperate git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4887 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_mail-methods-kolab.inc | 42 ++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/include/class_mail-methods-kolab.inc b/include/class_mail-methods-kolab.inc index 2dc40c17f..e023cc042 100644 --- a/include/class_mail-methods-kolab.inc +++ b/include/class_mail-methods-kolab.inc @@ -49,6 +49,48 @@ class mailMethodKolab extends mailMethodCyrus return (TRUE); } + function getMailboxList($folder, $uid= "") + { + global $config; + $result = array(); + + /* Get domain an mail address if uid is an mail address */ + $domain = ""; + if(preg_match("/@/",$folder)){ + $domain = preg_replace("/^.*@/","",$folder); + $folder = preg_replace("/@.*$/","",$folder); + } + + /* Get list of mailboxes for combo box */ + $cfg= $this->config[$this->gosaMailServer]; + + /* Create search pattern + (user/kekse*@domain.de + user.kekse*@domain.de + user.kekse* ) + depending on given folder name) */ + $q = $folder."*@".$domain; + $list = imap_listmailbox($this->mbox, $cfg["connect"], $q); + + /* Create list of returned folder names */ + if (is_array($list)){ + foreach ($list as $val){ + + /* Cut domain name */ + $val = preg_replace("/@.*$/","",$val); + $result[]=preg_replace ("/^.*".normalizePreg($folder)."/","INBOX", imap_utf7_decode ($val)); + } + } + + /* Append "INBOX" to the folder array if result is empty and request comes from user dialog */ + if(empty($result) && !empty($uid)){ + $result[] = "INBOX"; + } + + return ($result); + } + + /* Get quota and divide it by 1024, because in gosa we display in MB but we get Kb */ -- 2.30.2