Code

Added template adaption for mail domain parts. Closes #776
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 11 Dec 2009 14:29:50 +0000 (14:29 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 11 Dec 2009 14:29:50 +0000 (14:29 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14894 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/mail/personal/mail/class_mailAccount.inc

index 3dcc585ea3111b22cf3076aca1decf5509478f5c..7972652379c962ac629f30ff38d15f8fcc87f0c5 100644 (file)
@@ -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;
+      }
+    }
   }