NotifySmtpCheck.php
[Pman.Core] / NotifySmtpCheck.php
index f818c7b..1de2f94 100644 (file)
@@ -33,10 +33,19 @@ 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`;
         
-        print_R($lists);exit;
+        $helo = substr(array_pop(explode(' ', $e)), 0, -2);
         
         $error = array();
         
@@ -56,7 +65,7 @@ class Pman_Core_NotifySmtpCheck extends Pman
                     )
                 );
                 
-                $smtp = new Net_SMTP($server, $settings['port'], '058177247238.ctinets.com', false, 0, $socket_options);
+                $smtp = new Net_SMTP($server, $settings['port'], $helo, false, 0, $socket_options);
                 
                 $smtp->setDebug(true);