From:             jjones at aene dot ma dot cx
Operating system: Linux/GNU
PHP version:      4.3.1
PHP Bug Type:     Feature/Change Request
Bug description:  getmxrr() and RFC 974

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 ); }


-- 
Edit bug report at http://bugs.php.net/?id=22445&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22445&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22445&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22445&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22445&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22445&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22445&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22445&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22445&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22445&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22445&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22445&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22445&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22445&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22445&r=gnused

Reply via email to