summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6a8b6c2)
raw | patch | inline | side by side (parent: 6a8b6c2)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 17 Oct 2006 09:25:07 +0000 (09:25 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 17 Oct 2006 09:25:07 +0000 (09:25 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4889 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_mail-methods-kolab.inc | patch | blob | history |
index 4ebe586df96b254f9d148ab0dd29922667a52322..0d51b2d23ccae8f30d98d33d0dc4d0cb4151f4c9 100644 (file)
$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)
{
}