Re: Re: [PHP3 CheckDNSRR failing on a valid domain

From: Date: Wed, 25 Aug 1999 15:30:26 +0000
Subject: Re: Re: [PHP3 CheckDNSRR failing on a valid domain
References: 1 2 3 4  Groups: php.dev 
Request: Send a blank email to php-dev+get-10178@lists.php.net to get a copy of this message
> Try your sample code on "e-na.net" and you'll see what I mean. And just to prove my point, I enhanced my example code. e-na.net has no MX records $ src/cgi/php -q x.php e-na.net trying e-na.net 220 whoopi.adgrafix.com ESMTP Sendmail 8.9.3/8.9.3; Wed, 25 Aug 1999 11:10:48 -0400 (EDT) schumann.cx has MX records $ src/cgi/php -q x.php schumann.cx trying mx1.2ns.de 220 guerilla.foo.bar ESMTP trying mail.schumann.cx 220 SCS mail - requiescat in pace Jon B. Postel ESMTP It should be obvious that my code is working. -- Regards, Sascha Schumann Consultant

<? function get_mx_hosts($host) { $mx_hosts = array(); if(!getmxrr($host, &$mx_hosts)) $mx_hosts[] = $host; return $mx_hosts; } $host = $argv[1]; $hosts = get_mx_hosts($host); for($i = 0; $i < count($hosts); $i++) { echo "trying $hosts[$i]\n"; if(($fp = fsockopen($hosts[$i], 25))) { $buf = fgets($fp, 256); fputs($fp, "QUIT\r\n"); fclose($fp); echo "$buf"; } }
« previous php.dev (#10178) next »