summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a299349)
raw | patch | inline | side by side (parent: a299349)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 23 Oct 2006 03:51:08 +0000 (03:51 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 23 Oct 2006 03:51:08 +0000 (03:51 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4912 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_mail-methods-cyrus.inc | patch | blob | history | |
include/class_mail-methods-kolab.inc | patch | blob | history |
index 1c361877b8e18009fb6074399c9644ef078d8b52..18e55fa6d2810d93dba2bdddaa582aa711c49b60 100644 (file)
var $mbox= "-";
var $config;
var $gosaMailServer= "";
+var $uattrib= "uid";
function mailMethodCyrus($config)
{
}
}
}elseif(!$quota_value){
-
/* If there is no quota defined for this account, the function imap_get_quota returns false. */
return(array("quotaUsage"=>"","gosaMailQuota"=>""));
}
return ($result);
}
+
+ /* return all folders of the users mailbox*/
function getMailboxList($folder, $uid= "")
{
- /* Initialize depending on group or user mode */
- if ($uid != ""){
- $result= array("INBOX");
- } else {
- $result= array();
+ 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];
- $list = imap_listmailbox($this->mbox, $cfg["connect"], $folder.".*");
+
+ /* 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){
- $result[]=preg_replace ("/.*user\.".$uid."\./",
- "INBOX.", imap_utf7_decode ($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)
{
/* Check if mailbox exists */
index 0d51b2d23ccae8f30d98d33d0dc4d0cb4151f4c9..0cd0e15be64829935b1086e24253cfb146265ae5 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)
{
}
return (TRUE);
}
- function deleteMailbox($folder)
- {
- return (TRUE);
- }
-
-
/* Get quota and divide it by 1024, because in gosa we display in MB
but we get Kb */
function getQuota($folder)
{
$result= array('quotaUsage' => '', 'gosaMailQuota' => '');
+ /* Only use lower case folder names, if folder name is like "@domain.com" */
+ if(preg_match("/@/",$folder)){
+ $folder = strtolower($folder);
+ }
+
error_reporting(0);
/* Load quota settings */
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 ?*/
if(get_class($mailObject) == "mailgroup"){
- $mailObject->uid = "shared.".$mailObject->uid."@".preg_replace("/^.*@/","",$mailObject->mail);
+ $mailObject->uid = "shared.".$mailObject->uid."@".preg_replace("/^.*@/","",$mailObject->mail);
}
/* Convert attributes and objectClasses */
/* Only add kolab delete Flag in case of an user.mailAccount */
if(!in_array("posixGroup", $mailObject->attrs['objectClass'])){
$mailObject->attrs['kolabDeleteFlag']= preg_replace('%imap://%', '', $mailObject->gosaMailServer);
+ }else{
+ /* 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);
+
}
}