From d426ec041b76d8256fa6242790f70f23cf4fbf86 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 8 Sep 2006 03:06:27 +0000 Subject: [PATCH] Added update for goMailServer. Transports were not parsed correctly git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4617 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_goMailServer.inc | 30 ++++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/plugins/admin/systems/class_goMailServer.inc b/plugins/admin/systems/class_goMailServer.inc index a1cbbd248..f72af1d2b 100644 --- a/plugins/admin/systems/class_goMailServer.inc +++ b/plugins/admin/systems/class_goMailServer.inc @@ -111,18 +111,24 @@ class goMailServer extends plugin{ if(isset($this->attrs['postfixTransportTable'])){ $tmp = array(); unset($this->attrs['postfixTransportTable']['count']); - foreach($this->attrs['postfixTransportTable'] as $entry){ - $nr = preg_replace("/:.*$/","",$entry); - $rest= trim(preg_replace("/^[^:]+:/","",$entry)); - $src = preg_replace("/ .*$/","",$rest); - $rest= preg_replace("/^[^ ]+ /","",$rest); - $dst = preg_replace("/^.*:/","",$rest); - $prt = preg_replace("/:.*$/","",$rest); - - $tmp[$nr]['src'] = $src; - $tmp[$nr]['dst'] = $dst; - $tmp[$nr]['prt'] = $prt; - + foreach($this->attrs['postfixTransportTable'] as $entry){ + + //0: offshore.vip.ms-europa.lhsystems.com smtp:172.28.0.2 + + $Number = preg_replace('/^([^:]+):.*$/', '\\1', $entry); + $Rest = trim(preg_replace("/^[0-9]*:/","",$entry)); + + $Protocol_Destination = preg_replace("/^.*\ /","",$Rest); + $Source = preg_replace("/\ .*$/","",$Rest); + + $Protocol = preg_replace ('/^([^:]+):.*$/', '\\1' ,trim($Protocol_Destination)); + $Destination = preg_replace ('/^[^:]+:(.*)$/', '\\1' ,trim($Protocol_Destination)); + + $Destination = preg_replace ("/[\[\]]/","",$Destination); + + $tmp[$Number]['src'] = $Source; + $tmp[$Number]['dst'] = $Destination; + $tmp[$Number]['prt'] = $Protocol; } ksort($tmp); foreach($tmp as $entry){ -- 2.30.2