From: hickert Date: Wed, 10 Dec 2008 08:21:01 +0000 (+0000) Subject: Added mail domain detection to kolab 22 method X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=709b89c58f76cfd19af3ba40966a3d0fec363dd4;p=gosa.git Added mail domain detection to kolab 22 method git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13221 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/kolab/personal/mail/kolab/class_mail-methods-kolab22.inc b/gosa-plugins/kolab/personal/mail/kolab/class_mail-methods-kolab22.inc index 19835b188..a5760ed92 100644 --- a/gosa-plugins/kolab/personal/mail/kolab/class_mail-methods-kolab22.inc +++ b/gosa-plugins/kolab/personal/mail/kolab/class_mail-methods-kolab22.inc @@ -25,7 +25,27 @@ class mailMethodKolab22 extends mailMethodKolab */ public function getMailDomains() { - return(array("gonicus.de")); + $domains = array(); + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->config->current['BASE']); + $ldap->search("(&(objectClass=kolab)(k=kolab)(postfix-mydestination=*))",array("postfix-mydestination")); + + if($ldap->count() == 1){ + $attrs = $ldap->fetch(); + for($i=0; $i <$attrs['postfix-mydestination']['count']; $i ++ ){ + $domains[] = $attrs['postfix-mydestination'][$i]; + } + @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__, "Found: ".trim(implode($domains,", "),", ")."", + "Revceiving 'Mail domains for kolab22'."); + }elseif($ldap->count() == 0){ + @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__, "No domains found. Check k=kolab and postfix-mydestination", + "Revceiving 'Mail domains for kolab22'."); + }else{ + @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__, "Found more than one kolab configuration object. Giving up.", + "Revceiving 'Mail domains for kolab22'."); + } + + return($domains); } }