php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38195 getmxrr broken in 5.1.4; worked in PHP 4.x
Submitted: 2006-07-24 16:36 UTC Modified: 2006-07-25 12:30 UTC
From: sam at ims dot net Assigned:
Status: Not a bug Package: *Network Functions
PHP Version: 5.1.4 OS: Fedora Core 4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sam at ims dot net
New email:
PHP Version: OS:

 

 [2006-07-24 16:36 UTC] sam at ims dot net
Description:
------------
After upgrading from PHP 4.4.1 to PHP 5.1.4, the getmxrr function ceased to work.  It does not throw an error message, but simply terminates the HTTP response at the call.  I've switched to checkdnsrr, which works fine, and is probably a more appropriate call, but since getmxrr is still in the documentation for version 5, this appears to be a bug.

Reproduce code:
---------------
if (getmxrr($host, $email)) return TRUE;

Expected result:
----------------
TRUE returned if $email corresponds to a domain with an MX record; FALSE otherwise.

Actual result:
--------------
Termination of HTTP response.  Neither TRUE nor FALSE returned.  Nothing appears in the Apache error log.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-24 17:02 UTC] tony2001@php.net
Works perfectly fine here:

# php -r 'var_dump(getmxrr("yahoo.com", $var)); var_dump($var);'
bool(true)
array(4) {
  [0]=>
  string(18) "mx3.mail.yahoo.com"
  [1]=>
  string(18) "mx4.mail.yahoo.com"
  [2]=>
  string(18) "mx1.mail.yahoo.com"
  [3]=>
  string(18) "mx2.mail.yahoo.com"
}

 [2006-07-24 18:12 UTC] sam at ims dot net
Doesn't work here (FC 4 machine), but checkdnsrr does:

sam@snoopy:~> php -r 'var_dump(getmxrr("yahoo.com", $var)); var_dump($var);'
sam@snoopy:~>
sam@snoopy:~> php -r 'var_dump(checkdnsrr("yahoo.com"));'
bool(true)
sam@snoopy:~> uname -a
Linux snoopy 2.6.15-1.1830_FC4smp #1 SMP Thu Feb 2 17:39:38 EST 2006 i686 i686 i386 GNU/Linux
s

All works here (FC 5 machine):

sam@lassie:~> php -r 'var_dump(getmxrr("yahoo.com", $var)); var_dump($var);'
bool(true)
array(4) {
  [0]=>
  string(18) "mx2.mail.yahoo.com"
  [1]=>
  string(18) "mx3.mail.yahoo.com"
  [2]=>
  string(18) "mx4.mail.yahoo.com"
  [3]=>
  string(18) "mx1.mail.yahoo.com"
}
sam@lassie:~> uname -a
Linux lassie 2.6.17-1.2157_FC5 #1 Tue Jul 11 22:55:46 EDT 2006 i686 athlon i386 GNU/Linux
sam@lassie:~>
 [2006-07-25 06:58 UTC] tony2001@php.net
Obviously something is wrong on your FC4 machine and nobody except you can find out what exactly is broken there.
 [2006-07-25 12:30 UTC] sam at ims dot net
Yeah, I guess you're right - even though getmxrr worked perfectly fine just before I compiled and upgraded PHP 5.1.4.  Must be a problem with my machine that PHP 5.1.4 exposed.  I guess that's not a bug, although it certainly cost me in web app failure until I found out that it was a PHP call that had worked on that server fine for 5 years and suddenly was broken with a new PHP version.  But, ya know, I think I'll tell my clients that were very upset about it that it's a PHP bug, anyway, because I sure didn't change anything else on the server!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 16:01:31 2024 UTC