Merge branch 'master' of http://git.roojs.com:8081/Pman.Core
[Pman.Core] / NotifySmtpCheck.php
index ea1fd3c..886246d 100644 (file)
@@ -33,10 +33,21 @@ class Pman_Core_NotifySmtpCheck extends Pman
         
         $xpath = new DOMXPath($dom);
         
-        $lists = $xpath->query("//code[@class='ip]");
+        $element = $xpath->query("//code[@class='ip']");
         
+        if(!$element->length){
+            return;
+        }
+        
+        $ip = $element->item(0)->nodeValue;
+        
+        $cmd = "host {$ip}";
+        
+        $e = `$cmd`;
+        
+        $helo = substr(array_pop(explode(' ', $e)), 0, -2);
         
-        print_R($lists);exit;
+        print_R($helo);exit;
         
         $error = array();