From 671efb3027cdc39fb2ede6d1ac503272b582eded Mon Sep 17 00:00:00 2001 From: cajus Date: Fri, 11 Dec 2009 14:29:50 +0000 Subject: [PATCH] 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 --- gosa-plugins/mail/personal/mail/class_mailAccount.inc | 9 +++++++++ 1 file changed, 9 insertions(+) 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; + } + } } -- 2.30.2