From 6cd6e23d05122acac3b3e678c02f2f1643076dd1 Mon Sep 17 00:00:00 2001 From: cajus Date: Tue, 17 Oct 2006 09:25:07 +0000 Subject: [PATCH] Added missing data git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4889 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_mail-methods-kolab.inc | 45 ++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/include/class_mail-methods-kolab.inc b/include/class_mail-methods-kolab.inc index 4ebe586df..0d51b2d23 100644 --- a/include/class_mail-methods-kolab.inc +++ b/include/class_mail-methods-kolab.inc @@ -35,6 +35,51 @@ class mailMethodKolab extends mailMethodCyrus $this->config= $config->data['SERVERS']['IMAP']; } + /* return all folders of the users mailbox*/ + 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); + } + + + + function updateMailbox($folder) { } -- 2.30.2