php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #22445 getmxrr() and RFC 974
Submitted: 2003-02-26 15:05 UTC Modified: 2003-03-02 22:53 UTC
From: jjones at aene dot ma dot cx Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.1 OS: Linux/GNU
Private report: No CVE-ID: None
 [2003-02-26 15:05 UTC] jjones at aene dot ma dot cx
This report is the same as bug #12385, but with getmxrr()'s real-world implementation it seems to need reconsideration.  The only email address validation on many sites == whether or not getmxrr() returns TRUE.

I'm not too concerned with the politics of who should handle this behavior, but with the usage of getmxrr() for address verification purposes in the PHP world, I don't believe it should wait for the appropriate fixes in the appropriate locations.

You can find an amateur fix for this behavior at http://aene.ma.cx/php-4.3.1-getmxrr.diff

From RFC 974 ... It is possible that the list of MXs in the response to the query will be empty.  This is a special case. If the list is empty, mailers should treat it as if it contained one RR, an MX RR with a preference value of 0, and a host name of REMOTE.  (I.e., REMOTE is its only MX).  In addition, the mailer should do no further processing on the   list, but should attempt to deliver the message to REMOTE.  The idea here is that if a domain fails to advertise any information about a particular name we will give it the benefit of the doubt and attempt delivery.

getmxrr() returns FALSE when the MX list is empty.  The simple code below can be used for verification.

if ( getmxrr( "php.net", $array ) ) { var_dump( $array ); }
if ( getmxrr( "aene.ma.cx", $array ) ) { var_dump( $array ); }


Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-02 22:53 UTC] pollita@php.net
Jim's comments on closing Bug #12385 are valid, however this does bear additional documentation.  Reclassifying and closing as I've just updated the manual to reflect.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Aug 15 10:01:28 2024 UTC