From: cajus Date: Fri, 11 Dec 2009 14:29:50 +0000 (+0000) Subject: Added template adaption for mail domain parts. Closes #776 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=671efb3027cdc39fb2ede6d1ac503272b582eded;p=gosa.git Added template adaption for mail domain parts. Closes #776 git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14894 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/mail/personal/mail/class_mailAccount.inc b/gosa-plugins/mail/personal/mail/class_mailAccount.inc index 3dcc585ea..797265237 100644 --- a/gosa-plugins/mail/personal/mail/class_mailAccount.inc +++ b/gosa-plugins/mail/personal/mail/class_mailAccount.inc @@ -1186,6 +1186,15 @@ class mailAccount extends plugin } } $this->mail= strtolower(rewrite($this->mail)); + + // Fix mail address when using templates + if($this->is_account && $this->mailMethod->domainSelectionEnabled()){ + $this->mailDomainPart = preg_replace("/^[^@]*+@/","",$this->mail); + $this->mail = preg_replace("/@.*$/","\\1",$this->mail); + if(!in_array($this->mailDomainPart,$this->mailDomainParts)){ + $this->mailDomainParts[] = $this->mailDomainPart; + } + } }